From a992c9c01764c76caf920313bbdd1c8968c246ca Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 6 Apr 2026 19:06:53 +0000 Subject: [PATCH 1/2] feat: populate the `persisted_data_checksums` field with object checksums on write object / query write status responses docs: improve wording around `object_checksums` in bidi write object requests PiperOrigin-RevId: 895357062 Source-Link: https://github.com/googleapis/googleapis/commit/d73dfb3c3be52245625b951b9c0bcf65163c549f Source-Link: https://github.com/googleapis/googleapis-gen/commit/7e7398240bfa0cf54d7042169fe14afb9a77ac64 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXN0b3JhZ2UtY29udHJvbC8uT3dsQm90LnlhbWwiLCJoIjoiN2U3Mzk4MjQwYmZhMGNmNTRkNzA0MjE2OWZlMTRhZmI5YTc3YWM2NCJ9 --- .../google-storage-control/.OwlBot.yaml | 19 + .../google-storage-control/.eslintignore | 7 + .../google-storage-control/.eslintrc.json | 3 + .../google-storage-control/.gitattributes | 4 + .../google-storage-control/.gitignore | 14 + .../google-storage-control/.mocharc.js | 33 + owl-bot-staging/google-storage-control/.nycrc | 24 + .../google-storage-control/.prettierignore | 6 + .../google-storage-control/.prettierrc.js | 22 + .../google-storage-control/CODE_OF_CONDUCT.md | 94 + .../google-storage-control/CONTRIBUTING.md | 76 + .../google-storage-control/LICENSE | 202 + .../google-storage-control/README.md | 147 + .../storage/control/v2/storage_control.proto | 1464 + .../protos/google/storage/v2/storage.proto | 3175 + .../google-storage-control/protos/protos.d.ts | 25952 ++++++ .../google-storage-control/protos/protos.js | 68272 ++++++++++++++++ .../google-storage-control/protos/protos.json | 8823 ++ ...et_metadata_google.storage.control.v2.json | 1339 + .../snippet_metadata_google.storage.v2.json | 339 + .../generated/v2/storage.create_bucket.js | 96 + .../generated/v2/storage.delete_bucket.js | 70 + .../generated/v2/storage.get_bucket.js | 77 + .../generated/v2/storage.list_buckets.js | 91 + .../storage.lock_bucket_retention_policy.js | 67 + .../generated/v2/storage.update_bucket.js | 94 + .../storage_control.create_anywhere_cache.js | 77 + .../v2/storage_control.create_folder.js | 89 + .../storage_control.create_managed_folder.js | 80 + .../v2/storage_control.delete_folder.js | 77 + ...storage_control.delete_folder_recursive.js | 79 + .../storage_control.delete_managed_folder.js | 85 + .../storage_control.disable_anywhere_cache.js | 68 + .../v2/storage_control.get_anywhere_cache.js | 67 + .../v2/storage_control.get_folder.js | 77 + ..._control.get_folder_intelligence_config.js | 63 + .../v2/storage_control.get_iam_policy.js | 67 + .../v2/storage_control.get_managed_folder.js | 78 + ...ol.get_organization_intelligence_config.js | 63 + ...control.get_project_intelligence_config.js | 63 + .../v2/storage_control.get_storage_layout.js | 72 + .../storage_control.list_anywhere_caches.js | 78 + .../v2/storage_control.list_folders.js | 104 + .../storage_control.list_managed_folders.js | 83 + .../storage_control.pause_anywhere_cache.js | 68 + .../v2/storage_control.rename_folder.js | 84 + .../storage_control.resume_anywhere_cache.js | 68 + .../v2/storage_control.set_iam_policy.js | 77 + .../storage_control.test_iam_permissions.js | 70 + .../storage_control.update_anywhere_cache.js | 79 + ...ntrol.update_folder_intelligence_config.js | 73 + ...update_organization_intelligence_config.js | 73 + ...trol.update_project_intelligence_config.js | 73 + .../google-storage-control/src/index.ts | 28 + .../src/v2/gapic_metadata.json | 305 + .../google-storage-control/src/v2/index.ts | 19 + .../src/v2/storage_client.ts | 1466 + .../src/v2/storage_client_config.json | 65 + .../src/v2/storage_control_client.ts | 4635 ++ .../src/v2/storage_control_client_config.json | 177 + .../src/v2/storage_control_proto_list.json | 3 + .../src/v2/storage_proto_list.json | 3 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../system-test/install.ts | 49 + .../test/gapic_storage_control_v2.ts | 4477 + .../test/gapic_storage_v2.ts | 1160 + .../google-storage-control/tsconfig.json | 22 + .../google-storage-control/webpack.config.js | 64 + 69 files changed, 125077 insertions(+) create mode 100644 owl-bot-staging/google-storage-control/.OwlBot.yaml create mode 100644 owl-bot-staging/google-storage-control/.eslintignore create mode 100644 owl-bot-staging/google-storage-control/.eslintrc.json create mode 100644 owl-bot-staging/google-storage-control/.gitattributes create mode 100644 owl-bot-staging/google-storage-control/.gitignore create mode 100644 owl-bot-staging/google-storage-control/.mocharc.js create mode 100644 owl-bot-staging/google-storage-control/.nycrc create mode 100644 owl-bot-staging/google-storage-control/.prettierignore create mode 100644 owl-bot-staging/google-storage-control/.prettierrc.js create mode 100644 owl-bot-staging/google-storage-control/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-storage-control/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-storage-control/LICENSE create mode 100644 owl-bot-staging/google-storage-control/README.md create mode 100644 owl-bot-staging/google-storage-control/protos/google/storage/control/v2/storage_control.proto create mode 100644 owl-bot-staging/google-storage-control/protos/google/storage/v2/storage.proto create mode 100644 owl-bot-staging/google-storage-control/protos/protos.d.ts create mode 100644 owl-bot-staging/google-storage-control/protos/protos.js create mode 100644 owl-bot-staging/google-storage-control/protos/protos.json create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.v2.json create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage.create_bucket.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage.delete_bucket.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage.get_bucket.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage.list_buckets.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage.lock_bucket_retention_policy.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage.update_bucket.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_anywhere_cache.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_managed_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder_recursive.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_managed_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.disable_anywhere_cache.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_anywhere_cache.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder_intelligence_config.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_iam_policy.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_managed_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_organization_intelligence_config.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_project_intelligence_config.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_storage_layout.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_anywhere_caches.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_folders.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_managed_folders.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.pause_anywhere_cache.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.rename_folder.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.resume_anywhere_cache.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.set_iam_policy.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.test_iam_permissions.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_anywhere_cache.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_folder_intelligence_config.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_organization_intelligence_config.js create mode 100644 owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_project_intelligence_config.js create mode 100644 owl-bot-staging/google-storage-control/src/index.ts create mode 100644 owl-bot-staging/google-storage-control/src/v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-storage-control/src/v2/index.ts create mode 100644 owl-bot-staging/google-storage-control/src/v2/storage_client.ts create mode 100644 owl-bot-staging/google-storage-control/src/v2/storage_client_config.json create mode 100644 owl-bot-staging/google-storage-control/src/v2/storage_control_client.ts create mode 100644 owl-bot-staging/google-storage-control/src/v2/storage_control_client_config.json create mode 100644 owl-bot-staging/google-storage-control/src/v2/storage_control_proto_list.json create mode 100644 owl-bot-staging/google-storage-control/src/v2/storage_proto_list.json create mode 100644 owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-storage-control/system-test/install.ts create mode 100644 owl-bot-staging/google-storage-control/test/gapic_storage_control_v2.ts create mode 100644 owl-bot-staging/google-storage-control/test/gapic_storage_v2.ts create mode 100644 owl-bot-staging/google-storage-control/tsconfig.json create mode 100644 owl-bot-staging/google-storage-control/webpack.config.js diff --git a/owl-bot-staging/google-storage-control/.OwlBot.yaml b/owl-bot-staging/google-storage-control/.OwlBot.yaml new file mode 100644 index 00000000000..688844a25c1 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/storage/control/google-storage-control-nodejs + dest: /owl-bot-staging/google-storage-control + +api-name: control \ No newline at end of file diff --git a/owl-bot-staging/google-storage-control/.eslintignore b/owl-bot-staging/google-storage-control/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-storage-control/.eslintrc.json b/owl-bot-staging/google-storage-control/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-storage-control/.gitattributes b/owl-bot-staging/google-storage-control/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-storage-control/.gitignore b/owl-bot-staging/google-storage-control/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-storage-control/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-storage-control/.mocharc.js b/owl-bot-staging/google-storage-control/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-storage-control/.nycrc b/owl-bot-staging/google-storage-control/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.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 +} \ No newline at end of file diff --git a/owl-bot-staging/google-storage-control/.prettierignore b/owl-bot-staging/google-storage-control/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-storage-control/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-storage-control/.prettierrc.js b/owl-bot-staging/google-storage-control/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-storage-control/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-storage-control/CODE_OF_CONDUCT.md b/owl-bot-staging/google-storage-control/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-storage-control/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/owl-bot-staging/google-storage-control/CONTRIBUTING.md b/owl-bot-staging/google-storage-control/CONTRIBUTING.md new file mode 100644 index 00000000000..09c4066f429 --- /dev/null +++ b/owl-bot-staging/google-storage-control/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 Control 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=storage.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-storage-control/LICENSE b/owl-bot-staging/google-storage-control/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-storage-control/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/owl-bot-staging/google-storage-control/README.md b/owl-bot-staging/google-storage-control/README.md new file mode 100644 index 00000000000..dcafdfd910e --- /dev/null +++ b/owl-bot-staging/google-storage-control/README.md @@ -0,0 +1,147 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Storage Control API: Nodejs Client][homepage] + +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. + +[![npm version](https://img.shields.io/npm/v/@google-cloud/storage-control.svg)](https://www.npmjs.org/package/@google-cloud/storage-control) + +Storage Control API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Storage Control API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/storage-control/latest) +* [Storage Control API Documentation](https://cloud.google.com/storage/docs/overview) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Storage Control API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/storage-control +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| storage | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json) | +| storage | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.v2.json) | +| create bucket | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage.create_bucket.js) | +| delete bucket | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage.delete_bucket.js) | +| get bucket | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage.get_bucket.js) | +| list buckets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage.list_buckets.js) | +| lock bucket retention policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage.lock_bucket_retention_policy.js) | +| update bucket | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage.update_bucket.js) | +| create anywhere cache | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.create_anywhere_cache.js) | +| create folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.create_folder.js) | +| create managed folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.create_managed_folder.js) | +| delete folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.delete_folder.js) | +| delete folder recursive | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.delete_folder_recursive.js) | +| delete managed folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.delete_managed_folder.js) | +| disable anywhere cache | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.disable_anywhere_cache.js) | +| get anywhere cache | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_anywhere_cache.js) | +| get folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_folder.js) | +| get folder intelligence config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_folder_intelligence_config.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_iam_policy.js) | +| get managed folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_managed_folder.js) | +| get organization intelligence config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_organization_intelligence_config.js) | +| get project intelligence config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_project_intelligence_config.js) | +| get storage layout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.get_storage_layout.js) | +| list anywhere caches | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.list_anywhere_caches.js) | +| list folders | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.list_folders.js) | +| list managed folders | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.list_managed_folders.js) | +| pause anywhere cache | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.pause_anywhere_cache.js) | +| rename folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.rename_folder.js) | +| resume anywhere cache | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.resume_anywhere_cache.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.set_iam_policy.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.test_iam_permissions.js) | +| update anywhere cache | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.update_anywhere_cache.js) | +| update folder intelligence config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.update_folder_intelligence_config.js) | +| update organization intelligence config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.update_organization_intelligence_config.js) | +| update project intelligence config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples/generated/v2/storage_control.update_project_intelligence_config.js) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/storage-control@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +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/packages/google-storage-control/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/LICENSE) + +[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=storage.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-storage-control diff --git a/owl-bot-staging/google-storage-control/protos/google/storage/control/v2/storage_control.proto b/owl-bot-staging/google-storage-control/protos/google/storage/control/v2/storage_control.proto new file mode 100644 index 00000000000..015ad010b03 --- /dev/null +++ b/owl-bot-staging/google-storage-control/protos/google/storage/control/v2/storage_control.proto @@ -0,0 +1,1464 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.storage.control.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/api/routing.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"; + +option csharp_namespace = "Google.Cloud.Storage.Control.V2"; +option go_package = "cloud.google.com/go/storage/control/apiv2/controlpb;controlpb"; +option java_multiple_files = true; +option java_outer_classname = "StorageControlProto"; +option java_package = "com.google.storage.control.v2"; +option php_namespace = "Google\\Cloud\\Storage\\Control\\V2"; +option ruby_package = "Google::Cloud::Storage::Control::V2"; +option (google.api.resource_definition) = { + type: "storage.googleapis.com/Bucket" + pattern: "projects/{project}/buckets/{bucket}" +}; + +// StorageControl service includes selected control plane operations. +service StorageControl { + option (google.api.default_host) = "storage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/devstorage.full_control," + "https://www.googleapis.com/auth/devstorage.read_only," + "https://www.googleapis.com/auth/devstorage.read_write"; + + // Creates a new folder. This operation is only applicable to a hierarchical + // namespace enabled bucket. + rpc CreateFolder(CreateFolderRequest) returns (Folder) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent,folder,folder_id"; + } + + // Permanently deletes an empty folder. This operation is only applicable to a + // hierarchical namespace enabled bucket. + rpc DeleteFolder(DeleteFolderRequest) returns (google.protobuf.Empty) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns metadata for the specified folder. This operation is only + // applicable to a hierarchical namespace enabled bucket. + rpc GetFolder(GetFolderRequest) returns (Folder) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a list of folders. This operation is only applicable to a + // hierarchical namespace enabled bucket. + rpc ListFolders(ListFoldersRequest) returns (ListFoldersResponse) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent"; + } + + // Renames a source folder to a destination folder. This operation is only + // applicable to a hierarchical namespace enabled bucket. During a rename, the + // source and destination folders are locked until the long running operation + // completes. + rpc RenameFolder(RenameFolderRequest) returns (google.longrunning.Operation) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name,destination_folder_id"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "RenameFolderMetadata" + }; + } + + // Deletes a folder recursively. This operation is only applicable to a + // hierarchical namespace enabled bucket. + rpc DeleteFolderRecursive(DeleteFolderRecursiveRequest) + returns (google.longrunning.Operation) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteFolderRecursiveMetadata" + }; + } + + // Returns the storage layout configuration for a given bucket. + rpc GetStorageLayout(GetStorageLayoutRequest) returns (StorageLayout) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new managed folder. + rpc CreateManagedFolder(CreateManagedFolderRequest) returns (ManagedFolder) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = + "parent,managed_folder,managed_folder_id"; + } + + // Permanently deletes an empty managed folder. + rpc DeleteManagedFolder(DeleteManagedFolderRequest) + returns (google.protobuf.Empty) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns metadata for the specified managed folder. + rpc GetManagedFolder(GetManagedFolderRequest) returns (ManagedFolder) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a list of managed folders for a given bucket. + rpc ListManagedFolders(ListManagedFoldersRequest) + returns (ListManagedFoldersResponse) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates an Anywhere Cache instance. + rpc CreateAnywhereCache(CreateAnywhereCacheRequest) + returns (google.longrunning.Operation) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent,anywhere_cache"; + option (google.longrunning.operation_info) = { + response_type: "AnywhereCache" + metadata_type: "CreateAnywhereCacheMetadata" + }; + } + + // Updates an Anywhere Cache instance. Mutable fields include `ttl` and + // `admission_policy`. + rpc UpdateAnywhereCache(UpdateAnywhereCacheRequest) + returns (google.longrunning.Operation) { + option (google.api.routing) = { + routing_parameters { + field: "anywhere_cache.name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "anywhere_cache,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AnywhereCache" + metadata_type: "UpdateAnywhereCacheMetadata" + }; + } + + // Disables an Anywhere Cache instance. A disabled instance is read-only. The + // disablement could be revoked by calling ResumeAnywhereCache. The cache + // instance will be deleted automatically if it remains in the disabled state + // for at least one hour. + rpc DisableAnywhereCache(DisableAnywhereCacheRequest) + returns (AnywhereCache) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Pauses an Anywhere Cache instance. + rpc PauseAnywhereCache(PauseAnywhereCacheRequest) returns (AnywhereCache) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Resumes a disabled or paused Anywhere Cache instance. + rpc ResumeAnywhereCache(ResumeAnywhereCacheRequest) returns (AnywhereCache) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets an Anywhere Cache instance. + rpc GetAnywhereCache(GetAnywhereCacheRequest) returns (AnywhereCache) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists Anywhere Cache instances for a given bucket. + rpc ListAnywhereCaches(ListAnywhereCachesRequest) + returns (ListAnywhereCachesResponse) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the Project scoped singleton IntelligenceConfig resource. + rpc GetProjectIntelligenceConfig(GetProjectIntelligenceConfigRequest) + returns (IntelligenceConfig) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/intelligenceConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the Project scoped singleton IntelligenceConfig resource. + rpc UpdateProjectIntelligenceConfig(UpdateProjectIntelligenceConfigRequest) + returns (IntelligenceConfig) { + option (google.api.http) = { + patch: "/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}" + body: "intelligence_config" + }; + option (google.api.method_signature) = "intelligence_config,update_mask"; + } + + // Returns the Folder scoped singleton IntelligenceConfig resource. + rpc GetFolderIntelligenceConfig(GetFolderIntelligenceConfigRequest) + returns (IntelligenceConfig) { + option (google.api.http) = { + get: "/v2/{name=folders/*/locations/*/intelligenceConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the Folder scoped singleton IntelligenceConfig resource. + rpc UpdateFolderIntelligenceConfig(UpdateFolderIntelligenceConfigRequest) + returns (IntelligenceConfig) { + option (google.api.http) = { + patch: "/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}" + body: "intelligence_config" + }; + option (google.api.method_signature) = "intelligence_config,update_mask"; + } + + // Returns the Organization scoped singleton IntelligenceConfig resource. + rpc GetOrganizationIntelligenceConfig( + GetOrganizationIntelligenceConfigRequest) returns (IntelligenceConfig) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/locations/*/intelligenceConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the Organization scoped singleton IntelligenceConfig resource. + rpc UpdateOrganizationIntelligenceConfig( + UpdateOrganizationIntelligenceConfigRequest) + returns (IntelligenceConfig) { + option (google.api.http) = { + patch: "/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}" + body: "intelligence_config" + }; + option (google.api.method_signature) = "intelligence_config,update_mask"; + } + + // Gets the IAM policy for a specified bucket. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.routing) = { + routing_parameters { field: "resource" path_template: "{bucket=**}" } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Updates an IAM policy for the specified bucket. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.routing) = { + routing_parameters { field: "resource" path_template: "{bucket=**}" } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Tests a set of permissions on the given bucket, object, or managed folder + // to see which, if any, are held by the caller. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, + // `projects/_/buckets/{bucket}/objects/{object}` for an object, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.routing) = { + routing_parameters { field: "resource" path_template: "{bucket=**}" } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/objects/**" + } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/managedFolders/**" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// Contains information about a pending rename operation. +message PendingRenameInfo { + // Output only. The name of the rename operation. + string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A folder resource. This resource can only exist in a hierarchical namespace +// enabled bucket. +message Folder { + option (google.api.resource) = { + type: "storage.googleapis.com/Folder" + pattern: "projects/{project}/buckets/{bucket}/folders/{folder=**}" + plural: "folders" + singular: "folder" + }; + + // Identifier. The name of this folder. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The version of the metadata for this folder. Used for + // preconditions and for detecting changes in metadata. + int64 metageneration = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The creation time of the folder. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The modification time of the folder. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only present if the folder is part of an ongoing RenameFolder + // operation. Contains information which can be used to query the operation + // status. The presence of this field also indicates all write operations are + // blocked for this folder, including folder, managed folder, and object + // operations. + PendingRenameInfo pending_rename_info = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetFolder. This operation is only applicable to a +// hierarchical namespace enabled bucket. +message GetFolderRequest { + // Required. Name of the folder. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration matches the given value. + optional int64 if_metageneration_match = 3; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 4; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for CreateFolder. This operation is only applicable to a +// hierarchical namespace enabled bucket. +message CreateFolderRequest { + // Required. Name of the bucket in which the folder will reside. The bucket + // must be a hierarchical namespace enabled bucket. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/Folder" + } + ]; + + // Required. Properties of the new folder being created. + // The bucket and name of the folder are specified in the parent and folder_id + // fields, respectively. Populating those fields in `folder` will result in an + // error. + Folder folder = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The full name of a folder, including all its parent folders. + // Folders use single '/' characters as a delimiter. + // The folder_id must end with a slash. + // For example, the folder_id of "books/biographies/" would create a new + // "biographies/" folder under the "books/" folder. + string folder_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, parent folder doesn't have to be present and all missing + // ancestor folders will be created atomically. + bool recursive = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteFolder. This operation is only applicable to a +// hierarchical namespace enabled bucket. +message DeleteFolderRequest { + // Required. Name of the folder. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration matches the given value. + optional int64 if_metageneration_match = 3; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 4; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for ListFolders. This operation is only applicable to a +// hierarchical namespace enabled bucket. +message ListFoldersRequest { + // Required. Name of the bucket in which to look for folders. The bucket must + // be a hierarchical namespace enabled bucket. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/Folder" + } + ]; + + // Optional. Maximum number of folders to return in a single response. The + // service will use this parameter or 1,000 items, whichever is smaller. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A previously-returned page token representing part of the larger + // set of results to view. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to folders whose names begin with this prefix. + // If set, the value must either be an empty string or end with a '/'. + string prefix = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, returns results in a directory-like mode. The results + // will only include folders that either exactly match the above prefix, or + // are one level below the prefix. The only supported value is '/'. + string delimiter = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to folders whose names are lexicographically equal + // to or after lexicographic_start. If lexicographic_end is also set, the + // folders listed have names between lexicographic_start (inclusive) and + // lexicographic_end (exclusive). + string lexicographic_start = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to folders whose names are lexicographically + // before lexicographic_end. If lexicographic_start is also set, the folders + // listed have names between lexicographic_start (inclusive) and + // lexicographic_end (exclusive). + string lexicographic_end = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 9 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response message for ListFolders. +message ListFoldersResponse { + // The list of child folders + repeated Folder folders = 1; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 2; +} + +// Request message for RenameFolder. This operation is only applicable to a +// hierarchical namespace enabled bucket. +message RenameFolderRequest { + // Required. Name of the source folder being renamed. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Required. The destination folder ID, e.g. `foo/bar/`. + string destination_folder_id = 8 [(google.api.field_behavior) = REQUIRED]; + + // Makes the operation only succeed conditional on whether the source + // folder's current metageneration matches the given value. + optional int64 if_metageneration_match = 4; + + // Makes the operation only succeed conditional on whether the source + // folder's current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 5; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 6 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteFolderRecursive. +message DeleteFolderRecursiveRequest { + // Required. Name of the folder being deleted, however all of its contents + // will be deleted too. Format: + // `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Optional. Makes the operation only succeed conditional on whether the root + // folder's current metageneration matches the given value. + optional int64 if_metageneration_match = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation only succeed conditional on whether the root + // folder's current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The message contains metadata that is common to all Storage Control +// long-running operations, present in its `google.longrunning.Operation` +// messages, and accessible via `metadata.common_metadata`. +message CommonLongRunningOperationMetadata { + // 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. The time the operation was last modified. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of operation invoked. + string type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation. + bool requested_cancellation = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The estimated progress of the operation in percentage [0, + // 100]. The value -1 means the progress is unknown. + int32 progress_percent = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message returned in the metadata field of the Operation resource for +// RenameFolder operations. +message RenameFolderMetadata { + // Generic metadata for the long running operation. + CommonLongRunningOperationMetadata common_metadata = 1; + + // The path of the source folder. + string source_folder_id = 2; + + // The path of the destination folder. + string destination_folder_id = 3; +} + +// Message returned in the metadata field of the Operation resource for +// DeleteFolderRecursive operations. +message DeleteFolderRecursiveMetadata { + // Generic metadata for the long running operation. + CommonLongRunningOperationMetadata common_metadata = 1; + + // The path of the folder recursively deleted. + string folder_id = 2; +} + +// The storage layout configuration of a bucket. +message StorageLayout { + option (google.api.resource) = { + type: "storage.googleapis.com/StorageLayout" + pattern: "projects/{project}/buckets/{bucket}/storageLayout" + plural: "storageLayouts" + singular: "storageLayout" + }; + + // Configuration for Custom Dual Regions. It should specify precisely two + // eligible regions within the same Multiregion. More information on regions + // may be found [here](https://cloud.google.com/storage/docs/locations). + message CustomPlacementConfig { + // List of locations to use for data placement. + repeated string data_locations = 1; + } + + // Configuration for a bucket's hierarchical namespace feature. + message HierarchicalNamespace { + // Enables the hierarchical namespace feature. + bool enabled = 1; + } + + // Output only. The name of the StorageLayout resource. + // Format: `projects/{project}/buckets/{bucket}/storageLayout` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location of the bucket. + string location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location type of the bucket (region, dual-region, + // multi-region, etc). + string location_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The data placement configuration for custom dual region. If + // there is no configuration, this is not a custom dual region bucket. + CustomPlacementConfig custom_placement_config = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The bucket's hierarchical namespace configuration. If there is + // no configuration, the hierarchical namespace is disabled. + HierarchicalNamespace hierarchical_namespace = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetStorageLayout. +message GetStorageLayoutRequest { + // Required. The name of the StorageLayout resource. + // Format: `projects/{project}/buckets/{bucket}/storageLayout` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/StorageLayout" + } + ]; + + // An optional prefix used for permission check. It is useful when the caller + // only has limited permissions under a specific prefix. + string prefix = 2; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A managed folder. +message ManagedFolder { + option (google.api.resource) = { + type: "storage.googleapis.com/ManagedFolder" + pattern: "projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}" + plural: "managedFolders" + singular: "managedFolder" + }; + + // Identifier. The name of this managed folder. + // Format: + // `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The metadata version of this managed folder. It increases + // whenever the metadata is updated. Used for preconditions and for detecting + // changes in metadata. Managed folders don't have a generation number. + int64 metageneration = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The creation time of the managed folder. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The modification time of the managed folder. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetManagedFolder. +message GetManagedFolderRequest { + // Required. Name of the managed folder. + // Format: + // `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + string name = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/ManagedFolder" + } + ]; + + // The operation succeeds conditional on the managed folder's current + // metageneration matching the value here specified. + optional int64 if_metageneration_match = 3; + + // The operation succeeds conditional on the managed folder's current + // metageneration NOT matching the value here specified. + optional int64 if_metageneration_not_match = 4; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for CreateManagedFolder. +message CreateManagedFolderRequest { + // Required. Name of the bucket this managed folder belongs to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/ManagedFolder" + } + ]; + + // Required. Properties of the managed folder being created. + // The bucket and managed folder names are specified in the `parent` and + // `managed_folder_id` fields. Populating these fields in `managed_folder` + // will result in an error. + ManagedFolder managed_folder = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the managed folder. It uses a single `/` as delimiter + // and leading and trailing `/` are allowed. + string managed_folder_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// DeleteManagedFolder RPC request message. +message DeleteManagedFolderRequest { + // Required. Name of the managed folder. + // Format: + // `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + string name = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/ManagedFolder" + } + ]; + + // The operation succeeds conditional on the managed folder's current + // metageneration matching the value here specified. + optional int64 if_metageneration_match = 3; + + // The operation succeeds conditional on the managed folder's current + // metageneration NOT matching the value here specified. + optional int64 if_metageneration_not_match = 4; + + // Allows deletion of a managed folder even if it is not empty. + // A managed folder is empty if it manages no child managed folders or + // objects. Caller must have permission for + // storage.managedFolders.setIamPolicy. + bool allow_non_empty = 5; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 6 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for ListManagedFolders. +message ListManagedFoldersRequest { + // Required. Name of the bucket this managed folder belongs to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/ManagedFolder" + } + ]; + + // Optional. Maximum number of managed folders to return in a single response. + // The service will use this parameter or 1,000 items, whichever is smaller. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A previously-returned page token representing part of the larger + // set of results to view. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to match managed folders with name starting with + // this prefix. + string prefix = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response message for ListManagedFolders. +message ListManagedFoldersResponse { + // The list of matching managed folders + repeated ManagedFolder managed_folders = 1; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 2; +} + +// Message returned in the metadata field of the Operation resource for +// CreateAnywhereCache operations. +message CreateAnywhereCacheMetadata { + // Generic metadata for the long running operation. + CommonLongRunningOperationMetadata common_metadata = 1; + + // Anywhere Cache ID. + optional string anywhere_cache_id = 2; + + // The zone in which the cache instance is running. For example, + // us-central1-a. + optional string zone = 6; + + // Anywhere Cache entry's TTL. A cache-level config that is applied to all new + // cache entries on admission. Default ttl value (24hrs) is applied if not + // specified in the create request. + optional google.protobuf.Duration ttl = 3; + + // Anywhere Cache entry Admission Policy in kebab-case (e.g., + // "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is + // applied if not specified in the create request. + optional string admission_policy = 5; +} + +// Message returned in the metadata field of the Operation resource for +// UpdateAnywhereCache operation. +message UpdateAnywhereCacheMetadata { + // Generic metadata for the long running operation. + CommonLongRunningOperationMetadata common_metadata = 1; + + // Anywhere Cache ID. + optional string anywhere_cache_id = 2; + + // The zone in which the cache instance is running. For example, + // us-central1-a. + optional string zone = 5; + + // Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that + // is applied to all new cache entries on admission. If `ttl` is pending + // update, this field equals to the new value specified in the Update request. + optional google.protobuf.Duration ttl = 3; + + // L4 Cache entry Admission Policy in kebab-case (e.g., + // "admit-on-first-miss"). If `admission_policy` is pending + // update, this field equals to the new value specified in the Update request. + optional string admission_policy = 4; +} + +// An Anywhere Cache Instance. +message AnywhereCache { + option (google.api.resource) = { + type: "storage.googleapis.com/AnywhereCache" + pattern: "projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}" + plural: "anywhereCaches" + singular: "anywhereCache" + }; + + // Immutable. The resource name of this AnywhereCache. + // Format: + // `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The zone in which the cache instance is running. For example, + // us-central1-a. + string zone = 10 [(google.api.field_behavior) = IMMUTABLE]; + + // Cache entry TTL (ranges between 1h to 7d). This is a cache-level config + // that defines how long a cache entry can live. Default ttl value (24hrs) + // is applied if not specified in the create request. TTL must be in whole + // seconds. + google.protobuf.Duration ttl = 3; + + // Cache admission policy. Valid policies includes: + // `admit-on-first-miss` and `admit-on-second-miss`. Defaults to + // `admit-on-first-miss`. Default value is applied if not specified in the + // create request. + string admission_policy = 9; + + // Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED. + string state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when Anywhere cache instance is allocated. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when Anywhere cache instance is last updated, including + // creation. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if there is an active update operation against this cache + // instance. Subsequential update requests will be rejected if this field is + // true. Output only. + bool pending_update = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for CreateAnywhereCache. +message CreateAnywhereCacheRequest { + // Required. The bucket to which this cache belongs. + // Format: `projects/{project}/buckets/{bucket}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/AnywhereCache" + } + ]; + + // Required. Properties of the Anywhere Cache instance being created. + // The parent bucket name is specified in the `parent` field. Server uses the + // default value of `ttl` or `admission_policy` if not specified in + // request. + AnywhereCache anywhere_cache = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateAnywhereCache. +message UpdateAnywhereCacheRequest { + // Required. The Anywhere Cache instance to be updated. + AnywhereCache anywhere_cache = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields to be updated. Mutable fields of AnywhereCache + // include `ttl` and `admission_policy`. + // + // To specify ALL fields, specify a single field with the value `*`. Note: We + // recommend against doing this. If a new field is introduced at a later time, + // an older client updating with the `*` may accidentally reset the new + // field's value. + // + // Not specifying any fields is an error. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DisableAnywhereCache. +message DisableAnywhereCacheRequest { + // Required. The name field in the request should be: + // `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/AnywhereCache" + } + ]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for PauseAnywhereCache. +message PauseAnywhereCacheRequest { + // Required. The name field in the request should be: + // `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/AnywhereCache" + } + ]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for ResumeAnywhereCache. +message ResumeAnywhereCacheRequest { + // Required. The name field in the request should be: + // `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/AnywhereCache" + } + ]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for GetAnywhereCache. +message GetAnywhereCacheRequest { + // Required. The name field in the request should be: + // `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/AnywhereCache" + } + ]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for ListAnywhereCaches. +message ListAnywhereCachesRequest { + // Required. The bucket to which this cache belongs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/AnywhereCache" + } + ]; + + // Maximum number of caches to return in a single response. + // The service will use this parameter or 1,000 items, whichever is smaller. + int32 page_size = 2; + + // A previously-returned page token representing part of the larger set of + // results to view. + string page_token = 3; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response message for ListAnywhereCaches. +message ListAnywhereCachesResponse { + // The list of items. + repeated AnywhereCache anywhere_caches = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The `IntelligenceConfig` resource associated with your organization, folder, +// or project. +message IntelligenceConfig { + option (google.api.resource) = { + type: "storage.googleapis.com/IntelligenceConfig" + pattern: "folders/{folder}/locations/{location}/intelligenceConfig" + pattern: "organizations/{org}/locations/{location}/intelligenceConfig" + pattern: "projects/{project}/locations/{location}/intelligenceConfig" + plural: "intelligenceConfigs" + singular: "intelligenceConfig" + }; + + // The edition configuration of the `IntelligenceConfig` resource. This + // signifies the edition used for configuring the `IntelligenceConfig` + // resource and can only take the following values: + // `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and + // `TRIAL`. + enum EditionConfig { + // This is an unknown edition of the resource. + EDITION_CONFIG_UNSPECIFIED = 0; + + // The inherited edition from the parent and filters. This is the default + // edition when there is no `IntelligenceConfig` setup for a GCP resource. + INHERIT = 1; + + // The edition configuration is disabled for the `IntelligenceConfig` + // resource and its children. Filters are not applicable. + DISABLED = 2; + + // The `IntelligenceConfig` resource is of STANDARD edition. + STANDARD = 3; + + // The `IntelligenceConfig` resource is available in `TRIAL` edition. During + // the trial period, Cloud Storage does not charge for Storage Intelligence + // usage. You can specify the buckets to include in the trial period by + // using filters. At the end of the trial period, the `IntelligenceConfig` + // resource is upgraded to `STANDARD` edition. + TRIAL = 5; + } + + // Filter over location and bucket using include or exclude semantics. + // Resources that match the include or exclude filter are exclusively included + // or excluded from the Storage Intelligence plan. + message Filter { + // Collection of bucket locations. + message CloudStorageLocations { + // Optional. Bucket locations. Location can be any of the Cloud Storage + // regions specified in lower case format. For example, `us-east1`, + // `us-west1`. + repeated string locations = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Collection of buckets. + message CloudStorageBuckets { + // Optional. A regex pattern for matching bucket names. Regex should + // follow the syntax specified in + // [google/re2](https://github.com/google/re2). For example, + // `^sample_.*` matches all buckets of the form + // `gs://sample_bucket-1`, `gs://sample_bucket-2`, + // `gs://sample_bucket-n` but not `gs://test_sample_bucket`. + // If you want to match a single bucket, say `gs://sample_bucket`, + // use `sample_bucket`. + repeated string bucket_id_regexes = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Bucket locations to include or exclude. + oneof cloud_storage_locations { + // Bucket locations to include. + CloudStorageLocations included_cloud_storage_locations = 1; + + // Bucket locations to exclude. + CloudStorageLocations excluded_cloud_storage_locations = 2; + } + + // Buckets to include or exclude. + oneof cloud_storage_buckets { + // Buckets to include. + CloudStorageBuckets included_cloud_storage_buckets = 3; + + // Buckets to exclude. + CloudStorageBuckets excluded_cloud_storage_buckets = 4; + } + } + + // The effective `IntelligenceConfig` for the resource. + message EffectiveIntelligenceConfig { + // The effective edition of the `IntelligenceConfig` resource. + enum EffectiveEdition { + // This is an unknown edition of the resource. + EFFECTIVE_EDITION_UNSPECIFIED = 0; + + // No edition. + NONE = 1; + + // The `IntelligenceConfig` resource is of STANDARD edition. + STANDARD = 2; + } + + // Output only. The `IntelligenceConfig` edition that is applicable for the + // resource. + EffectiveEdition effective_edition = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The `IntelligenceConfig` resource that is applied for the + // target resource. Format: + // `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig` + string intelligence_config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The trial configuration of the `IntelligenceConfig` resource. + message TrialConfig { + // Output only. The time at which the trial expires. + google.protobuf.Timestamp expire_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier. The name of the `IntelligenceConfig` resource associated with + // your organization, folder, or project. + // + // The name format varies based on the GCP resource hierarchy as follows: + // + // * For project: + // `projects/{project_number}/locations/global/intelligenceConfig` + // * For organization: + // `organizations/{org_id}/locations/global/intelligenceConfig` + // * For folder: `folders/{folder_id}/locations/global/intelligenceConfig` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The edition configuration of the `IntelligenceConfig` resource. + EditionConfig edition_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time at which the `IntelligenceConfig` resource is last + // updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Filter over location and bucket. + Filter filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The `IntelligenceConfig` resource that is applicable for the + // resource. + EffectiveIntelligenceConfig effective_intelligence_config = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The trial configuration of the `IntelligenceConfig` resource. + TrialConfig trial_config = 7; +} + +// Request message to update the `IntelligenceConfig` resource associated with +// your organization. +// +// **IAM Permissions**: +// +// Requires `storage.intelligenceConfigs.update` +// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on +// the organization. +message UpdateOrganizationIntelligenceConfigRequest { + // Required. The `IntelligenceConfig` resource to be updated. + IntelligenceConfig intelligence_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The `update_mask` that specifies the fields within the + // `IntelligenceConfig` resource that should be modified by this update. Only + // the listed fields are updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID that uniquely identifies the request, preventing duplicate + // processing. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message to update the `IntelligenceConfig` resource associated with +// your folder. +// +// **IAM Permissions**: +// +// Requires `storage.intelligenceConfigs.update` +// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on +// the folder. +message UpdateFolderIntelligenceConfigRequest { + // Required. The `IntelligenceConfig` resource to be updated. + IntelligenceConfig intelligence_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The `update_mask` that specifies the fields within the + // `IntelligenceConfig` resource that should be modified by this update. Only + // the listed fields are updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID that uniquely identifies the request, preventing duplicate + // processing. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message to update the `IntelligenceConfig` resource associated with +// your project. +// +// **IAM Permissions**: +// +// Requires `storage.intelligenceConfigs.update` +// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on +// the folder. +message UpdateProjectIntelligenceConfigRequest { + // Required. The `IntelligenceConfig` resource to be updated. + IntelligenceConfig intelligence_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The `update_mask` that specifies the fields within the + // `IntelligenceConfig` resource that should be modified by this update. Only + // the listed fields are updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID that uniquely identifies the request, preventing duplicate + // processing. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message to get the `IntelligenceConfig` resource associated with your +// organization. +// +// **IAM Permissions** +// +// Requires `storage.intelligenceConfigs.get` +// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on +// the organization. +message GetOrganizationIntelligenceConfigRequest { + // Required. The name of the `IntelligenceConfig` resource associated with + // your organization. + // + // Format: `organizations/{org_id}/locations/global/intelligenceConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/IntelligenceConfig" + } + ]; +} + +// Request message to get the `IntelligenceConfig` resource associated with your +// folder. +// +// **IAM Permissions** +// +// Requires `storage.intelligenceConfigs.get` +// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on +// the folder. +message GetFolderIntelligenceConfigRequest { + // Required. The name of the `IntelligenceConfig` resource associated with + // your folder. + // + // Format: `folders/{id}/locations/global/intelligenceConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/IntelligenceConfig" + } + ]; +} + +// Request message to get the `IntelligenceConfig` resource associated with your +// project. +// +// **IAM Permissions**: +// +// Requires `storage.intelligenceConfigs.get` +// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission +// on the project. +message GetProjectIntelligenceConfigRequest { + // Required. The name of the `IntelligenceConfig` resource associated with + // your project. + // + // Format: `projects/{id}/locations/global/intelligenceConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/IntelligenceConfig" + } + ]; +} diff --git a/owl-bot-staging/google-storage-control/protos/google/storage/v2/storage.proto b/owl-bot-staging/google-storage-control/protos/google/storage/v2/storage.proto new file mode 100644 index 00000000000..f56e4f3e0a0 --- /dev/null +++ b/owl-bot-staging/google-storage-control/protos/google/storage/v2/storage.proto @@ -0,0 +1,3175 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.storage.v2; + +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option go_package = "cloud.google.com/go/storage/internal/apiv2/storagepb;storagepb"; +option java_multiple_files = true; +option java_outer_classname = "StorageProto"; +option java_package = "com.google.storage.v2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// ## API Overview and Naming Syntax +// +// The Cloud Storage gRPC API allows applications to read and write data through +// the abstractions of buckets and objects. For a description of these +// abstractions please see [Cloud Storage +// documentation](https://cloud.google.com/storage/docs). +// +// Resources are named as follows: +// +// - Projects are referred to as they are defined by the Resource Manager API, +// using strings like `projects/123456` or `projects/my-string-id`. +// - Buckets are named using string names of the form: +// `projects/{project}/buckets/{bucket}`. +// For globally unique buckets, `_` might be substituted for the project. +// - Objects are uniquely identified by their name along with the name of the +// bucket they belong to, as separate strings in this API. For example: +// +// ``` +// ReadObjectRequest { +// bucket: 'projects/_/buckets/my-bucket' +// object: 'my-object' +// } +// ``` +// +// Note that object names can contain `/` characters, which are treated as +// any other character (no special directory semantics). +service Storage { + option (google.api.default_host) = "storage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/devstorage.full_control," + "https://www.googleapis.com/auth/devstorage.read_only," + "https://www.googleapis.com/auth/devstorage.read_write"; + + // Permanently deletes an empty bucket. + // The request fails if there are any live or + // noncurrent objects in the bucket, but the request succeeds if the + // bucket only contains soft-deleted objects or incomplete uploads, such + // as ongoing XML API multipart uploads. Does not permanently delete + // soft-deleted objects. + // + // When this API is used to delete a bucket containing an object that has a + // soft delete policy + // enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the + // object. + // + // Objects and multipart uploads that were in the bucket at the time of + // deletion are also retained for the specified retention duration. When + // a soft-deleted bucket reaches the end of its retention duration, it + // is permanently deleted. The `hardDeleteTime` of the bucket always + // equals + // or exceeds the expiration time of the last soft-deleted object in the + // bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.delete` IAM permission on the bucket. + rpc DeleteBucket(DeleteBucketRequest) returns (google.protobuf.Empty) { + option (google.api.routing) = { + routing_parameters { field: "name" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "name"; + } + + // Returns metadata for the specified bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.get` + // IAM permission on + // the bucket. Additionally, to return specific bucket metadata, the + // authenticated user must have the following permissions: + // + // - To return the IAM policies: `storage.buckets.getIamPolicy` + // - To return the bucket IP filtering rules: `storage.buckets.getIpFilter` + rpc GetBucket(GetBucketRequest) returns (Bucket) { + option (google.api.routing) = { + routing_parameters { field: "name" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.create` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated user + // must have the following permissions: + // + // - To enable object retention using the `enableObjectRetention` query + // parameter: `storage.buckets.enableObjectRetention` + // - To set the bucket IP filtering rules: `storage.buckets.setIpFilter` + rpc CreateBucket(CreateBucketRequest) returns (Bucket) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{project=**}" } + routing_parameters { + field: "bucket.project" + path_template: "{project=**}" + } + }; + option (google.api.method_signature) = "parent,bucket,bucket_id"; + } + + // Retrieves a list of buckets for a given project, ordered + // lexicographically by name. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.list` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated + // user must have the following permissions: + // + // - To list the IAM policies: `storage.buckets.getIamPolicy` + // - To list the bucket IP filtering rules: `storage.buckets.getIpFilter` + rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{project=**}" } + }; + option (google.api.method_signature) = "parent"; + } + + // Permanently locks the retention + // policy that is + // currently applied to the specified bucket. + // + // Caution: Locking a bucket is an + // irreversible action. Once you lock a bucket: + // + // - You cannot remove the retention policy from the bucket. + // - You cannot decrease the retention period for the policy. + // + // Once locked, you must delete the entire bucket in order to remove the + // bucket's retention policy. However, before you can delete the bucket, you + // must delete all the objects in the bucket, which is only + // possible if all the objects have reached the retention period set by the + // retention policy. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.update` IAM permission on the bucket. + rpc LockBucketRetentionPolicy(LockBucketRetentionPolicyRequest) + returns (Bucket) { + option (google.api.routing) = { + routing_parameters { field: "bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "bucket"; + } + + // Gets the IAM policy for a specified bucket or managed folder. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.getIamPolicy` on the bucket or + // `storage.managedFolders.getIamPolicy` IAM permission on the + // managed folder. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.routing) = { + routing_parameters { field: "resource" path_template: "{bucket=**}" } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Updates an IAM policy for the specified bucket or managed folder. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.routing) = { + routing_parameters { field: "resource" path_template: "{bucket=**}" } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Tests a set of permissions on the given bucket, object, or managed folder + // to see which, if any, are held by the caller. The `resource` field in the + // request should be `projects/_/buckets/{bucket}` for a bucket, + // `projects/_/buckets/{bucket}/objects/{object}` for an object, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.routing) = { + routing_parameters { field: "resource" path_template: "{bucket=**}" } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/objects/**" + } + routing_parameters { + field: "resource" + path_template: "{bucket=projects/*/buckets/*}/managedFolders/**" + } + }; + option (google.api.method_signature) = "resource,permissions"; + } + + // Updates a bucket. Changes to the bucket are readable immediately after + // writing, but configuration changes might take time to propagate. This + // method supports `patch` semantics. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.update` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated user + // must have the following permissions: + // + // - To set bucket IP filtering rules: `storage.buckets.setIpFilter` + // - To update public access prevention policies or access control lists + // (ACLs): `storage.buckets.setIamPolicy` + rpc UpdateBucket(UpdateBucketRequest) returns (Bucket) { + option (google.api.routing) = { + routing_parameters { field: "bucket.name" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "bucket,update_mask"; + } + + // Concatenates a list of existing objects into a new object in the same + // bucket. The existing source objects are unaffected by this operation. + // + // **IAM Permissions**: + // + // Requires the `storage.objects.create` and `storage.objects.get` IAM + // permissions to use this method. If the new composite object + // overwrites an existing object, the authenticated user must also have + // the `storage.objects.delete` permission. If the request body includes + // the retention property, the authenticated user must also have the + // `storage.objects.setRetention` IAM permission. + rpc ComposeObject(ComposeObjectRequest) returns (Object) { + option (google.api.routing) = { + routing_parameters { + field: "destination.bucket" + path_template: "{bucket=**}" + } + }; + } + + // Deletes an object and its metadata. Deletions are permanent if versioning + // is not enabled for the bucket, or if the generation parameter is used, or + // if soft delete is not + // enabled for the bucket. + // When this API is used to delete an object from a bucket that has soft + // delete policy enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the object. + // This API cannot be used to permanently delete soft-deleted objects. + // Soft-deleted objects are permanently deleted according to their + // `hardDeleteTime`. + // + // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] + // API to restore soft-deleted objects until the soft delete retention period + // has passed. + // + // **IAM Permissions**: + // + // Requires `storage.objects.delete` IAM permission on the bucket. + rpc DeleteObject(DeleteObjectRequest) returns (google.protobuf.Empty) { + option (google.api.routing) = { + routing_parameters { field: "bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "bucket,object"; + option (google.api.method_signature) = "bucket,object,generation"; + } + + // Restores a + // soft-deleted object. + // When a soft-deleted object is restored, a new copy of that object is + // created in the same bucket and inherits the same metadata as the + // soft-deleted object. The inherited metadata is the metadata that existed + // when the original object became soft deleted, with the following + // exceptions: + // + // - The `createTime` of the new object is set to the time at which the + // soft-deleted object was restored. + // - The `softDeleteTime` and `hardDeleteTime` values are cleared. + // - A new generation is assigned and the metageneration is reset to 1. + // - If the soft-deleted object was in a bucket that had Autoclass enabled, + // the new object is + // restored to Standard storage. + // - The restored object inherits the bucket's default object ACL, unless + // `copySourceAcl` is `true`. + // + // If a live object using the same name already exists in the bucket and + // becomes overwritten, the live object becomes a noncurrent object if Object + // Versioning is enabled on the bucket. If Object Versioning is not enabled, + // the live object becomes soft deleted. + // + // **IAM Permissions**: + // + // Requires the following IAM permissions to use this method: + // + // - `storage.objects.restore` + // - `storage.objects.create` + // - `storage.objects.delete` (only required if overwriting an existing + // object) + // - `storage.objects.getIamPolicy` (only required if `projection` is `full` + // and the relevant bucket + // has uniform bucket-level access disabled) + // - `storage.objects.setIamPolicy` (only required if `copySourceAcl` is + // `true` and the relevant + // bucket has uniform bucket-level access disabled) + rpc RestoreObject(RestoreObjectRequest) returns (Object) { + option (google.api.routing) = { + routing_parameters { field: "bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "bucket,object,generation"; + } + + // Cancels an in-progress resumable upload. + // + // Any attempts to write to the resumable upload after cancelling the upload + // fail. + // + // The behavior for any in-progress write operations is not guaranteed; + // they could either complete before the cancellation or fail if the + // cancellation completes first. + rpc CancelResumableWrite(CancelResumableWriteRequest) + returns (CancelResumableWriteResponse) { + option (google.api.routing) = { + routing_parameters { + field: "upload_id" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "upload_id"; + } + + // Retrieves object metadata. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + // To return object ACLs, the authenticated user must also have + // the `storage.objects.getIamPolicy` permission. + rpc GetObject(GetObjectRequest) returns (Object) { + option (google.api.routing) = { + routing_parameters { field: "bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "bucket,object"; + option (google.api.method_signature) = "bucket,object,generation"; + } + + // Retrieves object data. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + rpc ReadObject(ReadObjectRequest) returns (stream ReadObjectResponse) { + option (google.api.routing) = { + routing_parameters { field: "bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "bucket,object"; + option (google.api.method_signature) = "bucket,object,generation"; + } + + // Reads an object's data. + // + // This bi-directional API reads data from an object, allowing you to request + // multiple data ranges within a single stream, even across several messages. + // If an error occurs with any request, the stream closes with a relevant + // error code. Since you can have multiple outstanding requests, the error + // response includes a `BidiReadObjectError` proto in its `details` field, + // reporting the specific error, if any, for each pending `read_id`. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + // + rpc BidiReadObject(stream BidiReadObjectRequest) + returns (stream BidiReadObjectResponse) { + option (google.api.routing) = { + routing_parameters { + field: "read_object_spec.bucket" + path_template: "{bucket=**}" + } + }; + } + + // Updates an object's metadata. + // Equivalent to JSON API's `storage.objects.patch` method. + // + // **IAM Permissions**: + // + // Requires `storage.objects.update` IAM permission on the bucket. + rpc UpdateObject(UpdateObjectRequest) returns (Object) { + option (google.api.routing) = { + routing_parameters { field: "object.bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "object,update_mask"; + } + + // Stores a new object and metadata. + // + // An object can be written either in a single message stream or in a + // resumable sequence of message streams. To write using a single stream, + // the client should include in the first message of the stream an + // `WriteObjectSpec` describing the destination bucket, object, and any + // preconditions. Additionally, the final message must set 'finish_write' to + // true, or else it is an error. + // + // For a resumable write, the client should instead call + // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. + // They should then attach the returned `upload_id` to the first message of + // each following call to `WriteObject`. If the stream is closed before + // finishing the upload (either explicitly by the client or due to a network + // error or an error response from the server), the client should do as + // follows: + // + // - Check the result Status of the stream, to determine if writing can be + // resumed on this stream or must be restarted from scratch (by calling + // `StartResumableWrite()`). The resumable errors are `DEADLINE_EXCEEDED`, + // `INTERNAL`, and `UNAVAILABLE`. For each case, the client should use + // binary exponential backoff before retrying. Additionally, writes can + // be resumed after `RESOURCE_EXHAUSTED` errors, but only after taking + // appropriate measures, which might include reducing aggregate send rate + // across clients and/or requesting a quota increase for your project. + // - If the call to `WriteObject` returns `ABORTED`, that indicates + // concurrent attempts to update the resumable write, caused either by + // multiple racing clients or by a single client where the previous + // request was timed out on the client side but nonetheless reached the + // server. In this case the client should take steps to prevent further + // concurrent writes. For example, increase the timeouts and stop using + // more than one process to perform the upload. Follow the steps below for + // resuming the upload. + // - For resumable errors, the client should call `QueryWriteStatus()` and + // then continue writing from the returned `persisted_size`. This might be + // less than the amount of data the client previously sent. Note also that + // it is acceptable to send data starting at an offset earlier than the + // returned `persisted_size`; in this case, the service skips data at + // offsets that were already persisted (without checking that it matches + // the previously written data), and write only the data starting from the + // persisted offset. Even though the data isn't written, it might still + // incur a performance cost over resuming at the correct write offset. + // This behavior can make client-side handling simpler in some cases. + // - Clients must only send data that is a multiple of 256 KiB per message, + // unless the object is being finished with `finish_write` set to `true`. + // + // The service does not view the object as complete until the client has + // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any + // requests on a stream after sending a request with `finish_write` set to + // `true` causes an error. The client must check the response it + // receives to determine how much data the service is able to commit and + // whether the service views the object as complete. + // + // Attempting to resume an already finalized object results in an `OK` + // status, with a `WriteObjectResponse` containing the finalized object's + // metadata. + // + // Alternatively, you can use the `BidiWriteObject` operation to write an + // object with controls over flushing and the ability to fetch the ability to + // determine the current persisted size. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` + // IAM permission on + // the bucket. + rpc WriteObject(stream WriteObjectRequest) returns (WriteObjectResponse) {} + + // Stores a new object and metadata. + // + // This is similar to the `WriteObject` call with the added support for + // manual flushing of persisted state, and the ability to determine current + // persisted size without closing the stream. + // + // The client might specify one or both of the `state_lookup` and `flush` + // fields in each `BidiWriteObjectRequest`. If `flush` is specified, the data + // written so far is persisted to storage. If `state_lookup` is specified, the + // service responds with a `BidiWriteObjectResponse` that contains the + // persisted size. If both `flush` and `state_lookup` are specified, the flush + // always occurs before a `state_lookup`, so that both might be set in the + // same request and the returned state is the state of the object + // post-flush. When the stream is closed, a `BidiWriteObjectResponse` + // is always sent to the client, regardless of the value of `state_lookup`. + rpc BidiWriteObject(stream BidiWriteObjectRequest) + returns (stream BidiWriteObjectResponse) {} + + // Retrieves a list of objects matching the criteria. + // + // **IAM Permissions**: + // + // The authenticated user requires `storage.objects.list` + // IAM permission to use this method. To return object ACLs, the + // authenticated user must also + // have the `storage.objects.getIamPolicy` permission. + rpc ListObjects(ListObjectsRequest) returns (ListObjectsResponse) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent"; + } + + // Rewrites a source object to a destination object. Optionally overrides + // metadata. + rpc RewriteObject(RewriteObjectRequest) returns (RewriteResponse) { + option (google.api.routing) = { + routing_parameters { field: "source_bucket" } + routing_parameters { + field: "destination_bucket" + path_template: "{bucket=**}" + } + }; + } + + // Starts a resumable write operation. This + // method is part of the Resumable + // upload feature. + // This allows you to upload large objects in multiple chunks, which is more + // resilient to network interruptions than a single upload. The validity + // duration of the write operation, and the consequences of it becoming + // invalid, are service-dependent. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` IAM permission on the bucket. + rpc StartResumableWrite(StartResumableWriteRequest) + returns (StartResumableWriteResponse) { + option (google.api.routing) = { + routing_parameters { + field: "write_object_spec.resource.bucket" + path_template: "{bucket=**}" + } + }; + } + + // Determines the `persisted_size` of an object that is being written. This + // method is part of the resumable + // upload feature. + // The returned value is the size of the object that has been persisted so + // far. The value can be used as the `write_offset` for the next `Write()` + // call. + // + // If the object does not exist, meaning if it was deleted, or the + // first `Write()` has not yet reached the service, this method returns the + // error `NOT_FOUND`. + // + // This method is useful for clients that buffer data and need to know which + // data can be safely evicted. The client can call `QueryWriteStatus()` at any + // time to determine how much data has been logged for this object. + // For any sequence of `QueryWriteStatus()` calls for a given + // object name, the sequence of returned `persisted_size` values are + // non-decreasing. + rpc QueryWriteStatus(QueryWriteStatusRequest) + returns (QueryWriteStatusResponse) { + option (google.api.routing) = { + routing_parameters { + field: "upload_id" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "upload_id"; + } + + // Moves the source object to the destination object in the same bucket. + // This operation moves a source object to a destination object in the + // same bucket by renaming the object. The move itself is an atomic + // transaction, ensuring all steps either complete successfully or no + // changes are made. + // + // **IAM Permissions**: + // + // Requires the following IAM permissions to use this method: + // + // - `storage.objects.move` + // - `storage.objects.create` + // - `storage.objects.delete` (only required if overwriting an existing + // object) + rpc MoveObject(MoveObjectRequest) returns (Object) { + option (google.api.routing) = { + routing_parameters { field: "bucket" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = + "bucket,source_object,destination_object"; + } +} + +// Request message for [DeleteBucket][google.storage.v2.Storage.DeleteBucket]. +message DeleteBucketRequest { + // Required. Name of a bucket to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // If set, only deletes the bucket if its metageneration matches this value. + optional int64 if_metageneration_match = 2; + + // If set, only deletes the bucket if its metageneration does not match this + // value. + optional int64 if_metageneration_not_match = 3; +} + +// Request message for [GetBucket][google.storage.v2.Storage.GetBucket]. +message GetBucketRequest { + // Required. Name of a bucket. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // If set, only gets the bucket metadata if its metageneration matches this + // value. + optional int64 if_metageneration_match = 2; + + // If set, and if the bucket's current metageneration matches the specified + // value, the request returns an error. + optional int64 if_metageneration_not_match = 3; + + // Mask specifying which fields to read. + // A `*` field might be used to indicate all fields. + // If no mask is specified, it defaults to all fields. + optional google.protobuf.FieldMask read_mask = 5; +} + +// Request message for [CreateBucket][google.storage.v2.Storage.CreateBucket]. +message CreateBucketRequest { + // Required. The project to which this bucket belongs. This field must either + // be empty or `projects/_`. The project ID that owns this bucket should be + // specified in the `bucket.project` field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/Bucket" + } + ]; + + // Optional. Properties of the new bucket being inserted. + // The name of the bucket is specified in the `bucket_id` field. Populating + // `bucket.name` field results in an error. + // The project of the bucket must be specified in the `bucket.project` field. + // This field must be in `projects/{projectIdentifier}` format, + // {projectIdentifier} can be the project ID or project number. The `parent` + // field must be either empty or `projects/_`. + Bucket bucket = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ID to use for this bucket, which becomes the final component + // of the bucket's resource name. For example, the value `foo` might result in + // a bucket with the name `projects/123456/buckets/foo`. + string bucket_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Apply a predefined set of access controls to this bucket. + // Valid values are `authenticatedRead`, `private`, `projectPrivate`, + // `publicRead`, or `publicReadWrite`. + string predefined_acl = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Apply a predefined set of default object access controls to this + // bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + string predefined_default_object_acl = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, enable object retention on the bucket. + bool enable_object_retention = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [ListBuckets][google.storage.v2.Storage.ListBuckets]. +message ListBucketsRequest { + // Required. The project whose buckets we are listing. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/Bucket" + } + ]; + + // Optional. Maximum number of buckets to return in a single response. The + // service uses this parameter or `1,000` items, whichever is smaller. If + // `acl` is present in the `read_mask`, the service uses this parameter of + // `200` items, whichever is smaller. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A previously-returned page token representing part of the larger + // set of results to view. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to buckets whose names begin with this prefix. + string prefix = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Mask specifying which fields to read from each result. + // If no mask is specified, it defaults to all fields except `items. + // owner`, `items.acl`, and `items.default_object_acl`. + // `*` might be used to mean "all fields". + optional google.protobuf.FieldMask read_mask = 5; + + // Optional. Allows listing of buckets, even if there are buckets that are + // unreachable. + bool return_partial_success = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [ListBuckets][google.storage.v2.Storage.ListBuckets]. +message ListBucketsResponse { + // The list of items. + repeated Bucket buckets = 1; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 2; + + // Unreachable resources. + // This field can only be present if the caller specified + // return_partial_success to be true in the request to receive indications + // of temporarily missing resources. + // unreachable might be: + // unreachable = [ + // "projects/_/buckets/bucket1", + // "projects/_/buckets/bucket2", + // "projects/_/buckets/bucket3", + // ] + repeated string unreachable = 3; +} + +// Request message for +// [LockBucketRetentionPolicy][google.storage.v2.Storage.LockBucketRetentionPolicy]. +message LockBucketRetentionPolicyRequest { + // Required. Name of a bucket. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. Makes the operation conditional on whether bucket's current + // metageneration matches the given value. Must be positive. + int64 if_metageneration_match = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [UpdateBucket][google.storage.v2.Storage.UpdateBucket] method. +message UpdateBucketRequest { + // Required. The bucket to update. + // The bucket's `name` field is used to identify the bucket. + Bucket bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, the request modifies the bucket if its metageneration matches this + // value. + optional int64 if_metageneration_match = 2; + + // If set, the request modifies the bucket if its metageneration doesn't + // match this value. + optional int64 if_metageneration_not_match = 3; + + // Optional. Apply a predefined set of access controls to this bucket. + // Valid values are `authenticatedRead`, `private`, `projectPrivate`, + // `publicRead`, or `publicReadWrite`. + string predefined_acl = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Apply a predefined set of default object access controls to this + // bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + string predefined_default_object_acl = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. List of fields to be updated. + // + // To specify ALL fields, equivalent to the JSON API's "update" function, + // specify a single field with the value `*`. Note: not recommended. If a new + // field is introduced at a later time, an older client updating with the `*` + // might accidentally reset the new field's value. + // + // Not specifying any fields is an error. + google.protobuf.FieldMask update_mask = 6 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [ComposeObject][google.storage.v2.Storage.ComposeObject]. +message ComposeObjectRequest { + // Description of a source object for a composition request. + message SourceObject { + // Preconditions for a source object of a composition request. + message ObjectPreconditions { + // Only perform the composition if the generation of the source object + // that would be used matches this value. If this value and a generation + // are both specified, they must be the same value or the call fails. + optional int64 if_generation_match = 1; + } + + // Required. The source object's name. All source objects must reside in the + // same bucket. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The generation of this object to use as the source. + int64 generation = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Conditions that must be met for this operation to execute. + ObjectPreconditions object_preconditions = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Properties of the resulting object. + Object destination = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of source objects that is concatenated into a single + // object. + repeated SourceObject source_objects = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Apply a predefined set of access controls to the destination + // object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + string destination_predefined_acl = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 4; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 5; + + // Optional. Resource name of the Cloud KMS key, of the form + // `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`, + // that is used to encrypt the object. Overrides the object + // metadata's `kms_key_name` value, if any. + string kms_key = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The checksums of the complete object. This is validated against + // the combined checksums of the component objects. + ObjectChecksums object_checksums = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Whether the source objects should be deleted in the compose request. + optional bool delete_source_objects = 11; +} + +// Request message for deleting an object. +message DeleteObjectRequest { + // Required. Name of the bucket in which the object resides. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the finalized object to delete. + // Note: If you want to delete an unfinalized resumable upload please use + // `CancelResumableWrite`. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If present, permanently deletes a specific revision of this + // object (as opposed to the latest version, the default). + int64 generation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 5; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 6; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 7; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 8; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [RestoreObject][google.storage.v2.Storage.RestoreObject]. +// `bucket`, `object`, and `generation` **must** be set. +message RestoreObjectRequest { + // Required. Name of the bucket in which the object resides. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the object to restore. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The specific revision of the object to restore. + int64 generation = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Restore token used to differentiate soft-deleted objects with the + // same name and generation. Only applicable for hierarchical namespace + // buckets. This parameter is optional, and is only required in the rare case + // when there are multiple soft-deleted objects with the same name and + // generation. + string restore_token = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 4; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 5; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 6; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 7; + + // If false or unset, the bucket's default object ACL is used. + // If true, copy the source object's access controls. + // Return an error if bucket has UBLA enabled. + optional bool copy_source_acl = 9; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [CancelResumableWrite][google.storage.v2.Storage.CancelResumableWrite]. +message CancelResumableWriteRequest { + // Required. The upload_id of the resumable upload to cancel. This should be + // copied from the `upload_id` field of `StartResumableWriteResponse`. + string upload_id = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Empty response message for canceling an in-progress resumable upload, is +// extended as needed. +message CancelResumableWriteResponse {} + +// Request message for [ReadObject][google.storage.v2.Storage.ReadObject]. +message ReadObjectRequest { + // Required. The name of the bucket containing the object to read. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the object to read. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If present, selects a specific revision of this object (as + // opposed to the latest version, the default). + int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The offset for the first byte to return in the read, relative to + // the start of the object. + // + // A negative `read_offset` value is interpreted as the number of bytes + // back from the end of the object to be returned. For example, if an object's + // length is `15` bytes, a `ReadObjectRequest` with `read_offset` = `-5` and + // `read_limit` = `3` would return bytes `10` through `12` of the object. + // Requesting a negative offset with magnitude larger than the size of the + // object returns the entire object. + int64 read_offset = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of `data` bytes the server is allowed to + // return in the sum of all `Object` messages. A `read_limit` of zero + // indicates that there is no limit, and a negative `read_limit` causes an + // error. + // + // If the stream returns fewer bytes than allowed by the `read_limit` and no + // error occurred, the stream includes all data from the `read_offset` to the + // end of the resource. + int64 read_limit = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 6; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 7; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 8; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 9; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Mask specifying which fields to read. + // The `checksummed_data` field and its children are always present. + // If no mask is specified, it defaults to all fields except `metadata. + // owner` and `metadata.acl`. + // `*` might be used to mean "all fields". + optional google.protobuf.FieldMask read_mask = 12; +} + +// Request message for [GetObject][google.storage.v2.Storage.GetObject]. +message GetObjectRequest { + // Required. Name of the bucket in which the object resides. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. Name of the object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If present, selects a specific revision of this object (as + // opposed to the latest version, the default). + int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; + + // If true, return the soft-deleted version of this object. + optional bool soft_deleted = 11; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 4; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 5; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 6; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 7; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Mask specifying which fields to read. + // If no mask is specified, it defaults to all fields except `metadata. + // acl` and `metadata.owner`. + // `*` might be used to mean "all fields". + optional google.protobuf.FieldMask read_mask = 10; + + // Optional. Restore token used to differentiate soft-deleted objects with the + // same name and generation. Only applicable for hierarchical namespace + // buckets and if `soft_deleted` is set to `true`. This parameter is optional, + // and is only required in the rare case when there are multiple soft-deleted + // objects with the same `name` and `generation`. + string restore_token = 12 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [ReadObject][google.storage.v2.Storage.ReadObject]. +message ReadObjectResponse { + // A portion of the data for the object. The service might leave `data` + // empty for any given `ReadResponse`. This enables the service to inform the + // client that the request is still live while it is running an operation to + // generate more data. + ChecksummedData checksummed_data = 1; + + // The checksums of the complete object. If the object is downloaded in full, + // the client should compute one of these checksums over the downloaded object + // and compare it against the value provided here. + ObjectChecksums object_checksums = 2; + + // If `read_offset` and or `read_limit` is specified on the + // `ReadObjectRequest`, `ContentRange` is populated on the first + // `ReadObjectResponse` message of the read stream. + ContentRange content_range = 3; + + // Metadata of the object whose media is being returned. + // Only populated in the first response in the stream. + Object metadata = 4; +} + +// Describes the object to read in a BidiReadObject request. +message BidiReadObjectSpec { + // Required. The name of the bucket containing the object to read. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the object to read. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If present, selects a specific revision of this object (as + // opposed to the latest version, the default). + int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 4; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 5; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 6; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 7; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Mask specifying which fields to read. + // The `checksummed_data` field and its children are always present. + // If no mask is specified, it defaults to all fields except `metadata. + // owner` and `metadata.acl`. + // `*` might be used to mean "all fields". + // As per https://google.aip.dev/161, this field is deprecated. + // As an alternative, `grpc metadata` can be used: + optional google.protobuf.FieldMask read_mask = 12 [deprecated = true]; + + // The client can optionally set this field. The read handle is an optimized + // way of creating new streams. Read handles are generated and periodically + // refreshed from prior reads. + optional BidiReadHandle read_handle = 13; + + // The routing token that influences request routing for the stream. Must be + // provided if a BidiReadObjectRedirectedError is returned. + optional string routing_token = 14; +} + +// Request message for +// [BidiReadObject][google.storage.v2.Storage.BidiReadObject]. +message BidiReadObjectRequest { + // Optional. The first message of each stream should set this field. If this + // is not the first message, an error is returned. Describes the object to + // read. + BidiReadObjectSpec read_object_spec = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Provides a list of 0 or more (up to 100) ranges to read. If a + // single range is large enough to require multiple responses, they are + // delivered in increasing offset order. There are no ordering guarantees + // across ranges. When no ranges are provided, the response message + // doesn't include `ObjectRangeData`. For full object downloads, the + // offset and size can be set to `0`. + repeated ReadRange read_ranges = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [BidiReadObject][google.storage.v2.Storage.BidiReadObject]. +message BidiReadObjectResponse { + // A portion of the object's data. The service might leave data + // empty for any given `ReadResponse`. This enables the service to inform the + // client that the request is still live while it is running an operation to + // generate more data. + // The service might pipeline multiple responses belonging to different read + // requests. Each `ObjectRangeData` entry has a `read_id` that is set + // to the same value as the corresponding source read request. + repeated ObjectRangeData object_data_ranges = 6; + + // Metadata of the object whose media is being returned. + // Only populated in the first response in the stream and not populated when + // the stream is opened with a read handle. + Object metadata = 4; + + // This field is periodically refreshed, however it might not be set in + // every response. It allows the client to more efficiently open subsequent + // bidirectional streams to the same object. + BidiReadHandle read_handle = 7; +} + +// Error proto containing details for a redirected read. This error might be +// attached as details for an ABORTED response to BidiReadObject. +message BidiReadObjectRedirectedError { + // The read handle for the redirected read. If set, the client might use this + // in the BidiReadObjectSpec when retrying the read stream. + BidiReadHandle read_handle = 1; + + // The routing token the client must use when retrying the read stream. + // This value must be provided in the header `x-goog-request-params`, with key + // `routing_token` and this string verbatim as the value. + optional string routing_token = 2; +} + +// Error proto containing details for a redirected write. This error might be +// attached as details for an ABORTED response to BidiWriteObject. +message BidiWriteObjectRedirectedError { + // The routing token the client must use when retrying the write stream. + // This value must be provided in the header `x-goog-request-params`, with key + // `routing_token` and this string verbatim as the value. + optional string routing_token = 1; + + // Opaque value describing a previous write. If set, the client must use this + // in an AppendObjectSpec first_message when retrying the write stream. If not + // set, clients might retry the original request. + optional BidiWriteHandle write_handle = 2; + + // The generation of the object that triggered the redirect. This is set + // iff `write_handle` is set. If set, the client must use this in an + // `AppendObjectSpec` first_message when retrying the write stream. + optional int64 generation = 3; +} + +// Error extension proto containing details for all outstanding reads on the +// failed stream +message BidiReadObjectError { + // The error code for each outstanding read_range + repeated ReadRangeError read_range_errors = 1; +} + +// Error extension proto containing details for a single range read +message ReadRangeError { + // The id of the corresponding read_range + int64 read_id = 1; + + // The status which should be an enum value of [google.rpc.Code]. + google.rpc.Status status = 2; +} + +// Describes a range of bytes to read in a `BidiReadObjectRanges` request. +message ReadRange { + // Required. The offset for the first byte to return in the read, relative to + // the start of the object. + // + // A negative read_offset value is interpreted as the number of bytes + // back from the end of the object to be returned. For example, if an object's + // length is 15 bytes, a `ReadObjectRequest` with `read_offset` = -5 and + // `read_length` = 3 would return bytes 10 through 12 of the object. + // Requesting a negative offset with magnitude larger than the size of the + // object is equivalent to `read_offset` = 0. A `read_offset` larger than the + // size of the object results in an `OutOfRange` error. + int64 read_offset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of data bytes the server is allowed to return + // across all response messages with the same `read_id`. A `read_length` of + // zero indicates to read until the resource end, and a negative `read_length` + // causes an `OutOfRange` error. If the stream returns fewer bytes than + // allowed by the `read_length` and no error occurred, the stream includes all + // data from the `read_offset` to the resource end. + int64 read_length = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Read identifier provided by the client. When the client issues + // more than one outstanding `ReadRange` on the same stream, responses can be + // mapped back to their corresponding requests using this value. Clients must + // ensure that all outstanding requests have different read_id values. The + // server might close the stream with an error if this condition is not met. + int64 read_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Contains data and metadata for a range of an object. +message ObjectRangeData { + // A portion of the data for the object. + ChecksummedData checksummed_data = 1; + + // The `ReadRange` describes the content being returned with `read_id` set to + // the corresponding `ReadObjectRequest` in the stream. Multiple + // `ObjectRangeData` messages might have the same read_id but increasing + // offsets. `ReadObjectResponse` messages with the same `read_id` are + // guaranteed to be delivered in increasing offset order. + ReadRange read_range = 2; + + // If set, indicates there are no more bytes to read for the given ReadRange. + bool range_end = 3; +} + +// `BidiReadHandle` contains a handle from a previous `BiDiReadObject` +// invocation. The client can use this instead of `BidiReadObjectSpec` as an +// optimized way of opening subsequent bidirectional streams to the same object. +message BidiReadHandle { + // Required. Opaque value describing a previous read. + bytes handle = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// `BidiWriteHandle` contains a handle from a previous `BidiWriteObject` +// invocation. The client can use this instead of `BidiReadObjectSpec` as an +// optimized way of opening subsequent bidirectional streams to the same object. +message BidiWriteHandle { + // Required. Opaque value describing a previous write. + bytes handle = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes an attempt to insert an object, possibly over multiple requests. +message WriteObjectSpec { + // Required. Destination object, including its name and its metadata. + Object resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Apply a predefined set of access controls to this object. + // Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + string predefined_acl = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current + // generation matches the given value. Setting to `0` makes the operation + // succeed only if there are no live versions of the object. + optional int64 if_generation_match = 3; + + // Makes the operation conditional on whether the object's live + // generation does not match the given value. If no live object exists, the + // precondition fails. Setting to `0` makes the operation succeed only if + // there is a live version of the object. + optional int64 if_generation_not_match = 4; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 5; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 6; + + // The expected final object size being uploaded. + // If this value is set, closing the stream after writing fewer or more than + // `object_size` bytes results in an `OUT_OF_RANGE` error. + // + // This situation is considered a client error, and if such an error occurs + // you must start the upload over from scratch, this time sending the correct + // number of bytes. + optional int64 object_size = 8; + + // If `true`, the object is created in appendable mode. + // This field might only be set when using `BidiWriteObject`. + optional bool appendable = 9; +} + +// Request message for [WriteObject][google.storage.v2.Storage.WriteObject]. +message WriteObjectRequest { + // The first message of each stream should set one of the following. + oneof first_message { + // For resumable uploads. This should be the `upload_id` returned from a + // call to `StartResumableWriteResponse`. + string upload_id = 1; + + // For non-resumable uploads. Describes the overall upload, including the + // destination bucket and object name, preconditions, etc. + WriteObjectSpec write_object_spec = 2; + } + + // Required. The offset from the beginning of the object at which the data + // should be written. + // + // In the first `WriteObjectRequest` of a `WriteObject()` action, it + // indicates the initial offset for the `Write()` call. The value **must** be + // equal to the `persisted_size` that a call to `QueryWriteStatus()` would + // return (0 if this is the first write to the object). + // + // On subsequent calls, this value **must** be no larger than the sum of the + // first `write_offset` and the sizes of all `data` chunks sent previously on + // this stream. + // + // An incorrect value causes an error. + int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED]; + + // A portion of the data for the object. + oneof data { + // The data to insert. If a crc32c checksum is provided that doesn't match + // the checksum computed by the service, the request fails. + ChecksummedData checksummed_data = 4; + } + + // Optional. Checksums for the complete object. If the checksums computed by + // the service don't match the specified checksums the call fails. This field + // might only be provided in the first or last request (either with + // `first_message`, or `finish_write` set). + ObjectChecksums object_checksums = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If `true`, this indicates that the write is complete. Sending any + // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` + // causes an error. + // For a non-resumable write (where the `upload_id` was not set in the first + // message), it is an error not to set this field in the final message of the + // stream. + bool finish_write = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of parameters common to Cloud Storage API requests + // concerning an object. + CommonObjectRequestParams common_object_request_params = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [WriteObject][google.storage.v2.Storage.WriteObject]. +message WriteObjectResponse { + // The response sets one of the following. + oneof write_status { + // The total number of bytes that have been processed for the given object + // from all `WriteObject` calls. Only set if the upload has not finalized. + int64 persisted_size = 1; + + // A resource containing the metadata for the uploaded object. Only set if + // the upload has finalized. + Object resource = 2; + } + + // If persisted_size is set, contains checksums of persisted data. + ObjectChecksums persisted_data_checksums = 3; +} + +// Describes an attempt to append to an object, possibly over multiple requests. +message AppendObjectSpec { + // Required. The name of the bucket containing the object to write. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. The name of the object to open for writing. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The generation number of the object to open for writing. + int64 generation = 3 [(google.api.field_behavior) = REQUIRED]; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + // + // Note that metageneration preconditions are only checked if `write_handle` + // is empty. + optional int64 if_metageneration_match = 4; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + // + // Note that metageneration preconditions are only checked if `write_handle` + // is empty. + optional int64 if_metageneration_not_match = 5; + + // An optional routing token that influences request routing for the stream. + // Must be provided if a `BidiWriteObjectRedirectedError` is returned. + optional string routing_token = 6; + + // An optional write handle returned from a previous BidiWriteObjectResponse + // message or a BidiWriteObjectRedirectedError error. + // + // Note that metageneration preconditions are only checked if `write_handle` + // is empty. + optional BidiWriteHandle write_handle = 7; +} + +// Request message for +// [BidiWriteObject][google.storage.v2.Storage.BidiWriteObject]. +message BidiWriteObjectRequest { + // The first message of each stream should set one of the following. + oneof first_message { + // For resumable uploads. This should be the `upload_id` returned from a + // call to `StartResumableWriteResponse`. + string upload_id = 1; + + // For non-resumable uploads. Describes the overall upload, including the + // destination bucket and object name, preconditions, etc. + WriteObjectSpec write_object_spec = 2; + + // For appendable uploads. Describes the object to append to. + AppendObjectSpec append_object_spec = 11; + } + + // Required. The offset from the beginning of the object at which the data + // should be written. + // + // In the first `WriteObjectRequest` of a `WriteObject()` action, it + // indicates the initial offset for the `Write()` call. The value must be + // equal to the `persisted_size` that a call to `QueryWriteStatus()` would + // return (0 if this is the first write to the object). + // + // On subsequent calls, this value must be no larger than the sum of the + // first `write_offset` and the sizes of all `data` chunks sent previously on + // this stream. + // + // An invalid value causes an error. + int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED]; + + // A portion of the data for the object. + oneof data { + // The data to insert. If a crc32c checksum is provided that doesn't match + // the checksum computed by the service, the request fails. + ChecksummedData checksummed_data = 4; + } + + // Optional. Checksums for the complete object. If the checksums computed by + // the service don't match the specified checksums the call fails. May be + // provided in the last request (with finish_write set). For non-appendable + // objects only, may also be provided in the first request. + ObjectChecksums object_checksums = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For each `BidiWriteObjectRequest` where `state_lookup` is `true` + // or the client closes the stream, the service sends a + // `BidiWriteObjectResponse` containing the current persisted size. The + // persisted size sent in responses covers all the bytes the server has + // persisted thus far and can be used to decide what data is safe for the + // client to drop. Note that the object's current size reported by the + // `BidiWriteObjectResponse` might lag behind the number of bytes written by + // the client. This field is ignored if `finish_write` is set to true. + bool state_lookup = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Persists data written on the stream, up to and including the + // current message, to permanent storage. This option should be used sparingly + // as it might reduce performance. Ongoing writes are periodically persisted + // on the server even when `flush` is not set. This field is ignored if + // `finish_write` is set to true since there's no need to checkpoint or flush + // if this message completes the write. + bool flush = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If `true`, this indicates that the write is complete. Sending any + // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` + // causes an error. + // For a non-resumable write (where the `upload_id` was not set in the first + // message), it is an error not to set this field in the final message of the + // stream. + bool finish_write = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BidiWriteObject. +message BidiWriteObjectResponse { + // The response sets one of the following. + oneof write_status { + // The total number of bytes that have been processed for the given object + // from all `WriteObject` calls. Only set if the upload has not finalized. + int64 persisted_size = 1; + + // A resource containing the metadata for the uploaded object. Only set if + // the upload has finalized. + Object resource = 2; + } + + // If persisted_size is set, contains checksums of persisted data. + ObjectChecksums persisted_data_checksums = 4; + + // An optional write handle that is returned periodically in response + // messages. Clients should save it for later use in establishing a new stream + // if a connection is interrupted. + optional BidiWriteHandle write_handle = 3; +} + +// Request message for [ListObjects][google.storage.v2.Storage.ListObjects]. +message ListObjectsRequest { + // Required. Name of the bucket in which to look for objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Optional. Maximum number of `items` plus `prefixes` to return + // in a single page of responses. As duplicate `prefixes` are + // omitted, fewer total results might be returned than requested. The service + // uses this parameter or 1,000 items, whichever is smaller. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A previously-returned page token representing part of the larger + // set of results to view. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, returns results in a directory-like mode. `items` + // contains only objects whose names, aside from the `prefix`, do not contain + // `delimiter`. Objects whose names, aside from the `prefix`, contain + // `delimiter` has their name, truncated after the `delimiter`, returned in + // `prefixes`. Duplicate `prefixes` are omitted. + string delimiter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, objects that end in exactly one instance of `delimiter` + // has their metadata included in `items` in addition to + // `prefixes`. + bool include_trailing_delimiter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to objects whose names begin with this prefix. + string prefix = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If `true`, lists all versions of an object as distinct results. + bool versions = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Mask specifying which fields to read from each result. + // If no mask is specified, defaults to all fields except `items.acl` and + // `items.owner`. + // `*` might be used to mean all fields. + optional google.protobuf.FieldMask read_mask = 8; + + // Optional. Filter results to objects whose names are lexicographically equal + // to or after `lexicographic_start`. If `lexicographic_end` is also set, the + // objects listed have names between `lexicographic_start` (inclusive) and + // `lexicographic_end` (exclusive). + string lexicographic_start = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to objects whose names are lexicographically + // before `lexicographic_end`. If `lexicographic_start` is also set, the + // objects listed have names between `lexicographic_start` (inclusive) and + // `lexicographic_end` (exclusive). + string lexicographic_end = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, only list all soft-deleted versions of the object. + // Soft delete policy is required to set this option. + bool soft_deleted = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, includes folders and managed folders (besides objects) + // in the returned `prefixes`. Requires `delimiter` to be set to '/'. + bool include_folders_as_prefixes = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to objects and prefixes that match this glob + // pattern. See [List objects using + // glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob) + // for the full syntax. + string match_glob = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression used to filter the returned objects by the + // `context` field. For the full syntax, see [Filter objects by contexts + // syntax](https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax). + // If a `delimiter` is set, the returned `prefixes` are exempt from this + // filter. + string filter = 15 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request object for +// [QueryWriteStatus][google.storage.v2.Storage.QueryWriteStatus]. +message QueryWriteStatusRequest { + // Required. The name of the resume token for the object whose write status is + // being requested. + string upload_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response object for +// [QueryWriteStatus][google.storage.v2.Storage.QueryWriteStatus]. +message QueryWriteStatusResponse { + // The response sets one of the following. + oneof write_status { + // The total number of bytes that have been processed for the given object + // from all `WriteObject` calls. This is the correct value for the + // 'write_offset' field to use when resuming the `WriteObject` operation. + // Only set if the upload has not finalized. + int64 persisted_size = 1; + + // A resource containing the metadata for the uploaded object. Only set if + // the upload has finalized. + Object resource = 2; + } + + // If persisted_size is set, contains checksums of persisted data. + ObjectChecksums persisted_data_checksums = 3; +} + +// Request message for [RewriteObject][google.storage.v2.Storage.RewriteObject]. +// If the source object is encrypted using a Customer-Supplied Encryption Key +// the key information must be provided in the +// `copy_source_encryption_algorithm`, `copy_source_encryption_key_bytes`, and +// `copy_source_encryption_key_sha256_bytes` fields. If the destination object +// should be encrypted the keying information should be provided in the +// `encryption_algorithm`, `encryption_key_bytes`, and +// `encryption_key_sha256_bytes` fields of the +// `common_object_request_params.customer_encryption` field. +message RewriteObjectRequest { + // Required. Immutable. The name of the destination object. + // See the + // [Naming Guidelines](https://cloud.google.com/storage/docs/objects#naming). + // Example: `test.txt` + // The `name` field by itself does not uniquely identify a Cloud Storage + // object. A Cloud Storage object is uniquely identified by the tuple of + // (bucket, object, generation). + string destination_name = 24 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The name of the bucket containing the destination + // object. + string destination_bucket = 25 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Optional. The name of the Cloud KMS key that is used to encrypt the + // destination object. The Cloud KMS key must be located in same location as + // the object. If the parameter is not specified, the request uses the + // destination bucket's default encryption key, if any, or else the + // Google-managed encryption key. + string destination_kms_key = 27 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Properties of the destination, post-rewrite object. + // The `name`, `bucket` and `kms_key` fields must not be populated (these + // values are specified in the `destination_name`, `destination_bucket`, and + // `destination_kms_key` fields). + // If `destination` is present it is used to construct the destination + // object's metadata; otherwise the destination object's metadata is + // copied from the source object. + Object destination = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Name of the bucket in which to find the source object. + string source_bucket = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. Name of the source object. + string source_object = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If present, selects a specific revision of the source object (as + // opposed to the latest version, the default). + int64 source_generation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Include this field (from the previous rewrite response) on each + // rewrite request after the first one, until the rewrite response 'done' flag + // is true. Calls that provide a rewriteToken can omit all other request + // fields, but if included those fields must match the values provided in the + // first rewrite request. + string rewrite_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Apply a predefined set of access controls to the destination + // object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + string destination_predefined_acl = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 7; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 8; + + // Makes the operation conditional on whether the destination object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 9; + + // Makes the operation conditional on whether the destination object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 10; + + // Makes the operation conditional on whether the source object's live + // generation matches the given value. + optional int64 if_source_generation_match = 11; + + // Makes the operation conditional on whether the source object's live + // generation does not match the given value. + optional int64 if_source_generation_not_match = 12; + + // Makes the operation conditional on whether the source object's current + // metageneration matches the given value. + optional int64 if_source_metageneration_match = 13; + + // Makes the operation conditional on whether the source object's current + // metageneration does not match the given value. + optional int64 if_source_metageneration_not_match = 14; + + // Optional. The maximum number of bytes that are rewritten per rewrite + // request. Most callers shouldn't need to specify this parameter - it is + // primarily in place to support testing. If specified the value must be an + // integral multiple of 1 MiB (1048576). Also, this only applies to requests + // where the source and destination span locations and/or storage classes. + // Finally, this value must not change across rewrite calls else you'll get an + // error that the `rewriteToken` is invalid. + int64 max_bytes_rewritten_per_call = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The algorithm used to encrypt the source object, if any. Used if + // the source object was encrypted with a Customer-Supplied Encryption Key. + string copy_source_encryption_algorithm = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The raw bytes (not base64-encoded) AES-256 encryption key used to + // encrypt the source object, if it was encrypted with a Customer-Supplied + // Encryption Key. + bytes copy_source_encryption_key_bytes = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The raw bytes (not base64-encoded) SHA256 hash of the encryption + // key used to encrypt the source object, if it was encrypted with a + // Customer-Supplied Encryption Key. + bytes copy_source_encryption_key_sha256_bytes = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The checksums of the complete object. This is used to validate + // the destination object after rewriting. + ObjectChecksums object_checksums = 29 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A rewrite response. +message RewriteResponse { + // The total bytes written so far, which can be used to provide a waiting user + // with a progress indicator. This property is always present in the response. + int64 total_bytes_rewritten = 1; + + // The total size of the object being copied in bytes. This property is always + // present in the response. + int64 object_size = 2; + + // `true` if the copy is finished; otherwise, `false` if + // the copy is in progress. This property is always present in the response. + bool done = 3; + + // A token to use in subsequent requests to continue copying data. This token + // is present in the response only when there is more data to copy. + string rewrite_token = 4; + + // A resource containing the metadata for the copied-to object. This property + // is present in the response only when copying completes. + Object resource = 5; +} + +// Request message for [MoveObject][google.storage.v2.Storage.MoveObject]. +message MoveObjectRequest { + // Required. Name of the bucket in which the object resides. + string bucket = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Required. Name of the source object. + string source_object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the destination object. + string destination_object = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Makes the operation conditional on whether the source object's + // current generation matches the given value. `if_source_generation_match` + // and `if_source_generation_not_match` conditions are mutually exclusive: + // it's an error for both of them to be set in the request. + optional int64 if_source_generation_match = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the source object's + // current generation does not match the given value. + // `if_source_generation_match` and `if_source_generation_not_match` + // conditions are mutually exclusive: it's an error for both of them to be set + // in the request. + optional int64 if_source_generation_not_match = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the source object's + // current metageneration matches the given value. + // `if_source_metageneration_match` and `if_source_metageneration_not_match` + // conditions are mutually exclusive: it's an error for both of them to be set + // in the request. + optional int64 if_source_metageneration_match = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the source object's + // current metageneration does not match the given value. + // `if_source_metageneration_match` and `if_source_metageneration_not_match` + // conditions are mutually exclusive: it's an error for both of them to be set + // in the request. + optional int64 if_source_metageneration_not_match = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the destination + // object's current generation matches the given value. Setting to 0 makes the + // operation succeed only if there are no live versions of the object. + // `if_generation_match` and `if_generation_not_match` conditions are mutually + // exclusive: it's an error for both of them to be set in the request. + optional int64 if_generation_match = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the destination + // object's current generation does not match the given value. If no live + // object exists, the precondition fails. Setting to 0 makes the operation + // succeed only if there is a live version of the object. + // `if_generation_match` and `if_generation_not_match` conditions are mutually + // exclusive: it's an error for both of them to be set in the request. + optional int64 if_generation_not_match = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the destination + // object's current metageneration matches the given value. + // `if_metageneration_match` and `if_metageneration_not_match` conditions are + // mutually exclusive: it's an error for both of them to be set in the + // request. + optional int64 if_metageneration_match = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Makes the operation conditional on whether the destination + // object's current metageneration does not match the given value. + // `if_metageneration_match` and `if_metageneration_not_match` conditions are + // mutually exclusive: it's an error for both of them to be set in the + // request. + optional int64 if_metageneration_not_match = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [StartResumableWrite][google.storage.v2.Storage.StartResumableWrite]. +message StartResumableWriteRequest { + // Required. Contains the information necessary to start a resumable write. + WriteObjectSpec write_object_spec = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A set of parameters common to Storage API requests related to an + // object. + CommonObjectRequestParams common_object_request_params = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The checksums of the complete object. This is used to validate + // the uploaded object. For each upload, `object_checksums` can be provided + // when initiating a resumable upload with`StartResumableWriteRequest` or when + // completing a write with `WriteObjectRequest` with + // `finish_write` set to `true`. + ObjectChecksums object_checksums = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response object for +// [StartResumableWrite][google.storage.v2.Storage.StartResumableWrite]. +message StartResumableWriteResponse { + // A unique identifier for the initiated resumable write operation. + // As the ID grants write access, you should keep it confidential during + // the upload to prevent unauthorized access and data tampering during your + // upload. This ID should be included in subsequent `WriteObject` requests to + // upload the object data. + string upload_id = 1; +} + +// Request message for [UpdateObject][google.storage.v2.Storage.UpdateObject]. +message UpdateObjectRequest { + // Required. The object to update. + // The object's bucket and name fields are used to identify the object to + // update. If present, the object's generation field selects a specific + // revision of this object whose metadata should be updated. Otherwise, + // assumes the live version of the object. + Object object = 1 [(google.api.field_behavior) = REQUIRED]; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 2; + + // Makes the operation conditional on whether the object's live generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 3; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 4; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 5; + + // Optional. Apply a predefined set of access controls to this object. + // Valid values are "authenticatedRead", "bucketOwnerFullControl", + // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". + string predefined_acl = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Required. List of fields to be updated. + // + // To specify ALL fields, equivalent to the JSON API's "update" function, + // specify a single field with the value `*`. Note: not recommended. If a new + // field is introduced at a later time, an older client updating with the `*` + // might accidentally reset the new field's value. + // + // Not specifying any fields is an error. + google.protobuf.FieldMask update_mask = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A set of parameters common to Storage API requests concerning an + // object. + CommonObjectRequestParams common_object_request_params = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Overrides the unlocked retention config on the object. + bool override_unlocked_retention = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Parameters that can be passed to any object request. +message CommonObjectRequestParams { + // Optional. Encryption algorithm used with the Customer-Supplied Encryption + // Keys feature. + string encryption_algorithm = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encryption key used with the Customer-Supplied Encryption Keys + // feature. In raw bytes format (not base64-encoded). + bytes encryption_key_bytes = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SHA256 hash of encryption key used with the Customer-supplied + // encryption keys feature. + bytes encryption_key_sha256_bytes = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Shared constants. +message ServiceConstants { + // A collection of constant values meaningful to the Storage API. + enum Values { + option allow_alias = true; + + // Unused. Proto3 requires first enum to be 0. + VALUES_UNSPECIFIED = 0; + + // The maximum size chunk that can be returned in a single + // `ReadRequest`. + // 2 MiB. + MAX_READ_CHUNK_BYTES = 2097152; + + // The maximum size chunk that can be sent in a single WriteObjectRequest. + // 2 MiB. + MAX_WRITE_CHUNK_BYTES = 2097152; + + // The maximum size of an object in MB - whether written in a single stream + // or composed from multiple other objects. + // 5 TiB. + MAX_OBJECT_SIZE_MB = 5242880; + + // The maximum length field name that can be sent in a single + // custom metadata field. + // 1 KiB. + MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; + + // The maximum length field value that can be sent in a single + // custom_metadata field. + // 4 KiB. + MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; + + // The maximum total bytes that can be populated into all field names and + // values of the custom_metadata for one object. + // 8 KiB. + MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; + + // The maximum total bytes that can be populated into all bucket metadata + // fields. + // 20 KiB. + MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; + + // The maximum number of NotificationConfigs that can be registered + // for a given bucket. + MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; + + // The maximum number of LifecycleRules that can be registered for a given + // bucket. + MAX_LIFECYCLE_RULES_PER_BUCKET = 100; + + // The maximum number of custom attributes per NotificationConfigs. + MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; + + // The maximum length of a custom attribute key included in + // NotificationConfig. + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; + + // The maximum length of a custom attribute value included in a + // NotificationConfig. + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; + + // The maximum number of key/value entries per bucket label. + MAX_LABELS_ENTRIES_COUNT = 64; + + // The maximum character length of the key or value in a bucket + // label map. + MAX_LABELS_KEY_VALUE_LENGTH = 63; + + // The maximum byte size of the key or value in a bucket label + // map. + MAX_LABELS_KEY_VALUE_BYTES = 128; + + // The maximum number of object IDs that can be included in a + // DeleteObjectsRequest. + MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; + + // The maximum number of days for which a token returned by the + // GetListObjectsSplitPoints RPC is valid. + SPLIT_TOKEN_MAX_VALID_DAYS = 14; + } +} + +// A bucket. +message Bucket { + option (google.api.resource) = { + type: "storage.googleapis.com/Bucket" + pattern: "projects/{project}/buckets/{bucket}" + plural: "buckets" + singular: "bucket" + }; + + // Billing properties of a bucket. + message Billing { + // Optional. When set to true, Requester Pays is enabled for this bucket. + bool requester_pays = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Cross-Origin Response sharing (CORS) properties for a bucket. + // For more on Cloud Storage and CORS, see + // https://cloud.google.com/storage/docs/cross-origin. + // For more on CORS in general, see https://tools.ietf.org/html/rfc6454. + message Cors { + // Optional. The list of origins eligible to receive CORS response headers. + // For more information about origins, see [RFC + // 6454](https://tools.ietf.org/html/rfc6454). Note: `*` is permitted in the + // list of origins, and means `any origin`. + repeated string origin = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of HTTP methods on which to include CORS response + // headers, + // (`GET`, `OPTIONS`, `POST`, etc) Note: `*` is permitted in the list of + // methods, and means "any method". + repeated string method = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of HTTP headers other than the [simple response + // headers](https://www.w3.org/TR/cors/#simple-response-headers) to give + // permission for the user-agent to share across domains. + repeated string response_header = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value, in seconds, to return in the [Access-Control-Max-Age + // header](https://www.w3.org/TR/cors/#access-control-max-age-response-header) + // used in preflight responses. + int32 max_age_seconds = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Encryption properties of a bucket. + message Encryption { + // Google Managed Encryption (GMEK) enforcement config of a bucket. + message GoogleManagedEncryptionEnforcementConfig { + // Restriction mode for google-managed encryption for new objects within + // the bucket. Valid values are: `NotRestricted` and `FullyRestricted`. + // If `NotRestricted` or unset, creation of new objects with + // google-managed encryption is allowed. + // If `FullyRestricted`, new objects can't be created using google-managed + // encryption. + optional string restriction_mode = 3; + + // Time from which the config was effective. This is service-provided. + optional google.protobuf.Timestamp effective_time = 2; + } + + // Customer Managed Encryption (CMEK) enforcement config of a bucket. + message CustomerManagedEncryptionEnforcementConfig { + // Restriction mode for customer-managed encryption for new objects within + // the bucket. Valid values are: `NotRestricted` and `FullyRestricted`. + // If `NotRestricted` or unset, creation of new objects with + // customer-managed encryption is allowed. + // If `FullyRestricted`, new objects can't be created using + // customer-managed encryption. + optional string restriction_mode = 3; + + // Time from which the config was effective. This is service-provided. + optional google.protobuf.Timestamp effective_time = 2; + } + + // Customer Supplied Encryption (CSEK) enforcement config of a bucket. + message CustomerSuppliedEncryptionEnforcementConfig { + // Restriction mode for customer-supplied encryption for new objects + // within the bucket. Valid values are: `NotRestricted` and + // `FullyRestricted`. + // If `NotRestricted` or unset, creation of new objects with + // customer-supplied encryption is allowed. + // If `FullyRestricted`, new objects can't be created using + // customer-supplied encryption. + optional string restriction_mode = 3; + + // Time from which the config was effective. This is service-provided. + optional google.protobuf.Timestamp effective_time = 2; + } + + // Optional. The name of the Cloud KMS key that is used to encrypt objects + // inserted into this bucket, if no encryption method is specified. + string default_kms_key = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. If omitted, then new objects with GMEK encryption-type is + // allowed. If set, then new objects created in this bucket must comply with + // enforcement config. Changing this has no effect on existing objects; it + // applies to new objects only. + optional GoogleManagedEncryptionEnforcementConfig + google_managed_encryption_enforcement_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If omitted, then new objects with CMEK encryption-type is + // allowed. If set, then new objects created in this bucket must comply with + // enforcement config. Changing this has no effect on existing objects; it + // applies to new objects only. + optional CustomerManagedEncryptionEnforcementConfig + customer_managed_encryption_enforcement_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If omitted, then new objects with CSEK encryption-type is + // allowed. If set, then new objects created in this bucket must comply with + // enforcement config. Changing this has no effect on existing objects; it + // applies to new objects only. + optional CustomerSuppliedEncryptionEnforcementConfig + customer_supplied_encryption_enforcement_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Bucket restriction options. + message IamConfig { + // Settings for Uniform Bucket level access. + // See https://cloud.google.com/storage/docs/uniform-bucket-level-access. + message UniformBucketLevelAccess { + // Optional. If set, access checks only use bucket-level IAM policies or + // above. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The deadline time for changing + // `iam_config.uniform_bucket_level_access.enabled` from `true` to + // `false`. Mutable until the specified deadline is reached, but not + // afterward. + google.protobuf.Timestamp lock_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Bucket restriction options currently enforced on the bucket. + UniformBucketLevelAccess uniform_bucket_level_access = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether IAM enforces public access prevention. Valid values are + // `enforced` or `inherited`. + string public_access_prevention = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Lifecycle properties of a bucket. + // For more information, see [Object Lifecycle + // Management](https://cloud.google.com/storage/docs/lifecycle). + message Lifecycle { + // A lifecycle Rule, combining an action to take on an object and a + // condition which triggers that action. + message Rule { + // An action to take on an object. + message Action { + // Optional. Type of the action. Currently, only `Delete`, + // `SetStorageClass`, and `AbortIncompleteMultipartUpload` are + // supported. + string type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Target storage class. Required iff the type of the action + // is SetStorageClass. + string storage_class = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // A condition of an object which triggers some action. + message Condition { + // Age of an object (in days). This condition is satisfied when an + // object reaches the specified age. + // A value of 0 indicates that all objects immediately match this + // condition. + optional int32 age_days = 1; + + // Optional. This condition is satisfied when an object is created + // before midnight of the specified date in UTC. + google.type.Date created_before = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Relevant only for versioned objects. If the value is + // `true`, this condition matches live objects; if the value + // is `false`, it matches archived objects. + optional bool is_live = 3; + + // Relevant only for versioned objects. If the value is N, this + // condition is satisfied when there are at least N versions (including + // the live version) newer than this version of the object. + optional int32 num_newer_versions = 4; + + // Optional. Objects having any of the storage classes specified by this + // condition are matched. Values include `MULTI_REGIONAL`, `REGIONAL`, + // `NEARLINE`, `COLDLINE`, `STANDARD`, and + // `DURABLE_REDUCED_AVAILABILITY`. + repeated string matches_storage_class = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Number of days that have elapsed since the custom timestamp set on an + // object. + // The value of the field must be a nonnegative integer. + optional int32 days_since_custom_time = 7; + + // Optional. An object matches this condition if the custom timestamp + // set on the object is before the specified date in UTC. + google.type.Date custom_time_before = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // This condition is relevant only for versioned objects. An object + // version satisfies this condition only if these many days have been + // passed since it became noncurrent. The value of the field must be a + // nonnegative integer. If it's zero, the object version becomes + // eligible for Lifecycle action as soon as it becomes noncurrent. + optional int32 days_since_noncurrent_time = 9; + + // Optional. This condition is relevant only for versioned objects. An + // object version satisfies this condition only if it became noncurrent + // before the specified date in UTC. + google.type.Date noncurrent_time_before = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of object name prefixes. If any prefix exactly matches + // the beginning of the object name, the condition evaluates to true. + repeated string matches_prefix = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of object name suffixes. If any suffix exactly matches + // the end of the object name, the condition evaluates to true. + repeated string matches_suffix = 12 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The action to take. + Action action = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The condition under which the action is taken. + Condition condition = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A lifecycle management rule, which is made of an action to take + // and the condition under which the action is taken. + repeated Rule rule = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Logging-related properties of a bucket. + message Logging { + // Optional. The destination bucket where the current bucket's logs should + // be placed, using path format (like `projects/123456/buckets/foo`). + string log_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A prefix for log object names. + string log_object_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Object Retention related properties of a bucket. + message ObjectRetention { + // Optional. Output only. If true, object retention is enabled for the + // bucket. + bool enabled = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + } + + // Retention policy properties of a bucket. + message RetentionPolicy { + // Optional. Server-determined value that indicates the time from which + // policy was enforced and effective. + google.protobuf.Timestamp effective_time = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Once locked, an object retention policy cannot be modified. + bool is_locked = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The duration that objects need to be retained. Retention + // duration must be greater than zero and less than 100 years. Note that + // enforcement of retention periods less than a day is not guaranteed. Such + // periods should only be used for testing purposes. Any `nanos` value + // specified is rounded down to the nearest second. + google.protobuf.Duration retention_duration = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Soft delete policy properties of a bucket. + message SoftDeletePolicy { + // The period of time that soft-deleted objects in the bucket must be + // retained and cannot be permanently deleted. The duration must be greater + // than or equal to 7 days and less than 1 year. + optional google.protobuf.Duration retention_duration = 1; + + // Time from which the policy was effective. This is service-provided. + optional google.protobuf.Timestamp effective_time = 2; + } + + // Properties of a bucket related to versioning. + // For more information about Cloud Storage versioning, see [Object + // versioning](https://cloud.google.com/storage/docs/object-versioning). + message Versioning { + // Optional. While set to true, versioning is fully enabled for this bucket. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Properties of a bucket related to accessing the contents as a static + // website. For details, see [hosting a static website using Cloud + // Storage](https://cloud.google.com/storage/docs/hosting-static-website). + message Website { + // Optional. If the requested object path is missing, the service ensures + // the path has a trailing '/', append this suffix, and attempt to retrieve + // the resulting object. This allows the creation of `index.html` objects to + // represent directory pages. + string main_page_suffix = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If the requested object path is missing, and any + // `mainPageSuffix` object is missing, if applicable, the service + // returns the named object from this bucket as the content for a + // [404 Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) + // result. + string not_found_page = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for [configurable dual- + // regions](https://cloud.google.com/storage/docs/locations#configurable). It + // should specify precisely two eligible regions within the same multi-region. + // For details, see + // [locations](https://cloud.google.com/storage/docs/locations). + message CustomPlacementConfig { + // Optional. List of locations to use for data placement. + repeated string data_locations = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for a bucket's Autoclass feature. + message Autoclass { + // Optional. Enables Autoclass. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Latest instant at which the `enabled` field was set to true + // after being disabled/unconfigured or set to false after being enabled. If + // Autoclass is enabled when the bucket is created, the value of the + // `toggle_time` field is set to the bucket `create_time`. + google.protobuf.Timestamp toggle_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // An object in an Autoclass bucket eventually cools down to the + // terminal storage class if there is no access to the object. + // The only valid values are NEARLINE and ARCHIVE. + optional string terminal_storage_class = 3; + + // Output only. Latest instant at which the autoclass terminal storage class + // was updated. + optional google.protobuf.Timestamp terminal_storage_class_update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The [bucket IP + // filtering](https://cloud.google.com/storage/docs/ip-filtering-overview) + // configuration. Specifies the network sources that can access the bucket, as + // well as its underlying objects. + message IpFilter { + // The public network IP address ranges that can access the bucket and its + // data. + message PublicNetworkSource { + // Optional. The list of IPv4 and IPv6 cidr blocks that are allowed to + // operate or access the bucket and its underlying objects. + repeated string allowed_ip_cidr_ranges = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The list of VPC networks that can access the bucket. + message VpcNetworkSource { + // Name of the network. + // + // Format: `projects/PROJECT_ID/global/networks/NETWORK_NAME` + optional string network = 1; + + // Optional. The list of public or private IPv4 and IPv6 CIDR ranges that + // can access the bucket. In the CIDR IP address block, the specified IP + // address must be properly truncated, meaning all the host bits must be + // zero or else the input is considered malformed. For example, + // `192.0.2.0/24` is accepted but `192.0.2.1/24` is not. Similarly, for + // IPv6, `2001:db8::/32` is accepted whereas `2001:db8::1/32` is not. + repeated string allowed_ip_cidr_ranges = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The state of the IP filter configuration. Valid values are `Enabled` and + // `Disabled`. When set to `Enabled`, IP filtering rules are applied to a + // bucket and all incoming requests to the bucket are evaluated against + // these rules. When set to `Disabled`, IP filtering rules are not applied + // to a bucket. + optional string mode = 1; + + // Public IPs allowed to operate or access the bucket. + optional PublicNetworkSource public_network_source = 2; + + // Optional. The list of network sources that are allowed to access + // operations on the bucket or the underlying objects. + repeated VpcNetworkSource vpc_network_sources = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not to allow VPCs from orgs different than the + // bucket's parent org to access the bucket. When set to true, validations + // on the existence of the VPCs won't be performed. If set to false, each + // VPC network source is checked to belong to the same org as the bucket as + // well as validated for existence. + bool allow_cross_org_vpcs = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Whether or not to allow all P4SA access to the bucket. When set to true, + // IP filter config validation doesn't apply. + optional bool allow_all_service_agent_access = 5; + } + + // Configuration for a bucket's hierarchical namespace feature. + message HierarchicalNamespace { + // Optional. Enables the hierarchical namespace feature. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The name of the bucket. + // Format: `projects/{project}/buckets/{bucket}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The user-chosen part of the bucket name. The `{bucket}` + // portion of the `name` field. For globally unique buckets, this is equal to + // the `bucket name` of other Cloud Storage APIs. Example: `pub`. + string bucket_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag of the bucket. + // If included in the metadata of an `UpdateBucketRequest`, the operation is + // only performed if the `etag` matches that of the bucket. + string etag = 29; + + // Immutable. The project which owns this bucket, in the format of + // `projects/{projectIdentifier}`. + // `{projectIdentifier}` can be the project ID or project number. + // Output values are always in the project number format. + string project = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. The metadata generation of this bucket. + int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The location of the bucket. Object data for objects in the + // bucket resides in physical storage within this region. Defaults to `US`. + // Attempting to update this field after the bucket is created results in an + // error. + string location = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The location type of the bucket (region, dual-region, + // multi-region, etc). + string location_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The bucket's default storage class, used whenever no storageClass + // is specified for a newly-created object. This defines how objects in the + // bucket are stored and determines the SLA and the cost of storage. + // If this value is not specified when the bucket is created, it defaults + // to `STANDARD`. For more information, see [Storage + // classes](https://developers.google.com/storage/docs/storage-classes). + string storage_class = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The recovery point objective for cross-region replication of the + // bucket. Applicable only for dual- and multi-region buckets. `DEFAULT` uses + // default replication. `ASYNC_TURBO` enables turbo replication, valid for + // dual-region buckets only. If rpo is not specified when the bucket is + // created, it defaults to `DEFAULT`. For more information, see [Turbo + // replication](https://cloud.google.com/storage/docs/availability-durability#turbo-replication). + string rpo = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Access controls on the bucket. + // If `iam_config.uniform_bucket_level_access` is enabled on this bucket, + // requests to set, read, or modify acl is an error. + repeated BucketAccessControl acl = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default access controls to apply to new objects when no ACL is + // provided. If `iam_config.uniform_bucket_level_access` is enabled on this + // bucket, requests to set, read, or modify acl is an error. + repeated ObjectAccessControl default_object_acl = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's lifecycle configuration. See [Lifecycle + // Management](https://developers.google.com/storage/docs/lifecycle) for more + // information. + Lifecycle lifecycle = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The creation time of the bucket. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The bucket's [CORS](https://www.w3.org/TR/cors/) + // configuration. + repeated Cors cors = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The modification time of the bucket. + google.protobuf.Timestamp update_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The default value for event-based hold on newly created objects + // in this bucket. Event-based hold is a way to retain objects indefinitely + // until an event occurs, signified by the hold's release. After being + // released, such objects are subject to bucket-level retention (if any). One + // sample use case of this flag is for banks to hold loan documents for at + // least 3 years after loan is paid in full. Here, bucket-level retention is 3 + // years and the event is loan being paid in full. In this example, these + // objects are held intact for any number of years until the event has + // occurred (event-based hold on the object is released) and then 3 more years + // after that. That means retention duration of the objects begins from the + // moment event-based hold transitioned from true to false. Objects under + // event-based hold cannot be deleted, overwritten or archived until the hold + // is removed. + bool default_event_based_hold = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided labels, in key/value pairs. + map labels = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's website config, controlling how the service behaves + // when accessing bucket contents as a web site. See the [Static website + // examples](https://cloud.google.com/storage/docs/static-website) for more + // information. + Website website = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's versioning configuration. + Versioning versioning = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's logging config, which defines the destination bucket + // and name prefix (if any) for the current bucket's logs. + Logging logging = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The owner of the bucket. This is always the project team's + // owner group. + Owner owner = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Encryption config for a bucket. + Encryption encryption = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's billing configuration. + Billing billing = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's retention policy. The retention policy enforces a + // minimum retention time for all objects contained in the bucket, based on + // their creation time. Any attempt to overwrite or delete objects younger + // than the retention period results in a `PERMISSION_DENIED` error. An + // unlocked retention policy can be modified or removed from the bucket via a + // storage.buckets.update operation. A locked retention policy cannot be + // removed or shortened in duration for the lifetime of the bucket. + // Attempting to remove or decrease period of a locked retention policy + // results in a `PERMISSION_DENIED` error. + RetentionPolicy retention_policy = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's IAM configuration. + IamConfig iam_config = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use. + bool satisfies_pzs = 25 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration that, if present, specifies the data placement for + // a [configurable + // dual-region](https://cloud.google.com/storage/docs/locations#location-dr). + CustomPlacementConfig custom_placement_config = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's Autoclass configuration. If there is no + // configuration, the Autoclass feature is disabled and has no effect on the + // bucket. + Autoclass autoclass = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's hierarchical namespace configuration. If there is no + // configuration, the hierarchical namespace feature is disabled and has + // no effect on the bucket. + HierarchicalNamespace hierarchical_namespace = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's soft delete policy. The soft delete policy prevents + // soft-deleted objects from being permanently deleted. + SoftDeletePolicy soft_delete_policy = 31 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's object retention configuration. Must be enabled + // before objects in the bucket might have retention configured. + ObjectRetention object_retention = 33 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bucket's IP filter configuration. + optional IpFilter ip_filter = 38 [(google.api.field_behavior) = OPTIONAL]; +} + +// An access-control entry. +message BucketAccessControl { + // Optional. The access permission for the entity. + string role = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID of the access-control entry. + string id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The entity holding the permission, in one of the following forms: + // * `user-{userid}` + // * `user-{email}` + // * `group-{groupid}` + // * `group-{email}` + // * `domain-{domain}` + // * `project-{team}-{projectnumber}` + // * `project-{team}-{projectid}` + // * `allUsers` + // * `allAuthenticatedUsers` + // Examples: + // * The user `liz@example.com` would be `user-liz@example.com`. + // * The group `example@googlegroups.com` would be + // `group-example@googlegroups.com` + // * All members of the Google Apps for Business domain `example.com` would be + // `domain-example.com` + // For project entities, `project-{team}-{projectnumber}` format is + // returned on response. + string entity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The alternative entity format, if exists. For project + // entities, `project-{team}-{projectid}` format is returned in the response. + string entity_alt = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The ID for the entity, if any. + string entity_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The `etag` of the `BucketAccessControl`. + // If included in the metadata of an update or delete request message, the + // operation operation is only performed if the etag matches that of the + // bucket's `BucketAccessControl`. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The email address associated with the entity, if any. + string email = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The domain associated with the entity, if any. + string domain = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The project team associated with the entity, if any. + ProjectTeam project_team = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message used to convey content being read or written, along with an optional +// checksum. +message ChecksummedData { + // Optional. The data. + bytes content = 1 [ctype = CORD, (google.api.field_behavior) = OPTIONAL]; + + // If set, the CRC32C digest of the content field. + optional fixed32 crc32c = 2; +} + +// Message used for storing full (not subrange) object checksums. +message ObjectChecksums { + // CRC32C digest of the object data. Computed by the Cloud Storage service for + // all written objects. + // If set in a WriteObjectRequest, service validates that the stored + // object matches this checksum. + optional fixed32 crc32c = 1; + + // Optional. 128 bit MD5 hash of the object data. For more information about + // using the MD5 hash, see [Data validation and change + // detection](https://cloud.google.com/storage/docs/data-validation). Not all + // objects provide an MD5 hash. For example, composite objects provide only + // crc32c hashes. This value is equivalent to running `cat object.txt | + // openssl md5 -binary` + bytes md5_hash = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The payload of a single user-defined object context. +message ObjectCustomContextPayload { + // Required. The value of the object context. + string value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time at which the object context was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the object context was last updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// All contexts of an object grouped by type. +message ObjectContexts { + // Optional. User-defined object contexts. + // The maximum key or value size is `256` characters. + // The maximum number of entries is `50`. + // The maximum total serialized size of all entries is `25KiB`. + map custom = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Describes the customer-supplied encryption key mechanism used to store an +// object's data at rest. +message CustomerEncryption { + // Optional. The encryption algorithm. + string encryption_algorithm = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SHA256 hash value of the encryption key. + // In raw bytes format (not base64-encoded). + bytes key_sha256_bytes = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// An object. +message Object { + // Specifies retention parameters of the object. Objects under retention + // cannot be deleted or overwritten until their retention expires. + message Retention { + // Retention mode values. + enum Mode { + // No specified mode. Object is not under retention. + MODE_UNSPECIFIED = 0; + + // Retention period might be decreased or increased. + // The Retention configuration might be removed. + // The mode might be changed to locked. + UNLOCKED = 1; + + // Retention period might be increased. + // The Retention configuration cannot be removed. + // The mode cannot be changed. + LOCKED = 2; + } + + // Optional. The mode of the Retention. + Mode mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The timestamp that the object needs to be retained until. + // Value cannot be set in the past or more than 100 years in the future. + google.protobuf.Timestamp retain_until_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Immutable. The name of this object. Nearly any sequence of unicode + // characters is valid. See + // [Guidelines](https://cloud.google.com/storage/docs/objects#naming). + // Example: `test.txt` + // The `name` field by itself does not uniquely identify a Cloud Storage + // object. A Cloud Storage object is uniquely identified by the tuple of + // (bucket, object, generation). + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The name of the bucket containing this object. + string bucket = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; + + // Optional. The `etag` of an object. + // If included in the metadata of an update or delete request message, the + // operation is only performed if the etag matches that of the live + // object. + string etag = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The content generation of this object. Used for object + // versioning. + int64 generation = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Restore token used to differentiate deleted objects with the + // same name and generation. This field is output only, and only set for + // deleted objects in HNS buckets. + optional string restore_token = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of the metadata for this generation of this + // object. Used for preconditions and for detecting changes in metadata. A + // metageneration number is only meaningful in the context of a particular + // generation of a particular object. + int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Storage class of the object. + string storage_class = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Content-Length of the object data in bytes, matching + // [RFC 7230 §3.3.2](https://tools.ietf.org/html/rfc7230#section-3.3.2]). + int64 size = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Content-Encoding of the object data, matching + // [RFC 7231 §3.1.2.2](https://tools.ietf.org/html/rfc7231#section-3.1.2.2) + string content_encoding = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Content-Disposition of the object data, matching + // [RFC 6266](https://tools.ietf.org/html/rfc6266). + string content_disposition = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cache-Control directive for the object data, matching + // [RFC 7234 §5.2](https://tools.ietf.org/html/rfc7234#section-5.2). + // If omitted, and the object is accessible to all anonymous users, the + // default is `public, max-age=3600`. + string cache_control = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Access controls on the object. + // If `iam_config.uniform_bucket_level_access` is enabled on the parent + // bucket, requests to set, read, or modify acl is an error. + repeated ObjectAccessControl acl = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Content-Language of the object data, matching + // [RFC 7231 §3.1.3.2](https://tools.ietf.org/html/rfc7231#section-3.1.3.2). + string content_language = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. If this object is noncurrent, this is the time when the object + // became noncurrent. + google.protobuf.Timestamp delete_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the object was finalized. + google.protobuf.Timestamp finalize_time = 36 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Content-Type of the object data, matching + // [RFC 7231 §3.1.1.5](https://tools.ietf.org/html/rfc7231#section-3.1.1.5). + // If an object is stored without a Content-Type, it is served as + // `application/octet-stream`. + string content_type = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The creation time of the object. + google.protobuf.Timestamp create_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of underlying components that make up this object. + // Components are accumulated by compose operations. + int32 component_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Hashes for the data part of this object. This field is used + // for output only and is silently ignored if provided in requests. The + // checksums of the complete object regardless of data range. If the object is + // downloaded in full, the client should compute one of these checksums over + // the downloaded object and compare it against the value provided here. + ObjectChecksums checksums = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The modification time of the object metadata. + // Set initially to object creation time and then updated whenever any + // metadata of the object changes. This includes changes made by a requester, + // such as modifying custom metadata, as well as changes made by Cloud Storage + // on behalf of a requester, such as changing the storage class based on an + // Object Lifecycle Configuration. + google.protobuf.Timestamp update_time = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Cloud KMS Key used to encrypt this object, if the object is + // encrypted by such a key. + string kms_key = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The time at which the object's storage class was last changed. + // When the object is initially created, it is set to `time_created`. + google.protobuf.Timestamp update_storage_class_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Whether an object is under temporary hold. While this flag is set + // to true, the object is protected against deletion and overwrites. A common + // use case of this flag is regulatory investigations where objects need to be + // retained while the investigation is ongoing. Note that unlike event-based + // hold, temporary hold does not impact retention expiration time of an + // object. + bool temporary_hold = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A server-determined value that specifies the earliest time that + // the object's retention period expires. Note 1: This field is not provided + // for objects with an active event-based hold, since retention expiration is + // unknown until the hold is removed. Note 2: This value can be provided even + // when temporary hold is set (so that the user can reason about policy + // without having to first unset the temporary hold). + google.protobuf.Timestamp retention_expire_time = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided metadata, in key/value pairs. + map metadata = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-defined or system-defined object contexts. Each object + // context is a key-payload pair, where the key provides the identification + // and the payload holds the associated value and additional metadata. + ObjectContexts contexts = 38 [(google.api.field_behavior) = OPTIONAL]; + + // Whether an object is under event-based hold. + // An event-based hold is a way to force the retention of an object until + // after some event occurs. Once the hold is released by explicitly setting + // this field to `false`, the object becomes subject to any bucket-level + // retention policy, except that the retention duration is calculated + // from the time the event based hold was lifted, rather than the time the + // object was created. + // + // In a `WriteObject` request, not setting this field implies that the value + // should be taken from the parent bucket's `default_event_based_hold` field. + // In a response, this field is always set to `true` or `false`. + optional bool event_based_hold = 23; + + // Output only. The owner of the object. This is always the uploader of the + // object. + Owner owner = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Metadata of customer-supplied encryption key, if the object is + // encrypted by such a key. + CustomerEncryption customer_encryption = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A user-specified timestamp set on an object. + google.protobuf.Timestamp custom_time = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. This is the time when the object became soft-deleted. + // + // Soft-deleted objects are only accessible if a soft_delete_policy is + // enabled. Also see `hard_delete_time`. + optional google.protobuf.Timestamp soft_delete_time = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the object is permanently deleted. + // + // Only set when an object becomes soft-deleted with a `soft_delete_policy`. + // Otherwise, the object is not accessible. + optional google.protobuf.Timestamp hard_delete_time = 29 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Retention configuration of this object. + // Might only be configured if the bucket has object retention enabled. + Retention retention = 30 [(google.api.field_behavior) = OPTIONAL]; +} + +// An access-control entry. +message ObjectAccessControl { + // Optional. The access permission for the entity. One of the following + // values: + // * `READER` + // * `WRITER` + // * `OWNER` + string role = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID of the access-control entry. + string id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The entity holding the permission, in one of the following forms: + // * `user-{userid}` + // * `user-{email}` + // * `group-{groupid}` + // * `group-{email}` + // * `domain-{domain}` + // * `project-{team}-{projectnumber}` + // * `project-{team}-{projectid}` + // * `allUsers` + // * `allAuthenticatedUsers` + // Examples: + // * The user `liz@example.com` would be `user-liz@example.com`. + // * The group `example@googlegroups.com` would be + // `group-example@googlegroups.com`. + // * All members of the Google Apps for Business domain `example.com` would be + // `domain-example.com`. + // For project entities, `project-{team}-{projectnumber}` format is + // returned in the response. + string entity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The alternative entity format, if exists. For project + // entities, `project-{team}-{projectid}` format is returned in the response. + string entity_alt = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The ID for the entity, if any. + string entity_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The etag of the ObjectAccessControl. + // If included in the metadata of an update or delete request message, the + // operation is only performed if the etag matches that of the live + // object's ObjectAccessControl. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The email address associated with the entity, if any. + string email = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The domain associated with the entity, if any. + string domain = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The project team associated with the entity, if any. + ProjectTeam project_team = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// The result of a call to Objects.ListObjects +message ListObjectsResponse { + // The list of items. + repeated Object objects = 1; + + // The list of prefixes of objects matching-but-not-listed up to and including + // the requested delimiter. + repeated string prefixes = 2; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 3; +} + +// Represents the Viewers, Editors, or Owners of a given project. +message ProjectTeam { + // Optional. The project number. + string project_number = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The team. + string team = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The owner of a specific resource. +message Owner { + // Optional. The entity, in the form `user-`*userId*. + string entity = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID for the entity. + string entity_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies a requested range of bytes to download. +message ContentRange { + // The starting offset of the object data. This value is inclusive. + int64 start = 1; + + // The ending offset of the object data. This value is exclusive. + int64 end = 2; + + // The complete length of the object data. + int64 complete_length = 3; +} diff --git a/owl-bot-staging/google-storage-control/protos/protos.d.ts b/owl-bot-staging/google-storage-control/protos/protos.d.ts new file mode 100644 index 00000000000..96eb0898c23 --- /dev/null +++ b/owl-bot-staging/google-storage-control/protos/protos.d.ts @@ -0,0 +1,25952 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 storage. */ + namespace storage { + + /** Namespace control. */ + namespace control { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a StorageControl */ + class StorageControl extends $protobuf.rpc.Service { + + /** + * Constructs a new StorageControl 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 StorageControl 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): StorageControl; + + /** + * Calls CreateFolder. + * @param request CreateFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Folder + */ + public createFolder(request: google.storage.control.v2.ICreateFolderRequest, callback: google.storage.control.v2.StorageControl.CreateFolderCallback): void; + + /** + * Calls CreateFolder. + * @param request CreateFolderRequest message or plain object + * @returns Promise + */ + public createFolder(request: google.storage.control.v2.ICreateFolderRequest): Promise; + + /** + * Calls DeleteFolder. + * @param request DeleteFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFolder(request: google.storage.control.v2.IDeleteFolderRequest, callback: google.storage.control.v2.StorageControl.DeleteFolderCallback): void; + + /** + * Calls DeleteFolder. + * @param request DeleteFolderRequest message or plain object + * @returns Promise + */ + public deleteFolder(request: google.storage.control.v2.IDeleteFolderRequest): Promise; + + /** + * Calls GetFolder. + * @param request GetFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Folder + */ + public getFolder(request: google.storage.control.v2.IGetFolderRequest, callback: google.storage.control.v2.StorageControl.GetFolderCallback): void; + + /** + * Calls GetFolder. + * @param request GetFolderRequest message or plain object + * @returns Promise + */ + public getFolder(request: google.storage.control.v2.IGetFolderRequest): Promise; + + /** + * Calls ListFolders. + * @param request ListFoldersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFoldersResponse + */ + public listFolders(request: google.storage.control.v2.IListFoldersRequest, callback: google.storage.control.v2.StorageControl.ListFoldersCallback): void; + + /** + * Calls ListFolders. + * @param request ListFoldersRequest message or plain object + * @returns Promise + */ + public listFolders(request: google.storage.control.v2.IListFoldersRequest): Promise; + + /** + * Calls RenameFolder. + * @param request RenameFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public renameFolder(request: google.storage.control.v2.IRenameFolderRequest, callback: google.storage.control.v2.StorageControl.RenameFolderCallback): void; + + /** + * Calls RenameFolder. + * @param request RenameFolderRequest message or plain object + * @returns Promise + */ + public renameFolder(request: google.storage.control.v2.IRenameFolderRequest): Promise; + + /** + * Calls DeleteFolderRecursive. + * @param request DeleteFolderRecursiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteFolderRecursive(request: google.storage.control.v2.IDeleteFolderRecursiveRequest, callback: google.storage.control.v2.StorageControl.DeleteFolderRecursiveCallback): void; + + /** + * Calls DeleteFolderRecursive. + * @param request DeleteFolderRecursiveRequest message or plain object + * @returns Promise + */ + public deleteFolderRecursive(request: google.storage.control.v2.IDeleteFolderRecursiveRequest): Promise; + + /** + * Calls GetStorageLayout. + * @param request GetStorageLayoutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StorageLayout + */ + public getStorageLayout(request: google.storage.control.v2.IGetStorageLayoutRequest, callback: google.storage.control.v2.StorageControl.GetStorageLayoutCallback): void; + + /** + * Calls GetStorageLayout. + * @param request GetStorageLayoutRequest message or plain object + * @returns Promise + */ + public getStorageLayout(request: google.storage.control.v2.IGetStorageLayoutRequest): Promise; + + /** + * Calls CreateManagedFolder. + * @param request CreateManagedFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ManagedFolder + */ + public createManagedFolder(request: google.storage.control.v2.ICreateManagedFolderRequest, callback: google.storage.control.v2.StorageControl.CreateManagedFolderCallback): void; + + /** + * Calls CreateManagedFolder. + * @param request CreateManagedFolderRequest message or plain object + * @returns Promise + */ + public createManagedFolder(request: google.storage.control.v2.ICreateManagedFolderRequest): Promise; + + /** + * Calls DeleteManagedFolder. + * @param request DeleteManagedFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteManagedFolder(request: google.storage.control.v2.IDeleteManagedFolderRequest, callback: google.storage.control.v2.StorageControl.DeleteManagedFolderCallback): void; + + /** + * Calls DeleteManagedFolder. + * @param request DeleteManagedFolderRequest message or plain object + * @returns Promise + */ + public deleteManagedFolder(request: google.storage.control.v2.IDeleteManagedFolderRequest): Promise; + + /** + * Calls GetManagedFolder. + * @param request GetManagedFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ManagedFolder + */ + public getManagedFolder(request: google.storage.control.v2.IGetManagedFolderRequest, callback: google.storage.control.v2.StorageControl.GetManagedFolderCallback): void; + + /** + * Calls GetManagedFolder. + * @param request GetManagedFolderRequest message or plain object + * @returns Promise + */ + public getManagedFolder(request: google.storage.control.v2.IGetManagedFolderRequest): Promise; + + /** + * Calls ListManagedFolders. + * @param request ListManagedFoldersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListManagedFoldersResponse + */ + public listManagedFolders(request: google.storage.control.v2.IListManagedFoldersRequest, callback: google.storage.control.v2.StorageControl.ListManagedFoldersCallback): void; + + /** + * Calls ListManagedFolders. + * @param request ListManagedFoldersRequest message or plain object + * @returns Promise + */ + public listManagedFolders(request: google.storage.control.v2.IListManagedFoldersRequest): Promise; + + /** + * Calls CreateAnywhereCache. + * @param request CreateAnywhereCacheRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAnywhereCache(request: google.storage.control.v2.ICreateAnywhereCacheRequest, callback: google.storage.control.v2.StorageControl.CreateAnywhereCacheCallback): void; + + /** + * Calls CreateAnywhereCache. + * @param request CreateAnywhereCacheRequest message or plain object + * @returns Promise + */ + public createAnywhereCache(request: google.storage.control.v2.ICreateAnywhereCacheRequest): Promise; + + /** + * Calls UpdateAnywhereCache. + * @param request UpdateAnywhereCacheRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAnywhereCache(request: google.storage.control.v2.IUpdateAnywhereCacheRequest, callback: google.storage.control.v2.StorageControl.UpdateAnywhereCacheCallback): void; + + /** + * Calls UpdateAnywhereCache. + * @param request UpdateAnywhereCacheRequest message or plain object + * @returns Promise + */ + public updateAnywhereCache(request: google.storage.control.v2.IUpdateAnywhereCacheRequest): Promise; + + /** + * Calls DisableAnywhereCache. + * @param request DisableAnywhereCacheRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnywhereCache + */ + public disableAnywhereCache(request: google.storage.control.v2.IDisableAnywhereCacheRequest, callback: google.storage.control.v2.StorageControl.DisableAnywhereCacheCallback): void; + + /** + * Calls DisableAnywhereCache. + * @param request DisableAnywhereCacheRequest message or plain object + * @returns Promise + */ + public disableAnywhereCache(request: google.storage.control.v2.IDisableAnywhereCacheRequest): Promise; + + /** + * Calls PauseAnywhereCache. + * @param request PauseAnywhereCacheRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnywhereCache + */ + public pauseAnywhereCache(request: google.storage.control.v2.IPauseAnywhereCacheRequest, callback: google.storage.control.v2.StorageControl.PauseAnywhereCacheCallback): void; + + /** + * Calls PauseAnywhereCache. + * @param request PauseAnywhereCacheRequest message or plain object + * @returns Promise + */ + public pauseAnywhereCache(request: google.storage.control.v2.IPauseAnywhereCacheRequest): Promise; + + /** + * Calls ResumeAnywhereCache. + * @param request ResumeAnywhereCacheRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnywhereCache + */ + public resumeAnywhereCache(request: google.storage.control.v2.IResumeAnywhereCacheRequest, callback: google.storage.control.v2.StorageControl.ResumeAnywhereCacheCallback): void; + + /** + * Calls ResumeAnywhereCache. + * @param request ResumeAnywhereCacheRequest message or plain object + * @returns Promise + */ + public resumeAnywhereCache(request: google.storage.control.v2.IResumeAnywhereCacheRequest): Promise; + + /** + * Calls GetAnywhereCache. + * @param request GetAnywhereCacheRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnywhereCache + */ + public getAnywhereCache(request: google.storage.control.v2.IGetAnywhereCacheRequest, callback: google.storage.control.v2.StorageControl.GetAnywhereCacheCallback): void; + + /** + * Calls GetAnywhereCache. + * @param request GetAnywhereCacheRequest message or plain object + * @returns Promise + */ + public getAnywhereCache(request: google.storage.control.v2.IGetAnywhereCacheRequest): Promise; + + /** + * Calls ListAnywhereCaches. + * @param request ListAnywhereCachesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnywhereCachesResponse + */ + public listAnywhereCaches(request: google.storage.control.v2.IListAnywhereCachesRequest, callback: google.storage.control.v2.StorageControl.ListAnywhereCachesCallback): void; + + /** + * Calls ListAnywhereCaches. + * @param request ListAnywhereCachesRequest message or plain object + * @returns Promise + */ + public listAnywhereCaches(request: google.storage.control.v2.IListAnywhereCachesRequest): Promise; + + /** + * Calls GetProjectIntelligenceConfig. + * @param request GetProjectIntelligenceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IntelligenceConfig + */ + public getProjectIntelligenceConfig(request: google.storage.control.v2.IGetProjectIntelligenceConfigRequest, callback: google.storage.control.v2.StorageControl.GetProjectIntelligenceConfigCallback): void; + + /** + * Calls GetProjectIntelligenceConfig. + * @param request GetProjectIntelligenceConfigRequest message or plain object + * @returns Promise + */ + public getProjectIntelligenceConfig(request: google.storage.control.v2.IGetProjectIntelligenceConfigRequest): Promise; + + /** + * Calls UpdateProjectIntelligenceConfig. + * @param request UpdateProjectIntelligenceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IntelligenceConfig + */ + public updateProjectIntelligenceConfig(request: google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, callback: google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfigCallback): void; + + /** + * Calls UpdateProjectIntelligenceConfig. + * @param request UpdateProjectIntelligenceConfigRequest message or plain object + * @returns Promise + */ + public updateProjectIntelligenceConfig(request: google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest): Promise; + + /** + * Calls GetFolderIntelligenceConfig. + * @param request GetFolderIntelligenceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IntelligenceConfig + */ + public getFolderIntelligenceConfig(request: google.storage.control.v2.IGetFolderIntelligenceConfigRequest, callback: google.storage.control.v2.StorageControl.GetFolderIntelligenceConfigCallback): void; + + /** + * Calls GetFolderIntelligenceConfig. + * @param request GetFolderIntelligenceConfigRequest message or plain object + * @returns Promise + */ + public getFolderIntelligenceConfig(request: google.storage.control.v2.IGetFolderIntelligenceConfigRequest): Promise; + + /** + * Calls UpdateFolderIntelligenceConfig. + * @param request UpdateFolderIntelligenceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IntelligenceConfig + */ + public updateFolderIntelligenceConfig(request: google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, callback: google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfigCallback): void; + + /** + * Calls UpdateFolderIntelligenceConfig. + * @param request UpdateFolderIntelligenceConfigRequest message or plain object + * @returns Promise + */ + public updateFolderIntelligenceConfig(request: google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest): Promise; + + /** + * Calls GetOrganizationIntelligenceConfig. + * @param request GetOrganizationIntelligenceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IntelligenceConfig + */ + public getOrganizationIntelligenceConfig(request: google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, callback: google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfigCallback): void; + + /** + * Calls GetOrganizationIntelligenceConfig. + * @param request GetOrganizationIntelligenceConfigRequest message or plain object + * @returns Promise + */ + public getOrganizationIntelligenceConfig(request: google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest): Promise; + + /** + * Calls UpdateOrganizationIntelligenceConfig. + * @param request UpdateOrganizationIntelligenceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IntelligenceConfig + */ + public updateOrganizationIntelligenceConfig(request: google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, callback: google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfigCallback): void; + + /** + * Calls UpdateOrganizationIntelligenceConfig. + * @param request UpdateOrganizationIntelligenceConfigRequest message or plain object + * @returns Promise + */ + public updateOrganizationIntelligenceConfig(request: google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.storage.control.v2.StorageControl.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.storage.control.v2.StorageControl.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.storage.control.v2.StorageControl.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace StorageControl { + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|createFolder}. + * @param error Error, if any + * @param [response] Folder + */ + type CreateFolderCallback = (error: (Error|null), response?: google.storage.control.v2.Folder) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|deleteFolder}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFolderCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getFolder}. + * @param error Error, if any + * @param [response] Folder + */ + type GetFolderCallback = (error: (Error|null), response?: google.storage.control.v2.Folder) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|listFolders}. + * @param error Error, if any + * @param [response] ListFoldersResponse + */ + type ListFoldersCallback = (error: (Error|null), response?: google.storage.control.v2.ListFoldersResponse) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|renameFolder}. + * @param error Error, if any + * @param [response] Operation + */ + type RenameFolderCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|deleteFolderRecursive}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteFolderRecursiveCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getStorageLayout}. + * @param error Error, if any + * @param [response] StorageLayout + */ + type GetStorageLayoutCallback = (error: (Error|null), response?: google.storage.control.v2.StorageLayout) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|createManagedFolder}. + * @param error Error, if any + * @param [response] ManagedFolder + */ + type CreateManagedFolderCallback = (error: (Error|null), response?: google.storage.control.v2.ManagedFolder) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|deleteManagedFolder}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteManagedFolderCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getManagedFolder}. + * @param error Error, if any + * @param [response] ManagedFolder + */ + type GetManagedFolderCallback = (error: (Error|null), response?: google.storage.control.v2.ManagedFolder) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|listManagedFolders}. + * @param error Error, if any + * @param [response] ListManagedFoldersResponse + */ + type ListManagedFoldersCallback = (error: (Error|null), response?: google.storage.control.v2.ListManagedFoldersResponse) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|createAnywhereCache}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAnywhereCacheCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateAnywhereCache}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAnywhereCacheCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|disableAnywhereCache}. + * @param error Error, if any + * @param [response] AnywhereCache + */ + type DisableAnywhereCacheCallback = (error: (Error|null), response?: google.storage.control.v2.AnywhereCache) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|pauseAnywhereCache}. + * @param error Error, if any + * @param [response] AnywhereCache + */ + type PauseAnywhereCacheCallback = (error: (Error|null), response?: google.storage.control.v2.AnywhereCache) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|resumeAnywhereCache}. + * @param error Error, if any + * @param [response] AnywhereCache + */ + type ResumeAnywhereCacheCallback = (error: (Error|null), response?: google.storage.control.v2.AnywhereCache) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getAnywhereCache}. + * @param error Error, if any + * @param [response] AnywhereCache + */ + type GetAnywhereCacheCallback = (error: (Error|null), response?: google.storage.control.v2.AnywhereCache) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|listAnywhereCaches}. + * @param error Error, if any + * @param [response] ListAnywhereCachesResponse + */ + type ListAnywhereCachesCallback = (error: (Error|null), response?: google.storage.control.v2.ListAnywhereCachesResponse) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getProjectIntelligenceConfig}. + * @param error Error, if any + * @param [response] IntelligenceConfig + */ + type GetProjectIntelligenceConfigCallback = (error: (Error|null), response?: google.storage.control.v2.IntelligenceConfig) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateProjectIntelligenceConfig}. + * @param error Error, if any + * @param [response] IntelligenceConfig + */ + type UpdateProjectIntelligenceConfigCallback = (error: (Error|null), response?: google.storage.control.v2.IntelligenceConfig) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getFolderIntelligenceConfig}. + * @param error Error, if any + * @param [response] IntelligenceConfig + */ + type GetFolderIntelligenceConfigCallback = (error: (Error|null), response?: google.storage.control.v2.IntelligenceConfig) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateFolderIntelligenceConfig}. + * @param error Error, if any + * @param [response] IntelligenceConfig + */ + type UpdateFolderIntelligenceConfigCallback = (error: (Error|null), response?: google.storage.control.v2.IntelligenceConfig) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getOrganizationIntelligenceConfig}. + * @param error Error, if any + * @param [response] IntelligenceConfig + */ + type GetOrganizationIntelligenceConfigCallback = (error: (Error|null), response?: google.storage.control.v2.IntelligenceConfig) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateOrganizationIntelligenceConfig}. + * @param error Error, if any + * @param [response] IntelligenceConfig + */ + type UpdateOrganizationIntelligenceConfigCallback = (error: (Error|null), response?: google.storage.control.v2.IntelligenceConfig) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a PendingRenameInfo. */ + interface IPendingRenameInfo { + + /** PendingRenameInfo operation */ + operation?: (string|null); + } + + /** Represents a PendingRenameInfo. */ + class PendingRenameInfo implements IPendingRenameInfo { + + /** + * Constructs a new PendingRenameInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IPendingRenameInfo); + + /** PendingRenameInfo operation. */ + public operation: string; + + /** + * Creates a new PendingRenameInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingRenameInfo instance + */ + public static create(properties?: google.storage.control.v2.IPendingRenameInfo): google.storage.control.v2.PendingRenameInfo; + + /** + * Encodes the specified PendingRenameInfo message. Does not implicitly {@link google.storage.control.v2.PendingRenameInfo.verify|verify} messages. + * @param message PendingRenameInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IPendingRenameInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PendingRenameInfo message, length delimited. Does not implicitly {@link google.storage.control.v2.PendingRenameInfo.verify|verify} messages. + * @param message PendingRenameInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IPendingRenameInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingRenameInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PendingRenameInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.PendingRenameInfo; + + /** + * Decodes a PendingRenameInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PendingRenameInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.PendingRenameInfo; + + /** + * Verifies a PendingRenameInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PendingRenameInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PendingRenameInfo + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.PendingRenameInfo; + + /** + * Creates a plain object from a PendingRenameInfo message. Also converts values to other types if specified. + * @param message PendingRenameInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.PendingRenameInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PendingRenameInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PendingRenameInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Folder. */ + interface IFolder { + + /** Folder name */ + name?: (string|null); + + /** Folder metageneration */ + metageneration?: (number|Long|string|null); + + /** Folder createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Folder updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Folder pendingRenameInfo */ + pendingRenameInfo?: (google.storage.control.v2.IPendingRenameInfo|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IFolder); + + /** Folder name. */ + public name: string; + + /** Folder metageneration. */ + public metageneration: (number|Long|string); + + /** Folder createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Folder updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Folder pendingRenameInfo. */ + public pendingRenameInfo?: (google.storage.control.v2.IPendingRenameInfo|null); + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.storage.control.v2.IFolder): google.storage.control.v2.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.storage.control.v2.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.storage.control.v2.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.Folder; + + /** + * Verifies a Folder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Folder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFolderRequest. */ + interface IGetFolderRequest { + + /** GetFolderRequest name */ + name?: (string|null); + + /** GetFolderRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** GetFolderRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetFolderRequest. */ + class GetFolderRequest implements IGetFolderRequest { + + /** + * Constructs a new GetFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetFolderRequest); + + /** GetFolderRequest name. */ + public name: string; + + /** GetFolderRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** GetFolderRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetFolderRequest): google.storage.control.v2.GetFolderRequest; + + /** + * Encodes the specified GetFolderRequest message. Does not implicitly {@link google.storage.control.v2.GetFolderRequest.verify|verify} messages. + * @param message GetFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetFolderRequest.verify|verify} messages. + * @param message GetFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetFolderRequest; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetFolderRequest; + + /** + * Verifies a GetFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetFolderRequest; + + /** + * Creates a plain object from a GetFolderRequest message. Also converts values to other types if specified. + * @param message GetFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFolderRequest. */ + interface ICreateFolderRequest { + + /** CreateFolderRequest parent */ + parent?: (string|null); + + /** CreateFolderRequest folder */ + folder?: (google.storage.control.v2.IFolder|null); + + /** CreateFolderRequest folderId */ + folderId?: (string|null); + + /** CreateFolderRequest recursive */ + recursive?: (boolean|null); + + /** CreateFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateFolderRequest. */ + class CreateFolderRequest implements ICreateFolderRequest { + + /** + * Constructs a new CreateFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.ICreateFolderRequest); + + /** CreateFolderRequest parent. */ + public parent: string; + + /** CreateFolderRequest folder. */ + public folder?: (google.storage.control.v2.IFolder|null); + + /** CreateFolderRequest folderId. */ + public folderId: string; + + /** CreateFolderRequest recursive. */ + public recursive: boolean; + + /** CreateFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.ICreateFolderRequest): google.storage.control.v2.CreateFolderRequest; + + /** + * Encodes the specified CreateFolderRequest message. Does not implicitly {@link google.storage.control.v2.CreateFolderRequest.verify|verify} messages. + * @param message CreateFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.ICreateFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateFolderRequest.verify|verify} messages. + * @param message CreateFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.ICreateFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.CreateFolderRequest; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.CreateFolderRequest; + + /** + * Verifies a CreateFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.CreateFolderRequest; + + /** + * Creates a plain object from a CreateFolderRequest message. Also converts values to other types if specified. + * @param message CreateFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.CreateFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFolderRequest. */ + interface IDeleteFolderRequest { + + /** DeleteFolderRequest name */ + name?: (string|null); + + /** DeleteFolderRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteFolderRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteFolderRequest. */ + class DeleteFolderRequest implements IDeleteFolderRequest { + + /** + * Constructs a new DeleteFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IDeleteFolderRequest); + + /** DeleteFolderRequest name. */ + public name: string; + + /** DeleteFolderRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteFolderRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.IDeleteFolderRequest): google.storage.control.v2.DeleteFolderRequest; + + /** + * Encodes the specified DeleteFolderRequest message. Does not implicitly {@link google.storage.control.v2.DeleteFolderRequest.verify|verify} messages. + * @param message DeleteFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IDeleteFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteFolderRequest.verify|verify} messages. + * @param message DeleteFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IDeleteFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.DeleteFolderRequest; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.DeleteFolderRequest; + + /** + * Verifies a DeleteFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.DeleteFolderRequest; + + /** + * Creates a plain object from a DeleteFolderRequest message. Also converts values to other types if specified. + * @param message DeleteFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.DeleteFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFoldersRequest. */ + interface IListFoldersRequest { + + /** ListFoldersRequest parent */ + parent?: (string|null); + + /** ListFoldersRequest pageSize */ + pageSize?: (number|null); + + /** ListFoldersRequest pageToken */ + pageToken?: (string|null); + + /** ListFoldersRequest prefix */ + prefix?: (string|null); + + /** ListFoldersRequest delimiter */ + delimiter?: (string|null); + + /** ListFoldersRequest lexicographicStart */ + lexicographicStart?: (string|null); + + /** ListFoldersRequest lexicographicEnd */ + lexicographicEnd?: (string|null); + + /** ListFoldersRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ListFoldersRequest. */ + class ListFoldersRequest implements IListFoldersRequest { + + /** + * Constructs a new ListFoldersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IListFoldersRequest); + + /** ListFoldersRequest parent. */ + public parent: string; + + /** ListFoldersRequest pageSize. */ + public pageSize: number; + + /** ListFoldersRequest pageToken. */ + public pageToken: string; + + /** ListFoldersRequest prefix. */ + public prefix: string; + + /** ListFoldersRequest delimiter. */ + public delimiter: string; + + /** ListFoldersRequest lexicographicStart. */ + public lexicographicStart: string; + + /** ListFoldersRequest lexicographicEnd. */ + public lexicographicEnd: string; + + /** ListFoldersRequest requestId. */ + public requestId: string; + + /** + * Creates a new ListFoldersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFoldersRequest instance + */ + public static create(properties?: google.storage.control.v2.IListFoldersRequest): google.storage.control.v2.ListFoldersRequest; + + /** + * Encodes the specified ListFoldersRequest message. Does not implicitly {@link google.storage.control.v2.ListFoldersRequest.verify|verify} messages. + * @param message ListFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IListFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFoldersRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ListFoldersRequest.verify|verify} messages. + * @param message ListFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IListFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ListFoldersRequest; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ListFoldersRequest; + + /** + * Verifies a ListFoldersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFoldersRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ListFoldersRequest; + + /** + * Creates a plain object from a ListFoldersRequest message. Also converts values to other types if specified. + * @param message ListFoldersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ListFoldersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFoldersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFoldersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFoldersResponse. */ + interface IListFoldersResponse { + + /** ListFoldersResponse folders */ + folders?: (google.storage.control.v2.IFolder[]|null); + + /** ListFoldersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFoldersResponse. */ + class ListFoldersResponse implements IListFoldersResponse { + + /** + * Constructs a new ListFoldersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IListFoldersResponse); + + /** ListFoldersResponse folders. */ + public folders: google.storage.control.v2.IFolder[]; + + /** ListFoldersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFoldersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFoldersResponse instance + */ + public static create(properties?: google.storage.control.v2.IListFoldersResponse): google.storage.control.v2.ListFoldersResponse; + + /** + * Encodes the specified ListFoldersResponse message. Does not implicitly {@link google.storage.control.v2.ListFoldersResponse.verify|verify} messages. + * @param message ListFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IListFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFoldersResponse message, length delimited. Does not implicitly {@link google.storage.control.v2.ListFoldersResponse.verify|verify} messages. + * @param message ListFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IListFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ListFoldersResponse; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ListFoldersResponse; + + /** + * Verifies a ListFoldersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFoldersResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ListFoldersResponse; + + /** + * Creates a plain object from a ListFoldersResponse message. Also converts values to other types if specified. + * @param message ListFoldersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ListFoldersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFoldersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFoldersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RenameFolderRequest. */ + interface IRenameFolderRequest { + + /** RenameFolderRequest name */ + name?: (string|null); + + /** RenameFolderRequest destinationFolderId */ + destinationFolderId?: (string|null); + + /** RenameFolderRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** RenameFolderRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** RenameFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RenameFolderRequest. */ + class RenameFolderRequest implements IRenameFolderRequest { + + /** + * Constructs a new RenameFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IRenameFolderRequest); + + /** RenameFolderRequest name. */ + public name: string; + + /** RenameFolderRequest destinationFolderId. */ + public destinationFolderId: string; + + /** RenameFolderRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** RenameFolderRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** RenameFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new RenameFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RenameFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.IRenameFolderRequest): google.storage.control.v2.RenameFolderRequest; + + /** + * Encodes the specified RenameFolderRequest message. Does not implicitly {@link google.storage.control.v2.RenameFolderRequest.verify|verify} messages. + * @param message RenameFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IRenameFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RenameFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.RenameFolderRequest.verify|verify} messages. + * @param message RenameFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IRenameFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RenameFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RenameFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.RenameFolderRequest; + + /** + * Decodes a RenameFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RenameFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.RenameFolderRequest; + + /** + * Verifies a RenameFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RenameFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RenameFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.RenameFolderRequest; + + /** + * Creates a plain object from a RenameFolderRequest message. Also converts values to other types if specified. + * @param message RenameFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.RenameFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RenameFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RenameFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFolderRecursiveRequest. */ + interface IDeleteFolderRecursiveRequest { + + /** DeleteFolderRecursiveRequest name */ + name?: (string|null); + + /** DeleteFolderRecursiveRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteFolderRecursiveRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteFolderRecursiveRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteFolderRecursiveRequest. */ + class DeleteFolderRecursiveRequest implements IDeleteFolderRecursiveRequest { + + /** + * Constructs a new DeleteFolderRecursiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IDeleteFolderRecursiveRequest); + + /** DeleteFolderRecursiveRequest name. */ + public name: string; + + /** DeleteFolderRecursiveRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteFolderRecursiveRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteFolderRecursiveRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteFolderRecursiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFolderRecursiveRequest instance + */ + public static create(properties?: google.storage.control.v2.IDeleteFolderRecursiveRequest): google.storage.control.v2.DeleteFolderRecursiveRequest; + + /** + * Encodes the specified DeleteFolderRecursiveRequest message. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveRequest.verify|verify} messages. + * @param message DeleteFolderRecursiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IDeleteFolderRecursiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFolderRecursiveRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveRequest.verify|verify} messages. + * @param message DeleteFolderRecursiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IDeleteFolderRecursiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFolderRecursiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFolderRecursiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.DeleteFolderRecursiveRequest; + + /** + * Decodes a DeleteFolderRecursiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFolderRecursiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.DeleteFolderRecursiveRequest; + + /** + * Verifies a DeleteFolderRecursiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFolderRecursiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFolderRecursiveRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.DeleteFolderRecursiveRequest; + + /** + * Creates a plain object from a DeleteFolderRecursiveRequest message. Also converts values to other types if specified. + * @param message DeleteFolderRecursiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.DeleteFolderRecursiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFolderRecursiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFolderRecursiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLongRunningOperationMetadata. */ + interface ICommonLongRunningOperationMetadata { + + /** CommonLongRunningOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CommonLongRunningOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CommonLongRunningOperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CommonLongRunningOperationMetadata type */ + type?: (string|null); + + /** CommonLongRunningOperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** CommonLongRunningOperationMetadata progressPercent */ + progressPercent?: (number|null); + } + + /** Represents a CommonLongRunningOperationMetadata. */ + class CommonLongRunningOperationMetadata implements ICommonLongRunningOperationMetadata { + + /** + * Constructs a new CommonLongRunningOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.ICommonLongRunningOperationMetadata); + + /** CommonLongRunningOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CommonLongRunningOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CommonLongRunningOperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CommonLongRunningOperationMetadata type. */ + public type: string; + + /** CommonLongRunningOperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** CommonLongRunningOperationMetadata progressPercent. */ + public progressPercent: number; + + /** + * Creates a new CommonLongRunningOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLongRunningOperationMetadata instance + */ + public static create(properties?: google.storage.control.v2.ICommonLongRunningOperationMetadata): google.storage.control.v2.CommonLongRunningOperationMetadata; + + /** + * Encodes the specified CommonLongRunningOperationMetadata message. Does not implicitly {@link google.storage.control.v2.CommonLongRunningOperationMetadata.verify|verify} messages. + * @param message CommonLongRunningOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.ICommonLongRunningOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLongRunningOperationMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.CommonLongRunningOperationMetadata.verify|verify} messages. + * @param message CommonLongRunningOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.ICommonLongRunningOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLongRunningOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLongRunningOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.CommonLongRunningOperationMetadata; + + /** + * Decodes a CommonLongRunningOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLongRunningOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.CommonLongRunningOperationMetadata; + + /** + * Verifies a CommonLongRunningOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLongRunningOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLongRunningOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.CommonLongRunningOperationMetadata; + + /** + * Creates a plain object from a CommonLongRunningOperationMetadata message. Also converts values to other types if specified. + * @param message CommonLongRunningOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.CommonLongRunningOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLongRunningOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLongRunningOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RenameFolderMetadata. */ + interface IRenameFolderMetadata { + + /** RenameFolderMetadata commonMetadata */ + commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** RenameFolderMetadata sourceFolderId */ + sourceFolderId?: (string|null); + + /** RenameFolderMetadata destinationFolderId */ + destinationFolderId?: (string|null); + } + + /** Represents a RenameFolderMetadata. */ + class RenameFolderMetadata implements IRenameFolderMetadata { + + /** + * Constructs a new RenameFolderMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IRenameFolderMetadata); + + /** RenameFolderMetadata commonMetadata. */ + public commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** RenameFolderMetadata sourceFolderId. */ + public sourceFolderId: string; + + /** RenameFolderMetadata destinationFolderId. */ + public destinationFolderId: string; + + /** + * Creates a new RenameFolderMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RenameFolderMetadata instance + */ + public static create(properties?: google.storage.control.v2.IRenameFolderMetadata): google.storage.control.v2.RenameFolderMetadata; + + /** + * Encodes the specified RenameFolderMetadata message. Does not implicitly {@link google.storage.control.v2.RenameFolderMetadata.verify|verify} messages. + * @param message RenameFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IRenameFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RenameFolderMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.RenameFolderMetadata.verify|verify} messages. + * @param message RenameFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IRenameFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RenameFolderMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RenameFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.RenameFolderMetadata; + + /** + * Decodes a RenameFolderMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RenameFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.RenameFolderMetadata; + + /** + * Verifies a RenameFolderMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RenameFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RenameFolderMetadata + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.RenameFolderMetadata; + + /** + * Creates a plain object from a RenameFolderMetadata message. Also converts values to other types if specified. + * @param message RenameFolderMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.RenameFolderMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RenameFolderMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RenameFolderMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFolderRecursiveMetadata. */ + interface IDeleteFolderRecursiveMetadata { + + /** DeleteFolderRecursiveMetadata commonMetadata */ + commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** DeleteFolderRecursiveMetadata folderId */ + folderId?: (string|null); + } + + /** Represents a DeleteFolderRecursiveMetadata. */ + class DeleteFolderRecursiveMetadata implements IDeleteFolderRecursiveMetadata { + + /** + * Constructs a new DeleteFolderRecursiveMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IDeleteFolderRecursiveMetadata); + + /** DeleteFolderRecursiveMetadata commonMetadata. */ + public commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** DeleteFolderRecursiveMetadata folderId. */ + public folderId: string; + + /** + * Creates a new DeleteFolderRecursiveMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFolderRecursiveMetadata instance + */ + public static create(properties?: google.storage.control.v2.IDeleteFolderRecursiveMetadata): google.storage.control.v2.DeleteFolderRecursiveMetadata; + + /** + * Encodes the specified DeleteFolderRecursiveMetadata message. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveMetadata.verify|verify} messages. + * @param message DeleteFolderRecursiveMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IDeleteFolderRecursiveMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFolderRecursiveMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveMetadata.verify|verify} messages. + * @param message DeleteFolderRecursiveMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IDeleteFolderRecursiveMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFolderRecursiveMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFolderRecursiveMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.DeleteFolderRecursiveMetadata; + + /** + * Decodes a DeleteFolderRecursiveMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFolderRecursiveMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.DeleteFolderRecursiveMetadata; + + /** + * Verifies a DeleteFolderRecursiveMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFolderRecursiveMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFolderRecursiveMetadata + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.DeleteFolderRecursiveMetadata; + + /** + * Creates a plain object from a DeleteFolderRecursiveMetadata message. Also converts values to other types if specified. + * @param message DeleteFolderRecursiveMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.DeleteFolderRecursiveMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFolderRecursiveMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFolderRecursiveMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StorageLayout. */ + interface IStorageLayout { + + /** StorageLayout name */ + name?: (string|null); + + /** StorageLayout location */ + location?: (string|null); + + /** StorageLayout locationType */ + locationType?: (string|null); + + /** StorageLayout customPlacementConfig */ + customPlacementConfig?: (google.storage.control.v2.StorageLayout.ICustomPlacementConfig|null); + + /** StorageLayout hierarchicalNamespace */ + hierarchicalNamespace?: (google.storage.control.v2.StorageLayout.IHierarchicalNamespace|null); + } + + /** Represents a StorageLayout. */ + class StorageLayout implements IStorageLayout { + + /** + * Constructs a new StorageLayout. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IStorageLayout); + + /** StorageLayout name. */ + public name: string; + + /** StorageLayout location. */ + public location: string; + + /** StorageLayout locationType. */ + public locationType: string; + + /** StorageLayout customPlacementConfig. */ + public customPlacementConfig?: (google.storage.control.v2.StorageLayout.ICustomPlacementConfig|null); + + /** StorageLayout hierarchicalNamespace. */ + public hierarchicalNamespace?: (google.storage.control.v2.StorageLayout.IHierarchicalNamespace|null); + + /** + * Creates a new StorageLayout instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageLayout instance + */ + public static create(properties?: google.storage.control.v2.IStorageLayout): google.storage.control.v2.StorageLayout; + + /** + * Encodes the specified StorageLayout message. Does not implicitly {@link google.storage.control.v2.StorageLayout.verify|verify} messages. + * @param message StorageLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IStorageLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageLayout message, length delimited. Does not implicitly {@link google.storage.control.v2.StorageLayout.verify|verify} messages. + * @param message StorageLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IStorageLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageLayout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.StorageLayout; + + /** + * Decodes a StorageLayout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.StorageLayout; + + /** + * Verifies a StorageLayout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StorageLayout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageLayout + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.StorageLayout; + + /** + * Creates a plain object from a StorageLayout message. Also converts values to other types if specified. + * @param message StorageLayout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.StorageLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageLayout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageLayout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StorageLayout { + + /** Properties of a CustomPlacementConfig. */ + interface ICustomPlacementConfig { + + /** CustomPlacementConfig dataLocations */ + dataLocations?: (string[]|null); + } + + /** Represents a CustomPlacementConfig. */ + class CustomPlacementConfig implements ICustomPlacementConfig { + + /** + * Constructs a new CustomPlacementConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.StorageLayout.ICustomPlacementConfig); + + /** CustomPlacementConfig dataLocations. */ + public dataLocations: string[]; + + /** + * Creates a new CustomPlacementConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomPlacementConfig instance + */ + public static create(properties?: google.storage.control.v2.StorageLayout.ICustomPlacementConfig): google.storage.control.v2.StorageLayout.CustomPlacementConfig; + + /** + * Encodes the specified CustomPlacementConfig message. Does not implicitly {@link google.storage.control.v2.StorageLayout.CustomPlacementConfig.verify|verify} messages. + * @param message CustomPlacementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.StorageLayout.ICustomPlacementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomPlacementConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.StorageLayout.CustomPlacementConfig.verify|verify} messages. + * @param message CustomPlacementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.StorageLayout.ICustomPlacementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.StorageLayout.CustomPlacementConfig; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.StorageLayout.CustomPlacementConfig; + + /** + * Verifies a CustomPlacementConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomPlacementConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomPlacementConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.StorageLayout.CustomPlacementConfig; + + /** + * Creates a plain object from a CustomPlacementConfig message. Also converts values to other types if specified. + * @param message CustomPlacementConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.StorageLayout.CustomPlacementConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomPlacementConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomPlacementConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HierarchicalNamespace. */ + interface IHierarchicalNamespace { + + /** HierarchicalNamespace enabled */ + enabled?: (boolean|null); + } + + /** Represents a HierarchicalNamespace. */ + class HierarchicalNamespace implements IHierarchicalNamespace { + + /** + * Constructs a new HierarchicalNamespace. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.StorageLayout.IHierarchicalNamespace); + + /** HierarchicalNamespace enabled. */ + public enabled: boolean; + + /** + * Creates a new HierarchicalNamespace instance using the specified properties. + * @param [properties] Properties to set + * @returns HierarchicalNamespace instance + */ + public static create(properties?: google.storage.control.v2.StorageLayout.IHierarchicalNamespace): google.storage.control.v2.StorageLayout.HierarchicalNamespace; + + /** + * Encodes the specified HierarchicalNamespace message. Does not implicitly {@link google.storage.control.v2.StorageLayout.HierarchicalNamespace.verify|verify} messages. + * @param message HierarchicalNamespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.StorageLayout.IHierarchicalNamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HierarchicalNamespace message, length delimited. Does not implicitly {@link google.storage.control.v2.StorageLayout.HierarchicalNamespace.verify|verify} messages. + * @param message HierarchicalNamespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.StorageLayout.IHierarchicalNamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.StorageLayout.HierarchicalNamespace; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.StorageLayout.HierarchicalNamespace; + + /** + * Verifies a HierarchicalNamespace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HierarchicalNamespace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HierarchicalNamespace + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.StorageLayout.HierarchicalNamespace; + + /** + * Creates a plain object from a HierarchicalNamespace message. Also converts values to other types if specified. + * @param message HierarchicalNamespace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.StorageLayout.HierarchicalNamespace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HierarchicalNamespace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HierarchicalNamespace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetStorageLayoutRequest. */ + interface IGetStorageLayoutRequest { + + /** GetStorageLayoutRequest name */ + name?: (string|null); + + /** GetStorageLayoutRequest prefix */ + prefix?: (string|null); + + /** GetStorageLayoutRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetStorageLayoutRequest. */ + class GetStorageLayoutRequest implements IGetStorageLayoutRequest { + + /** + * Constructs a new GetStorageLayoutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetStorageLayoutRequest); + + /** GetStorageLayoutRequest name. */ + public name: string; + + /** GetStorageLayoutRequest prefix. */ + public prefix: string; + + /** GetStorageLayoutRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetStorageLayoutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStorageLayoutRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetStorageLayoutRequest): google.storage.control.v2.GetStorageLayoutRequest; + + /** + * Encodes the specified GetStorageLayoutRequest message. Does not implicitly {@link google.storage.control.v2.GetStorageLayoutRequest.verify|verify} messages. + * @param message GetStorageLayoutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetStorageLayoutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStorageLayoutRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetStorageLayoutRequest.verify|verify} messages. + * @param message GetStorageLayoutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetStorageLayoutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStorageLayoutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStorageLayoutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetStorageLayoutRequest; + + /** + * Decodes a GetStorageLayoutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStorageLayoutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetStorageLayoutRequest; + + /** + * Verifies a GetStorageLayoutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStorageLayoutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStorageLayoutRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetStorageLayoutRequest; + + /** + * Creates a plain object from a GetStorageLayoutRequest message. Also converts values to other types if specified. + * @param message GetStorageLayoutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetStorageLayoutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStorageLayoutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStorageLayoutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagedFolder. */ + interface IManagedFolder { + + /** ManagedFolder name */ + name?: (string|null); + + /** ManagedFolder metageneration */ + metageneration?: (number|Long|string|null); + + /** ManagedFolder createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ManagedFolder updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ManagedFolder. */ + class ManagedFolder implements IManagedFolder { + + /** + * Constructs a new ManagedFolder. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IManagedFolder); + + /** ManagedFolder name. */ + public name: string; + + /** ManagedFolder metageneration. */ + public metageneration: (number|Long|string); + + /** ManagedFolder createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ManagedFolder updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ManagedFolder instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedFolder instance + */ + public static create(properties?: google.storage.control.v2.IManagedFolder): google.storage.control.v2.ManagedFolder; + + /** + * Encodes the specified ManagedFolder message. Does not implicitly {@link google.storage.control.v2.ManagedFolder.verify|verify} messages. + * @param message ManagedFolder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IManagedFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedFolder message, length delimited. Does not implicitly {@link google.storage.control.v2.ManagedFolder.verify|verify} messages. + * @param message ManagedFolder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IManagedFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedFolder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedFolder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ManagedFolder; + + /** + * Decodes a ManagedFolder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedFolder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ManagedFolder; + + /** + * Verifies a ManagedFolder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedFolder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedFolder + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ManagedFolder; + + /** + * Creates a plain object from a ManagedFolder message. Also converts values to other types if specified. + * @param message ManagedFolder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ManagedFolder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedFolder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagedFolder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetManagedFolderRequest. */ + interface IGetManagedFolderRequest { + + /** GetManagedFolderRequest name */ + name?: (string|null); + + /** GetManagedFolderRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** GetManagedFolderRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetManagedFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetManagedFolderRequest. */ + class GetManagedFolderRequest implements IGetManagedFolderRequest { + + /** + * Constructs a new GetManagedFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetManagedFolderRequest); + + /** GetManagedFolderRequest name. */ + public name: string; + + /** GetManagedFolderRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** GetManagedFolderRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetManagedFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetManagedFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetManagedFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetManagedFolderRequest): google.storage.control.v2.GetManagedFolderRequest; + + /** + * Encodes the specified GetManagedFolderRequest message. Does not implicitly {@link google.storage.control.v2.GetManagedFolderRequest.verify|verify} messages. + * @param message GetManagedFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetManagedFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetManagedFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetManagedFolderRequest.verify|verify} messages. + * @param message GetManagedFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetManagedFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetManagedFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetManagedFolderRequest; + + /** + * Decodes a GetManagedFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetManagedFolderRequest; + + /** + * Verifies a GetManagedFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetManagedFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetManagedFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetManagedFolderRequest; + + /** + * Creates a plain object from a GetManagedFolderRequest message. Also converts values to other types if specified. + * @param message GetManagedFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetManagedFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetManagedFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetManagedFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateManagedFolderRequest. */ + interface ICreateManagedFolderRequest { + + /** CreateManagedFolderRequest parent */ + parent?: (string|null); + + /** CreateManagedFolderRequest managedFolder */ + managedFolder?: (google.storage.control.v2.IManagedFolder|null); + + /** CreateManagedFolderRequest managedFolderId */ + managedFolderId?: (string|null); + + /** CreateManagedFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateManagedFolderRequest. */ + class CreateManagedFolderRequest implements ICreateManagedFolderRequest { + + /** + * Constructs a new CreateManagedFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.ICreateManagedFolderRequest); + + /** CreateManagedFolderRequest parent. */ + public parent: string; + + /** CreateManagedFolderRequest managedFolder. */ + public managedFolder?: (google.storage.control.v2.IManagedFolder|null); + + /** CreateManagedFolderRequest managedFolderId. */ + public managedFolderId: string; + + /** CreateManagedFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateManagedFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateManagedFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.ICreateManagedFolderRequest): google.storage.control.v2.CreateManagedFolderRequest; + + /** + * Encodes the specified CreateManagedFolderRequest message. Does not implicitly {@link google.storage.control.v2.CreateManagedFolderRequest.verify|verify} messages. + * @param message CreateManagedFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.ICreateManagedFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateManagedFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateManagedFolderRequest.verify|verify} messages. + * @param message CreateManagedFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.ICreateManagedFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateManagedFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.CreateManagedFolderRequest; + + /** + * Decodes a CreateManagedFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.CreateManagedFolderRequest; + + /** + * Verifies a CreateManagedFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateManagedFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateManagedFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.CreateManagedFolderRequest; + + /** + * Creates a plain object from a CreateManagedFolderRequest message. Also converts values to other types if specified. + * @param message CreateManagedFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.CreateManagedFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateManagedFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateManagedFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteManagedFolderRequest. */ + interface IDeleteManagedFolderRequest { + + /** DeleteManagedFolderRequest name */ + name?: (string|null); + + /** DeleteManagedFolderRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteManagedFolderRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteManagedFolderRequest allowNonEmpty */ + allowNonEmpty?: (boolean|null); + + /** DeleteManagedFolderRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteManagedFolderRequest. */ + class DeleteManagedFolderRequest implements IDeleteManagedFolderRequest { + + /** + * Constructs a new DeleteManagedFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IDeleteManagedFolderRequest); + + /** DeleteManagedFolderRequest name. */ + public name: string; + + /** DeleteManagedFolderRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteManagedFolderRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteManagedFolderRequest allowNonEmpty. */ + public allowNonEmpty: boolean; + + /** DeleteManagedFolderRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteManagedFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteManagedFolderRequest instance + */ + public static create(properties?: google.storage.control.v2.IDeleteManagedFolderRequest): google.storage.control.v2.DeleteManagedFolderRequest; + + /** + * Encodes the specified DeleteManagedFolderRequest message. Does not implicitly {@link google.storage.control.v2.DeleteManagedFolderRequest.verify|verify} messages. + * @param message DeleteManagedFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IDeleteManagedFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteManagedFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteManagedFolderRequest.verify|verify} messages. + * @param message DeleteManagedFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IDeleteManagedFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteManagedFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.DeleteManagedFolderRequest; + + /** + * Decodes a DeleteManagedFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.DeleteManagedFolderRequest; + + /** + * Verifies a DeleteManagedFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteManagedFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteManagedFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.DeleteManagedFolderRequest; + + /** + * Creates a plain object from a DeleteManagedFolderRequest message. Also converts values to other types if specified. + * @param message DeleteManagedFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.DeleteManagedFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteManagedFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteManagedFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListManagedFoldersRequest. */ + interface IListManagedFoldersRequest { + + /** ListManagedFoldersRequest parent */ + parent?: (string|null); + + /** ListManagedFoldersRequest pageSize */ + pageSize?: (number|null); + + /** ListManagedFoldersRequest pageToken */ + pageToken?: (string|null); + + /** ListManagedFoldersRequest prefix */ + prefix?: (string|null); + + /** ListManagedFoldersRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ListManagedFoldersRequest. */ + class ListManagedFoldersRequest implements IListManagedFoldersRequest { + + /** + * Constructs a new ListManagedFoldersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IListManagedFoldersRequest); + + /** ListManagedFoldersRequest parent. */ + public parent: string; + + /** ListManagedFoldersRequest pageSize. */ + public pageSize: number; + + /** ListManagedFoldersRequest pageToken. */ + public pageToken: string; + + /** ListManagedFoldersRequest prefix. */ + public prefix: string; + + /** ListManagedFoldersRequest requestId. */ + public requestId: string; + + /** + * Creates a new ListManagedFoldersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagedFoldersRequest instance + */ + public static create(properties?: google.storage.control.v2.IListManagedFoldersRequest): google.storage.control.v2.ListManagedFoldersRequest; + + /** + * Encodes the specified ListManagedFoldersRequest message. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersRequest.verify|verify} messages. + * @param message ListManagedFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IListManagedFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagedFoldersRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersRequest.verify|verify} messages. + * @param message ListManagedFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IListManagedFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagedFoldersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagedFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ListManagedFoldersRequest; + + /** + * Decodes a ListManagedFoldersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagedFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ListManagedFoldersRequest; + + /** + * Verifies a ListManagedFoldersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagedFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagedFoldersRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ListManagedFoldersRequest; + + /** + * Creates a plain object from a ListManagedFoldersRequest message. Also converts values to other types if specified. + * @param message ListManagedFoldersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ListManagedFoldersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagedFoldersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagedFoldersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListManagedFoldersResponse. */ + interface IListManagedFoldersResponse { + + /** ListManagedFoldersResponse managedFolders */ + managedFolders?: (google.storage.control.v2.IManagedFolder[]|null); + + /** ListManagedFoldersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListManagedFoldersResponse. */ + class ListManagedFoldersResponse implements IListManagedFoldersResponse { + + /** + * Constructs a new ListManagedFoldersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IListManagedFoldersResponse); + + /** ListManagedFoldersResponse managedFolders. */ + public managedFolders: google.storage.control.v2.IManagedFolder[]; + + /** ListManagedFoldersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListManagedFoldersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagedFoldersResponse instance + */ + public static create(properties?: google.storage.control.v2.IListManagedFoldersResponse): google.storage.control.v2.ListManagedFoldersResponse; + + /** + * Encodes the specified ListManagedFoldersResponse message. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersResponse.verify|verify} messages. + * @param message ListManagedFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IListManagedFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagedFoldersResponse message, length delimited. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersResponse.verify|verify} messages. + * @param message ListManagedFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IListManagedFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagedFoldersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagedFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ListManagedFoldersResponse; + + /** + * Decodes a ListManagedFoldersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagedFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ListManagedFoldersResponse; + + /** + * Verifies a ListManagedFoldersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagedFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagedFoldersResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ListManagedFoldersResponse; + + /** + * Creates a plain object from a ListManagedFoldersResponse message. Also converts values to other types if specified. + * @param message ListManagedFoldersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ListManagedFoldersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagedFoldersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagedFoldersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAnywhereCacheMetadata. */ + interface ICreateAnywhereCacheMetadata { + + /** CreateAnywhereCacheMetadata commonMetadata */ + commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** CreateAnywhereCacheMetadata anywhereCacheId */ + anywhereCacheId?: (string|null); + + /** CreateAnywhereCacheMetadata zone */ + zone?: (string|null); + + /** CreateAnywhereCacheMetadata ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** CreateAnywhereCacheMetadata admissionPolicy */ + admissionPolicy?: (string|null); + } + + /** Represents a CreateAnywhereCacheMetadata. */ + class CreateAnywhereCacheMetadata implements ICreateAnywhereCacheMetadata { + + /** + * Constructs a new CreateAnywhereCacheMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.ICreateAnywhereCacheMetadata); + + /** CreateAnywhereCacheMetadata commonMetadata. */ + public commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** CreateAnywhereCacheMetadata anywhereCacheId. */ + public anywhereCacheId?: (string|null); + + /** CreateAnywhereCacheMetadata zone. */ + public zone?: (string|null); + + /** CreateAnywhereCacheMetadata ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** CreateAnywhereCacheMetadata admissionPolicy. */ + public admissionPolicy?: (string|null); + + /** + * Creates a new CreateAnywhereCacheMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnywhereCacheMetadata instance + */ + public static create(properties?: google.storage.control.v2.ICreateAnywhereCacheMetadata): google.storage.control.v2.CreateAnywhereCacheMetadata; + + /** + * Encodes the specified CreateAnywhereCacheMetadata message. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheMetadata.verify|verify} messages. + * @param message CreateAnywhereCacheMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.ICreateAnywhereCacheMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnywhereCacheMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheMetadata.verify|verify} messages. + * @param message CreateAnywhereCacheMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.ICreateAnywhereCacheMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnywhereCacheMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.CreateAnywhereCacheMetadata; + + /** + * Decodes a CreateAnywhereCacheMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.CreateAnywhereCacheMetadata; + + /** + * Verifies a CreateAnywhereCacheMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnywhereCacheMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnywhereCacheMetadata + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.CreateAnywhereCacheMetadata; + + /** + * Creates a plain object from a CreateAnywhereCacheMetadata message. Also converts values to other types if specified. + * @param message CreateAnywhereCacheMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.CreateAnywhereCacheMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnywhereCacheMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnywhereCacheMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAnywhereCacheMetadata. */ + interface IUpdateAnywhereCacheMetadata { + + /** UpdateAnywhereCacheMetadata commonMetadata */ + commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** UpdateAnywhereCacheMetadata anywhereCacheId */ + anywhereCacheId?: (string|null); + + /** UpdateAnywhereCacheMetadata zone */ + zone?: (string|null); + + /** UpdateAnywhereCacheMetadata ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** UpdateAnywhereCacheMetadata admissionPolicy */ + admissionPolicy?: (string|null); + } + + /** Represents an UpdateAnywhereCacheMetadata. */ + class UpdateAnywhereCacheMetadata implements IUpdateAnywhereCacheMetadata { + + /** + * Constructs a new UpdateAnywhereCacheMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IUpdateAnywhereCacheMetadata); + + /** UpdateAnywhereCacheMetadata commonMetadata. */ + public commonMetadata?: (google.storage.control.v2.ICommonLongRunningOperationMetadata|null); + + /** UpdateAnywhereCacheMetadata anywhereCacheId. */ + public anywhereCacheId?: (string|null); + + /** UpdateAnywhereCacheMetadata zone. */ + public zone?: (string|null); + + /** UpdateAnywhereCacheMetadata ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** UpdateAnywhereCacheMetadata admissionPolicy. */ + public admissionPolicy?: (string|null); + + /** + * Creates a new UpdateAnywhereCacheMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAnywhereCacheMetadata instance + */ + public static create(properties?: google.storage.control.v2.IUpdateAnywhereCacheMetadata): google.storage.control.v2.UpdateAnywhereCacheMetadata; + + /** + * Encodes the specified UpdateAnywhereCacheMetadata message. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheMetadata.verify|verify} messages. + * @param message UpdateAnywhereCacheMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IUpdateAnywhereCacheMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAnywhereCacheMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheMetadata.verify|verify} messages. + * @param message UpdateAnywhereCacheMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IUpdateAnywhereCacheMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAnywhereCacheMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.UpdateAnywhereCacheMetadata; + + /** + * Decodes an UpdateAnywhereCacheMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.UpdateAnywhereCacheMetadata; + + /** + * Verifies an UpdateAnywhereCacheMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAnywhereCacheMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAnywhereCacheMetadata + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.UpdateAnywhereCacheMetadata; + + /** + * Creates a plain object from an UpdateAnywhereCacheMetadata message. Also converts values to other types if specified. + * @param message UpdateAnywhereCacheMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.UpdateAnywhereCacheMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAnywhereCacheMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAnywhereCacheMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnywhereCache. */ + interface IAnywhereCache { + + /** AnywhereCache name */ + name?: (string|null); + + /** AnywhereCache zone */ + zone?: (string|null); + + /** AnywhereCache ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** AnywhereCache admissionPolicy */ + admissionPolicy?: (string|null); + + /** AnywhereCache state */ + state?: (string|null); + + /** AnywhereCache createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AnywhereCache updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AnywhereCache pendingUpdate */ + pendingUpdate?: (boolean|null); + } + + /** Represents an AnywhereCache. */ + class AnywhereCache implements IAnywhereCache { + + /** + * Constructs a new AnywhereCache. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IAnywhereCache); + + /** AnywhereCache name. */ + public name: string; + + /** AnywhereCache zone. */ + public zone: string; + + /** AnywhereCache ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** AnywhereCache admissionPolicy. */ + public admissionPolicy: string; + + /** AnywhereCache state. */ + public state: string; + + /** AnywhereCache createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AnywhereCache updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AnywhereCache pendingUpdate. */ + public pendingUpdate: boolean; + + /** + * Creates a new AnywhereCache instance using the specified properties. + * @param [properties] Properties to set + * @returns AnywhereCache instance + */ + public static create(properties?: google.storage.control.v2.IAnywhereCache): google.storage.control.v2.AnywhereCache; + + /** + * Encodes the specified AnywhereCache message. Does not implicitly {@link google.storage.control.v2.AnywhereCache.verify|verify} messages. + * @param message AnywhereCache message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IAnywhereCache, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnywhereCache message, length delimited. Does not implicitly {@link google.storage.control.v2.AnywhereCache.verify|verify} messages. + * @param message AnywhereCache message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IAnywhereCache, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnywhereCache message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnywhereCache + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.AnywhereCache; + + /** + * Decodes an AnywhereCache message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnywhereCache + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.AnywhereCache; + + /** + * Verifies an AnywhereCache message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnywhereCache message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnywhereCache + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.AnywhereCache; + + /** + * Creates a plain object from an AnywhereCache message. Also converts values to other types if specified. + * @param message AnywhereCache + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.AnywhereCache, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnywhereCache to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnywhereCache + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAnywhereCacheRequest. */ + interface ICreateAnywhereCacheRequest { + + /** CreateAnywhereCacheRequest parent */ + parent?: (string|null); + + /** CreateAnywhereCacheRequest anywhereCache */ + anywhereCache?: (google.storage.control.v2.IAnywhereCache|null); + + /** CreateAnywhereCacheRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateAnywhereCacheRequest. */ + class CreateAnywhereCacheRequest implements ICreateAnywhereCacheRequest { + + /** + * Constructs a new CreateAnywhereCacheRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.ICreateAnywhereCacheRequest); + + /** CreateAnywhereCacheRequest parent. */ + public parent: string; + + /** CreateAnywhereCacheRequest anywhereCache. */ + public anywhereCache?: (google.storage.control.v2.IAnywhereCache|null); + + /** CreateAnywhereCacheRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateAnywhereCacheRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnywhereCacheRequest instance + */ + public static create(properties?: google.storage.control.v2.ICreateAnywhereCacheRequest): google.storage.control.v2.CreateAnywhereCacheRequest; + + /** + * Encodes the specified CreateAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheRequest.verify|verify} messages. + * @param message CreateAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.ICreateAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheRequest.verify|verify} messages. + * @param message CreateAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.ICreateAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnywhereCacheRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.CreateAnywhereCacheRequest; + + /** + * Decodes a CreateAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.CreateAnywhereCacheRequest; + + /** + * Verifies a CreateAnywhereCacheRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnywhereCacheRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.CreateAnywhereCacheRequest; + + /** + * Creates a plain object from a CreateAnywhereCacheRequest message. Also converts values to other types if specified. + * @param message CreateAnywhereCacheRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.CreateAnywhereCacheRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnywhereCacheRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnywhereCacheRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAnywhereCacheRequest. */ + interface IUpdateAnywhereCacheRequest { + + /** UpdateAnywhereCacheRequest anywhereCache */ + anywhereCache?: (google.storage.control.v2.IAnywhereCache|null); + + /** UpdateAnywhereCacheRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAnywhereCacheRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateAnywhereCacheRequest. */ + class UpdateAnywhereCacheRequest implements IUpdateAnywhereCacheRequest { + + /** + * Constructs a new UpdateAnywhereCacheRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IUpdateAnywhereCacheRequest); + + /** UpdateAnywhereCacheRequest anywhereCache. */ + public anywhereCache?: (google.storage.control.v2.IAnywhereCache|null); + + /** UpdateAnywhereCacheRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAnywhereCacheRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateAnywhereCacheRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAnywhereCacheRequest instance + */ + public static create(properties?: google.storage.control.v2.IUpdateAnywhereCacheRequest): google.storage.control.v2.UpdateAnywhereCacheRequest; + + /** + * Encodes the specified UpdateAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheRequest.verify|verify} messages. + * @param message UpdateAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IUpdateAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheRequest.verify|verify} messages. + * @param message UpdateAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IUpdateAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAnywhereCacheRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.UpdateAnywhereCacheRequest; + + /** + * Decodes an UpdateAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.UpdateAnywhereCacheRequest; + + /** + * Verifies an UpdateAnywhereCacheRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAnywhereCacheRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.UpdateAnywhereCacheRequest; + + /** + * Creates a plain object from an UpdateAnywhereCacheRequest message. Also converts values to other types if specified. + * @param message UpdateAnywhereCacheRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.UpdateAnywhereCacheRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAnywhereCacheRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAnywhereCacheRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableAnywhereCacheRequest. */ + interface IDisableAnywhereCacheRequest { + + /** DisableAnywhereCacheRequest name */ + name?: (string|null); + + /** DisableAnywhereCacheRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DisableAnywhereCacheRequest. */ + class DisableAnywhereCacheRequest implements IDisableAnywhereCacheRequest { + + /** + * Constructs a new DisableAnywhereCacheRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IDisableAnywhereCacheRequest); + + /** DisableAnywhereCacheRequest name. */ + public name: string; + + /** DisableAnywhereCacheRequest requestId. */ + public requestId: string; + + /** + * Creates a new DisableAnywhereCacheRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableAnywhereCacheRequest instance + */ + public static create(properties?: google.storage.control.v2.IDisableAnywhereCacheRequest): google.storage.control.v2.DisableAnywhereCacheRequest; + + /** + * Encodes the specified DisableAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.DisableAnywhereCacheRequest.verify|verify} messages. + * @param message DisableAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IDisableAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DisableAnywhereCacheRequest.verify|verify} messages. + * @param message DisableAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IDisableAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableAnywhereCacheRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.DisableAnywhereCacheRequest; + + /** + * Decodes a DisableAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.DisableAnywhereCacheRequest; + + /** + * Verifies a DisableAnywhereCacheRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableAnywhereCacheRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.DisableAnywhereCacheRequest; + + /** + * Creates a plain object from a DisableAnywhereCacheRequest message. Also converts values to other types if specified. + * @param message DisableAnywhereCacheRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.DisableAnywhereCacheRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableAnywhereCacheRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableAnywhereCacheRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseAnywhereCacheRequest. */ + interface IPauseAnywhereCacheRequest { + + /** PauseAnywhereCacheRequest name */ + name?: (string|null); + + /** PauseAnywhereCacheRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PauseAnywhereCacheRequest. */ + class PauseAnywhereCacheRequest implements IPauseAnywhereCacheRequest { + + /** + * Constructs a new PauseAnywhereCacheRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IPauseAnywhereCacheRequest); + + /** PauseAnywhereCacheRequest name. */ + public name: string; + + /** PauseAnywhereCacheRequest requestId. */ + public requestId: string; + + /** + * Creates a new PauseAnywhereCacheRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseAnywhereCacheRequest instance + */ + public static create(properties?: google.storage.control.v2.IPauseAnywhereCacheRequest): google.storage.control.v2.PauseAnywhereCacheRequest; + + /** + * Encodes the specified PauseAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.PauseAnywhereCacheRequest.verify|verify} messages. + * @param message PauseAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IPauseAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.PauseAnywhereCacheRequest.verify|verify} messages. + * @param message PauseAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IPauseAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseAnywhereCacheRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.PauseAnywhereCacheRequest; + + /** + * Decodes a PauseAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.PauseAnywhereCacheRequest; + + /** + * Verifies a PauseAnywhereCacheRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseAnywhereCacheRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.PauseAnywhereCacheRequest; + + /** + * Creates a plain object from a PauseAnywhereCacheRequest message. Also converts values to other types if specified. + * @param message PauseAnywhereCacheRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.PauseAnywhereCacheRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseAnywhereCacheRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseAnywhereCacheRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeAnywhereCacheRequest. */ + interface IResumeAnywhereCacheRequest { + + /** ResumeAnywhereCacheRequest name */ + name?: (string|null); + + /** ResumeAnywhereCacheRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ResumeAnywhereCacheRequest. */ + class ResumeAnywhereCacheRequest implements IResumeAnywhereCacheRequest { + + /** + * Constructs a new ResumeAnywhereCacheRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IResumeAnywhereCacheRequest); + + /** ResumeAnywhereCacheRequest name. */ + public name: string; + + /** ResumeAnywhereCacheRequest requestId. */ + public requestId: string; + + /** + * Creates a new ResumeAnywhereCacheRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeAnywhereCacheRequest instance + */ + public static create(properties?: google.storage.control.v2.IResumeAnywhereCacheRequest): google.storage.control.v2.ResumeAnywhereCacheRequest; + + /** + * Encodes the specified ResumeAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.ResumeAnywhereCacheRequest.verify|verify} messages. + * @param message ResumeAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IResumeAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ResumeAnywhereCacheRequest.verify|verify} messages. + * @param message ResumeAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IResumeAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeAnywhereCacheRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ResumeAnywhereCacheRequest; + + /** + * Decodes a ResumeAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ResumeAnywhereCacheRequest; + + /** + * Verifies a ResumeAnywhereCacheRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeAnywhereCacheRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ResumeAnywhereCacheRequest; + + /** + * Creates a plain object from a ResumeAnywhereCacheRequest message. Also converts values to other types if specified. + * @param message ResumeAnywhereCacheRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ResumeAnywhereCacheRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeAnywhereCacheRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeAnywhereCacheRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnywhereCacheRequest. */ + interface IGetAnywhereCacheRequest { + + /** GetAnywhereCacheRequest name */ + name?: (string|null); + + /** GetAnywhereCacheRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetAnywhereCacheRequest. */ + class GetAnywhereCacheRequest implements IGetAnywhereCacheRequest { + + /** + * Constructs a new GetAnywhereCacheRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetAnywhereCacheRequest); + + /** GetAnywhereCacheRequest name. */ + public name: string; + + /** GetAnywhereCacheRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetAnywhereCacheRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnywhereCacheRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetAnywhereCacheRequest): google.storage.control.v2.GetAnywhereCacheRequest; + + /** + * Encodes the specified GetAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.GetAnywhereCacheRequest.verify|verify} messages. + * @param message GetAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetAnywhereCacheRequest.verify|verify} messages. + * @param message GetAnywhereCacheRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetAnywhereCacheRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnywhereCacheRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetAnywhereCacheRequest; + + /** + * Decodes a GetAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetAnywhereCacheRequest; + + /** + * Verifies a GetAnywhereCacheRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnywhereCacheRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetAnywhereCacheRequest; + + /** + * Creates a plain object from a GetAnywhereCacheRequest message. Also converts values to other types if specified. + * @param message GetAnywhereCacheRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetAnywhereCacheRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnywhereCacheRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnywhereCacheRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnywhereCachesRequest. */ + interface IListAnywhereCachesRequest { + + /** ListAnywhereCachesRequest parent */ + parent?: (string|null); + + /** ListAnywhereCachesRequest pageSize */ + pageSize?: (number|null); + + /** ListAnywhereCachesRequest pageToken */ + pageToken?: (string|null); + + /** ListAnywhereCachesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ListAnywhereCachesRequest. */ + class ListAnywhereCachesRequest implements IListAnywhereCachesRequest { + + /** + * Constructs a new ListAnywhereCachesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IListAnywhereCachesRequest); + + /** ListAnywhereCachesRequest parent. */ + public parent: string; + + /** ListAnywhereCachesRequest pageSize. */ + public pageSize: number; + + /** ListAnywhereCachesRequest pageToken. */ + public pageToken: string; + + /** ListAnywhereCachesRequest requestId. */ + public requestId: string; + + /** + * Creates a new ListAnywhereCachesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnywhereCachesRequest instance + */ + public static create(properties?: google.storage.control.v2.IListAnywhereCachesRequest): google.storage.control.v2.ListAnywhereCachesRequest; + + /** + * Encodes the specified ListAnywhereCachesRequest message. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesRequest.verify|verify} messages. + * @param message ListAnywhereCachesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IListAnywhereCachesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnywhereCachesRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesRequest.verify|verify} messages. + * @param message ListAnywhereCachesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IListAnywhereCachesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnywhereCachesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnywhereCachesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ListAnywhereCachesRequest; + + /** + * Decodes a ListAnywhereCachesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnywhereCachesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ListAnywhereCachesRequest; + + /** + * Verifies a ListAnywhereCachesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnywhereCachesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnywhereCachesRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ListAnywhereCachesRequest; + + /** + * Creates a plain object from a ListAnywhereCachesRequest message. Also converts values to other types if specified. + * @param message ListAnywhereCachesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ListAnywhereCachesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnywhereCachesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnywhereCachesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnywhereCachesResponse. */ + interface IListAnywhereCachesResponse { + + /** ListAnywhereCachesResponse anywhereCaches */ + anywhereCaches?: (google.storage.control.v2.IAnywhereCache[]|null); + + /** ListAnywhereCachesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAnywhereCachesResponse. */ + class ListAnywhereCachesResponse implements IListAnywhereCachesResponse { + + /** + * Constructs a new ListAnywhereCachesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IListAnywhereCachesResponse); + + /** ListAnywhereCachesResponse anywhereCaches. */ + public anywhereCaches: google.storage.control.v2.IAnywhereCache[]; + + /** ListAnywhereCachesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAnywhereCachesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnywhereCachesResponse instance + */ + public static create(properties?: google.storage.control.v2.IListAnywhereCachesResponse): google.storage.control.v2.ListAnywhereCachesResponse; + + /** + * Encodes the specified ListAnywhereCachesResponse message. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesResponse.verify|verify} messages. + * @param message ListAnywhereCachesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IListAnywhereCachesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnywhereCachesResponse message, length delimited. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesResponse.verify|verify} messages. + * @param message ListAnywhereCachesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IListAnywhereCachesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnywhereCachesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnywhereCachesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.ListAnywhereCachesResponse; + + /** + * Decodes a ListAnywhereCachesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnywhereCachesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.ListAnywhereCachesResponse; + + /** + * Verifies a ListAnywhereCachesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnywhereCachesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnywhereCachesResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.ListAnywhereCachesResponse; + + /** + * Creates a plain object from a ListAnywhereCachesResponse message. Also converts values to other types if specified. + * @param message ListAnywhereCachesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.ListAnywhereCachesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnywhereCachesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnywhereCachesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntelligenceConfig. */ + interface IIntelligenceConfig { + + /** IntelligenceConfig name */ + name?: (string|null); + + /** IntelligenceConfig editionConfig */ + editionConfig?: (google.storage.control.v2.IntelligenceConfig.EditionConfig|keyof typeof google.storage.control.v2.IntelligenceConfig.EditionConfig|null); + + /** IntelligenceConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** IntelligenceConfig filter */ + filter?: (google.storage.control.v2.IntelligenceConfig.IFilter|null); + + /** IntelligenceConfig effectiveIntelligenceConfig */ + effectiveIntelligenceConfig?: (google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig|null); + + /** IntelligenceConfig trialConfig */ + trialConfig?: (google.storage.control.v2.IntelligenceConfig.ITrialConfig|null); + } + + /** Represents an IntelligenceConfig. */ + class IntelligenceConfig implements IIntelligenceConfig { + + /** + * Constructs a new IntelligenceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IIntelligenceConfig); + + /** IntelligenceConfig name. */ + public name: string; + + /** IntelligenceConfig editionConfig. */ + public editionConfig: (google.storage.control.v2.IntelligenceConfig.EditionConfig|keyof typeof google.storage.control.v2.IntelligenceConfig.EditionConfig); + + /** IntelligenceConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** IntelligenceConfig filter. */ + public filter?: (google.storage.control.v2.IntelligenceConfig.IFilter|null); + + /** IntelligenceConfig effectiveIntelligenceConfig. */ + public effectiveIntelligenceConfig?: (google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig|null); + + /** IntelligenceConfig trialConfig. */ + public trialConfig?: (google.storage.control.v2.IntelligenceConfig.ITrialConfig|null); + + /** + * Creates a new IntelligenceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IntelligenceConfig instance + */ + public static create(properties?: google.storage.control.v2.IIntelligenceConfig): google.storage.control.v2.IntelligenceConfig; + + /** + * Encodes the specified IntelligenceConfig message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.verify|verify} messages. + * @param message IntelligenceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IIntelligenceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntelligenceConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.verify|verify} messages. + * @param message IntelligenceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IIntelligenceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntelligenceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.IntelligenceConfig; + + /** + * Decodes an IntelligenceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.IntelligenceConfig; + + /** + * Verifies an IntelligenceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntelligenceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntelligenceConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.IntelligenceConfig; + + /** + * Creates a plain object from an IntelligenceConfig message. Also converts values to other types if specified. + * @param message IntelligenceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.IntelligenceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntelligenceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntelligenceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntelligenceConfig { + + /** EditionConfig enum. */ + enum EditionConfig { + EDITION_CONFIG_UNSPECIFIED = 0, + INHERIT = 1, + DISABLED = 2, + STANDARD = 3, + TRIAL = 5 + } + + /** Properties of a Filter. */ + interface IFilter { + + /** Filter includedCloudStorageLocations */ + includedCloudStorageLocations?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null); + + /** Filter excludedCloudStorageLocations */ + excludedCloudStorageLocations?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null); + + /** Filter includedCloudStorageBuckets */ + includedCloudStorageBuckets?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null); + + /** Filter excludedCloudStorageBuckets */ + excludedCloudStorageBuckets?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { + + /** + * Constructs a new Filter. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IntelligenceConfig.IFilter); + + /** Filter includedCloudStorageLocations. */ + public includedCloudStorageLocations?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null); + + /** Filter excludedCloudStorageLocations. */ + public excludedCloudStorageLocations?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null); + + /** Filter includedCloudStorageBuckets. */ + public includedCloudStorageBuckets?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null); + + /** Filter excludedCloudStorageBuckets. */ + public excludedCloudStorageBuckets?: (google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null); + + /** Filter cloudStorageLocations. */ + public cloudStorageLocations?: ("includedCloudStorageLocations"|"excludedCloudStorageLocations"); + + /** Filter cloudStorageBuckets. */ + public cloudStorageBuckets?: ("includedCloudStorageBuckets"|"excludedCloudStorageBuckets"); + + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.storage.control.v2.IntelligenceConfig.IFilter): google.storage.control.v2.IntelligenceConfig.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IntelligenceConfig.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IntelligenceConfig.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.IntelligenceConfig.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.IntelligenceConfig.Filter; + + /** + * Verifies a Filter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Filter + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.IntelligenceConfig.Filter; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.IntelligenceConfig.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Filter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Filter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Filter { + + /** Properties of a CloudStorageLocations. */ + interface ICloudStorageLocations { + + /** CloudStorageLocations locations */ + locations?: (string[]|null); + } + + /** Represents a CloudStorageLocations. */ + class CloudStorageLocations implements ICloudStorageLocations { + + /** + * Constructs a new CloudStorageLocations. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations); + + /** CloudStorageLocations locations. */ + public locations: string[]; + + /** + * Creates a new CloudStorageLocations instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageLocations instance + */ + public static create(properties?: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations; + + /** + * Encodes the specified CloudStorageLocations message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify|verify} messages. + * @param message CloudStorageLocations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageLocations message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify|verify} messages. + * @param message CloudStorageLocations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageLocations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageLocations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations; + + /** + * Decodes a CloudStorageLocations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageLocations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations; + + /** + * Verifies a CloudStorageLocations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorageLocations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageLocations + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations; + + /** + * Creates a plain object from a CloudStorageLocations message. Also converts values to other types if specified. + * @param message CloudStorageLocations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageLocations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageLocations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudStorageBuckets. */ + interface ICloudStorageBuckets { + + /** CloudStorageBuckets bucketIdRegexes */ + bucketIdRegexes?: (string[]|null); + } + + /** Represents a CloudStorageBuckets. */ + class CloudStorageBuckets implements ICloudStorageBuckets { + + /** + * Constructs a new CloudStorageBuckets. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets); + + /** CloudStorageBuckets bucketIdRegexes. */ + public bucketIdRegexes: string[]; + + /** + * Creates a new CloudStorageBuckets instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageBuckets instance + */ + public static create(properties?: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets; + + /** + * Encodes the specified CloudStorageBuckets message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify|verify} messages. + * @param message CloudStorageBuckets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageBuckets message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify|verify} messages. + * @param message CloudStorageBuckets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageBuckets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageBuckets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets; + + /** + * Decodes a CloudStorageBuckets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageBuckets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets; + + /** + * Verifies a CloudStorageBuckets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorageBuckets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageBuckets + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets; + + /** + * Creates a plain object from a CloudStorageBuckets message. Also converts values to other types if specified. + * @param message CloudStorageBuckets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageBuckets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageBuckets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EffectiveIntelligenceConfig. */ + interface IEffectiveIntelligenceConfig { + + /** EffectiveIntelligenceConfig effectiveEdition */ + effectiveEdition?: (google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition|keyof typeof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition|null); + + /** EffectiveIntelligenceConfig intelligenceConfig */ + intelligenceConfig?: (string|null); + } + + /** Represents an EffectiveIntelligenceConfig. */ + class EffectiveIntelligenceConfig implements IEffectiveIntelligenceConfig { + + /** + * Constructs a new EffectiveIntelligenceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig); + + /** EffectiveIntelligenceConfig effectiveEdition. */ + public effectiveEdition: (google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition|keyof typeof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition); + + /** EffectiveIntelligenceConfig intelligenceConfig. */ + public intelligenceConfig: string; + + /** + * Creates a new EffectiveIntelligenceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveIntelligenceConfig instance + */ + public static create(properties?: google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig): google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig; + + /** + * Encodes the specified EffectiveIntelligenceConfig message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.verify|verify} messages. + * @param message EffectiveIntelligenceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EffectiveIntelligenceConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.verify|verify} messages. + * @param message EffectiveIntelligenceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EffectiveIntelligenceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveIntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig; + + /** + * Decodes an EffectiveIntelligenceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveIntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig; + + /** + * Verifies an EffectiveIntelligenceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EffectiveIntelligenceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveIntelligenceConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig; + + /** + * Creates a plain object from an EffectiveIntelligenceConfig message. Also converts values to other types if specified. + * @param message EffectiveIntelligenceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveIntelligenceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EffectiveIntelligenceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EffectiveIntelligenceConfig { + + /** EffectiveEdition enum. */ + enum EffectiveEdition { + EFFECTIVE_EDITION_UNSPECIFIED = 0, + NONE = 1, + STANDARD = 2 + } + } + + /** Properties of a TrialConfig. */ + interface ITrialConfig { + + /** TrialConfig expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TrialConfig. */ + class TrialConfig implements ITrialConfig { + + /** + * Constructs a new TrialConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IntelligenceConfig.ITrialConfig); + + /** TrialConfig expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TrialConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialConfig instance + */ + public static create(properties?: google.storage.control.v2.IntelligenceConfig.ITrialConfig): google.storage.control.v2.IntelligenceConfig.TrialConfig; + + /** + * Encodes the specified TrialConfig message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.TrialConfig.verify|verify} messages. + * @param message TrialConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IntelligenceConfig.ITrialConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.TrialConfig.verify|verify} messages. + * @param message TrialConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IntelligenceConfig.ITrialConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.IntelligenceConfig.TrialConfig; + + /** + * Decodes a TrialConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.IntelligenceConfig.TrialConfig; + + /** + * Verifies a TrialConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.IntelligenceConfig.TrialConfig; + + /** + * Creates a plain object from a TrialConfig message. Also converts values to other types if specified. + * @param message TrialConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.IntelligenceConfig.TrialConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an UpdateOrganizationIntelligenceConfigRequest. */ + interface IUpdateOrganizationIntelligenceConfigRequest { + + /** UpdateOrganizationIntelligenceConfigRequest intelligenceConfig */ + intelligenceConfig?: (google.storage.control.v2.IIntelligenceConfig|null); + + /** UpdateOrganizationIntelligenceConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateOrganizationIntelligenceConfigRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateOrganizationIntelligenceConfigRequest. */ + class UpdateOrganizationIntelligenceConfigRequest implements IUpdateOrganizationIntelligenceConfigRequest { + + /** + * Constructs a new UpdateOrganizationIntelligenceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest); + + /** UpdateOrganizationIntelligenceConfigRequest intelligenceConfig. */ + public intelligenceConfig?: (google.storage.control.v2.IIntelligenceConfig|null); + + /** UpdateOrganizationIntelligenceConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateOrganizationIntelligenceConfigRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateOrganizationIntelligenceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrganizationIntelligenceConfigRequest instance + */ + public static create(properties?: google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest): google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest; + + /** + * Encodes the specified UpdateOrganizationIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @param message UpdateOrganizationIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrganizationIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @param message UpdateOrganizationIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrganizationIntelligenceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest; + + /** + * Decodes an UpdateOrganizationIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest; + + /** + * Verifies an UpdateOrganizationIntelligenceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOrganizationIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrganizationIntelligenceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest; + + /** + * Creates a plain object from an UpdateOrganizationIntelligenceConfigRequest message. Also converts values to other types if specified. + * @param message UpdateOrganizationIntelligenceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrganizationIntelligenceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrganizationIntelligenceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFolderIntelligenceConfigRequest. */ + interface IUpdateFolderIntelligenceConfigRequest { + + /** UpdateFolderIntelligenceConfigRequest intelligenceConfig */ + intelligenceConfig?: (google.storage.control.v2.IIntelligenceConfig|null); + + /** UpdateFolderIntelligenceConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFolderIntelligenceConfigRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateFolderIntelligenceConfigRequest. */ + class UpdateFolderIntelligenceConfigRequest implements IUpdateFolderIntelligenceConfigRequest { + + /** + * Constructs a new UpdateFolderIntelligenceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest); + + /** UpdateFolderIntelligenceConfigRequest intelligenceConfig. */ + public intelligenceConfig?: (google.storage.control.v2.IIntelligenceConfig|null); + + /** UpdateFolderIntelligenceConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFolderIntelligenceConfigRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateFolderIntelligenceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFolderIntelligenceConfigRequest instance + */ + public static create(properties?: google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest): google.storage.control.v2.UpdateFolderIntelligenceConfigRequest; + + /** + * Encodes the specified UpdateFolderIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.verify|verify} messages. + * @param message UpdateFolderIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFolderIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.verify|verify} messages. + * @param message UpdateFolderIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFolderIntelligenceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.UpdateFolderIntelligenceConfigRequest; + + /** + * Decodes an UpdateFolderIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.UpdateFolderIntelligenceConfigRequest; + + /** + * Verifies an UpdateFolderIntelligenceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFolderIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFolderIntelligenceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.UpdateFolderIntelligenceConfigRequest; + + /** + * Creates a plain object from an UpdateFolderIntelligenceConfigRequest message. Also converts values to other types if specified. + * @param message UpdateFolderIntelligenceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.UpdateFolderIntelligenceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFolderIntelligenceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFolderIntelligenceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateProjectIntelligenceConfigRequest. */ + interface IUpdateProjectIntelligenceConfigRequest { + + /** UpdateProjectIntelligenceConfigRequest intelligenceConfig */ + intelligenceConfig?: (google.storage.control.v2.IIntelligenceConfig|null); + + /** UpdateProjectIntelligenceConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateProjectIntelligenceConfigRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateProjectIntelligenceConfigRequest. */ + class UpdateProjectIntelligenceConfigRequest implements IUpdateProjectIntelligenceConfigRequest { + + /** + * Constructs a new UpdateProjectIntelligenceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest); + + /** UpdateProjectIntelligenceConfigRequest intelligenceConfig. */ + public intelligenceConfig?: (google.storage.control.v2.IIntelligenceConfig|null); + + /** UpdateProjectIntelligenceConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateProjectIntelligenceConfigRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateProjectIntelligenceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProjectIntelligenceConfigRequest instance + */ + public static create(properties?: google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest): google.storage.control.v2.UpdateProjectIntelligenceConfigRequest; + + /** + * Encodes the specified UpdateProjectIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.verify|verify} messages. + * @param message UpdateProjectIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProjectIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.verify|verify} messages. + * @param message UpdateProjectIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProjectIntelligenceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.UpdateProjectIntelligenceConfigRequest; + + /** + * Decodes an UpdateProjectIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.UpdateProjectIntelligenceConfigRequest; + + /** + * Verifies an UpdateProjectIntelligenceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateProjectIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProjectIntelligenceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.UpdateProjectIntelligenceConfigRequest; + + /** + * Creates a plain object from an UpdateProjectIntelligenceConfigRequest message. Also converts values to other types if specified. + * @param message UpdateProjectIntelligenceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.UpdateProjectIntelligenceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProjectIntelligenceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProjectIntelligenceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOrganizationIntelligenceConfigRequest. */ + interface IGetOrganizationIntelligenceConfigRequest { + + /** GetOrganizationIntelligenceConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationIntelligenceConfigRequest. */ + class GetOrganizationIntelligenceConfigRequest implements IGetOrganizationIntelligenceConfigRequest { + + /** + * Constructs a new GetOrganizationIntelligenceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest); + + /** GetOrganizationIntelligenceConfigRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationIntelligenceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationIntelligenceConfigRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest): google.storage.control.v2.GetOrganizationIntelligenceConfigRequest; + + /** + * Encodes the specified GetOrganizationIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.GetOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @param message GetOrganizationIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @param message GetOrganizationIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationIntelligenceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetOrganizationIntelligenceConfigRequest; + + /** + * Decodes a GetOrganizationIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetOrganizationIntelligenceConfigRequest; + + /** + * Verifies a GetOrganizationIntelligenceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOrganizationIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationIntelligenceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetOrganizationIntelligenceConfigRequest; + + /** + * Creates a plain object from a GetOrganizationIntelligenceConfigRequest message. Also converts values to other types if specified. + * @param message GetOrganizationIntelligenceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetOrganizationIntelligenceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationIntelligenceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationIntelligenceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFolderIntelligenceConfigRequest. */ + interface IGetFolderIntelligenceConfigRequest { + + /** GetFolderIntelligenceConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetFolderIntelligenceConfigRequest. */ + class GetFolderIntelligenceConfigRequest implements IGetFolderIntelligenceConfigRequest { + + /** + * Constructs a new GetFolderIntelligenceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetFolderIntelligenceConfigRequest); + + /** GetFolderIntelligenceConfigRequest name. */ + public name: string; + + /** + * Creates a new GetFolderIntelligenceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFolderIntelligenceConfigRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetFolderIntelligenceConfigRequest): google.storage.control.v2.GetFolderIntelligenceConfigRequest; + + /** + * Encodes the specified GetFolderIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.GetFolderIntelligenceConfigRequest.verify|verify} messages. + * @param message GetFolderIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetFolderIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFolderIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetFolderIntelligenceConfigRequest.verify|verify} messages. + * @param message GetFolderIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetFolderIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFolderIntelligenceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetFolderIntelligenceConfigRequest; + + /** + * Decodes a GetFolderIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetFolderIntelligenceConfigRequest; + + /** + * Verifies a GetFolderIntelligenceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFolderIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFolderIntelligenceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetFolderIntelligenceConfigRequest; + + /** + * Creates a plain object from a GetFolderIntelligenceConfigRequest message. Also converts values to other types if specified. + * @param message GetFolderIntelligenceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetFolderIntelligenceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFolderIntelligenceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFolderIntelligenceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProjectIntelligenceConfigRequest. */ + interface IGetProjectIntelligenceConfigRequest { + + /** GetProjectIntelligenceConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetProjectIntelligenceConfigRequest. */ + class GetProjectIntelligenceConfigRequest implements IGetProjectIntelligenceConfigRequest { + + /** + * Constructs a new GetProjectIntelligenceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.control.v2.IGetProjectIntelligenceConfigRequest); + + /** GetProjectIntelligenceConfigRequest name. */ + public name: string; + + /** + * Creates a new GetProjectIntelligenceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProjectIntelligenceConfigRequest instance + */ + public static create(properties?: google.storage.control.v2.IGetProjectIntelligenceConfigRequest): google.storage.control.v2.GetProjectIntelligenceConfigRequest; + + /** + * Encodes the specified GetProjectIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.GetProjectIntelligenceConfigRequest.verify|verify} messages. + * @param message GetProjectIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.control.v2.IGetProjectIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProjectIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetProjectIntelligenceConfigRequest.verify|verify} messages. + * @param message GetProjectIntelligenceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.control.v2.IGetProjectIntelligenceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProjectIntelligenceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.control.v2.GetProjectIntelligenceConfigRequest; + + /** + * Decodes a GetProjectIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.control.v2.GetProjectIntelligenceConfigRequest; + + /** + * Verifies a GetProjectIntelligenceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProjectIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProjectIntelligenceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.control.v2.GetProjectIntelligenceConfigRequest; + + /** + * Creates a plain object from a GetProjectIntelligenceConfigRequest message. Also converts values to other types if specified. + * @param message GetProjectIntelligenceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.control.v2.GetProjectIntelligenceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProjectIntelligenceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProjectIntelligenceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace v2. */ + namespace v2 { + + /** Represents a Storage */ + class Storage extends $protobuf.rpc.Service { + + /** + * Constructs a new Storage 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 Storage 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): Storage; + + /** + * Calls DeleteBucket. + * @param request DeleteBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBucket(request: google.storage.v2.IDeleteBucketRequest, callback: google.storage.v2.Storage.DeleteBucketCallback): void; + + /** + * Calls DeleteBucket. + * @param request DeleteBucketRequest message or plain object + * @returns Promise + */ + public deleteBucket(request: google.storage.v2.IDeleteBucketRequest): Promise; + + /** + * Calls GetBucket. + * @param request GetBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bucket + */ + public getBucket(request: google.storage.v2.IGetBucketRequest, callback: google.storage.v2.Storage.GetBucketCallback): void; + + /** + * Calls GetBucket. + * @param request GetBucketRequest message or plain object + * @returns Promise + */ + public getBucket(request: google.storage.v2.IGetBucketRequest): Promise; + + /** + * Calls CreateBucket. + * @param request CreateBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bucket + */ + public createBucket(request: google.storage.v2.ICreateBucketRequest, callback: google.storage.v2.Storage.CreateBucketCallback): void; + + /** + * Calls CreateBucket. + * @param request CreateBucketRequest message or plain object + * @returns Promise + */ + public createBucket(request: google.storage.v2.ICreateBucketRequest): Promise; + + /** + * Calls ListBuckets. + * @param request ListBucketsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBucketsResponse + */ + public listBuckets(request: google.storage.v2.IListBucketsRequest, callback: google.storage.v2.Storage.ListBucketsCallback): void; + + /** + * Calls ListBuckets. + * @param request ListBucketsRequest message or plain object + * @returns Promise + */ + public listBuckets(request: google.storage.v2.IListBucketsRequest): Promise; + + /** + * Calls LockBucketRetentionPolicy. + * @param request LockBucketRetentionPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bucket + */ + public lockBucketRetentionPolicy(request: google.storage.v2.ILockBucketRetentionPolicyRequest, callback: google.storage.v2.Storage.LockBucketRetentionPolicyCallback): void; + + /** + * Calls LockBucketRetentionPolicy. + * @param request LockBucketRetentionPolicyRequest message or plain object + * @returns Promise + */ + public lockBucketRetentionPolicy(request: google.storage.v2.ILockBucketRetentionPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.storage.v2.Storage.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.storage.v2.Storage.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.storage.v2.Storage.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls UpdateBucket. + * @param request UpdateBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bucket + */ + public updateBucket(request: google.storage.v2.IUpdateBucketRequest, callback: google.storage.v2.Storage.UpdateBucketCallback): void; + + /** + * Calls UpdateBucket. + * @param request UpdateBucketRequest message or plain object + * @returns Promise + */ + public updateBucket(request: google.storage.v2.IUpdateBucketRequest): Promise; + + /** + * Calls ComposeObject. + * @param request ComposeObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Object + */ + public composeObject(request: google.storage.v2.IComposeObjectRequest, callback: google.storage.v2.Storage.ComposeObjectCallback): void; + + /** + * Calls ComposeObject. + * @param request ComposeObjectRequest message or plain object + * @returns Promise + */ + public composeObject(request: google.storage.v2.IComposeObjectRequest): Promise; + + /** + * Calls DeleteObject. + * @param request DeleteObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteObject(request: google.storage.v2.IDeleteObjectRequest, callback: google.storage.v2.Storage.DeleteObjectCallback): void; + + /** + * Calls DeleteObject. + * @param request DeleteObjectRequest message or plain object + * @returns Promise + */ + public deleteObject(request: google.storage.v2.IDeleteObjectRequest): Promise; + + /** + * Calls RestoreObject. + * @param request RestoreObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Object + */ + public restoreObject(request: google.storage.v2.IRestoreObjectRequest, callback: google.storage.v2.Storage.RestoreObjectCallback): void; + + /** + * Calls RestoreObject. + * @param request RestoreObjectRequest message or plain object + * @returns Promise + */ + public restoreObject(request: google.storage.v2.IRestoreObjectRequest): Promise; + + /** + * Calls CancelResumableWrite. + * @param request CancelResumableWriteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CancelResumableWriteResponse + */ + public cancelResumableWrite(request: google.storage.v2.ICancelResumableWriteRequest, callback: google.storage.v2.Storage.CancelResumableWriteCallback): void; + + /** + * Calls CancelResumableWrite. + * @param request CancelResumableWriteRequest message or plain object + * @returns Promise + */ + public cancelResumableWrite(request: google.storage.v2.ICancelResumableWriteRequest): Promise; + + /** + * Calls GetObject. + * @param request GetObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Object + */ + public getObject(request: google.storage.v2.IGetObjectRequest, callback: google.storage.v2.Storage.GetObjectCallback): void; + + /** + * Calls GetObject. + * @param request GetObjectRequest message or plain object + * @returns Promise + */ + public getObject(request: google.storage.v2.IGetObjectRequest): Promise; + + /** + * Calls ReadObject. + * @param request ReadObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadObjectResponse + */ + public readObject(request: google.storage.v2.IReadObjectRequest, callback: google.storage.v2.Storage.ReadObjectCallback): void; + + /** + * Calls ReadObject. + * @param request ReadObjectRequest message or plain object + * @returns Promise + */ + public readObject(request: google.storage.v2.IReadObjectRequest): Promise; + + /** + * Calls BidiReadObject. + * @param request BidiReadObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BidiReadObjectResponse + */ + public bidiReadObject(request: google.storage.v2.IBidiReadObjectRequest, callback: google.storage.v2.Storage.BidiReadObjectCallback): void; + + /** + * Calls BidiReadObject. + * @param request BidiReadObjectRequest message or plain object + * @returns Promise + */ + public bidiReadObject(request: google.storage.v2.IBidiReadObjectRequest): Promise; + + /** + * Calls UpdateObject. + * @param request UpdateObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Object + */ + public updateObject(request: google.storage.v2.IUpdateObjectRequest, callback: google.storage.v2.Storage.UpdateObjectCallback): void; + + /** + * Calls UpdateObject. + * @param request UpdateObjectRequest message or plain object + * @returns Promise + */ + public updateObject(request: google.storage.v2.IUpdateObjectRequest): Promise; + + /** + * Calls WriteObject. + * @param request WriteObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WriteObjectResponse + */ + public writeObject(request: google.storage.v2.IWriteObjectRequest, callback: google.storage.v2.Storage.WriteObjectCallback): void; + + /** + * Calls WriteObject. + * @param request WriteObjectRequest message or plain object + * @returns Promise + */ + public writeObject(request: google.storage.v2.IWriteObjectRequest): Promise; + + /** + * Calls BidiWriteObject. + * @param request BidiWriteObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BidiWriteObjectResponse + */ + public bidiWriteObject(request: google.storage.v2.IBidiWriteObjectRequest, callback: google.storage.v2.Storage.BidiWriteObjectCallback): void; + + /** + * Calls BidiWriteObject. + * @param request BidiWriteObjectRequest message or plain object + * @returns Promise + */ + public bidiWriteObject(request: google.storage.v2.IBidiWriteObjectRequest): Promise; + + /** + * Calls ListObjects. + * @param request ListObjectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListObjectsResponse + */ + public listObjects(request: google.storage.v2.IListObjectsRequest, callback: google.storage.v2.Storage.ListObjectsCallback): void; + + /** + * Calls ListObjects. + * @param request ListObjectsRequest message or plain object + * @returns Promise + */ + public listObjects(request: google.storage.v2.IListObjectsRequest): Promise; + + /** + * Calls RewriteObject. + * @param request RewriteObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RewriteResponse + */ + public rewriteObject(request: google.storage.v2.IRewriteObjectRequest, callback: google.storage.v2.Storage.RewriteObjectCallback): void; + + /** + * Calls RewriteObject. + * @param request RewriteObjectRequest message or plain object + * @returns Promise + */ + public rewriteObject(request: google.storage.v2.IRewriteObjectRequest): Promise; + + /** + * Calls StartResumableWrite. + * @param request StartResumableWriteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StartResumableWriteResponse + */ + public startResumableWrite(request: google.storage.v2.IStartResumableWriteRequest, callback: google.storage.v2.Storage.StartResumableWriteCallback): void; + + /** + * Calls StartResumableWrite. + * @param request StartResumableWriteRequest message or plain object + * @returns Promise + */ + public startResumableWrite(request: google.storage.v2.IStartResumableWriteRequest): Promise; + + /** + * Calls QueryWriteStatus. + * @param request QueryWriteStatusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryWriteStatusResponse + */ + public queryWriteStatus(request: google.storage.v2.IQueryWriteStatusRequest, callback: google.storage.v2.Storage.QueryWriteStatusCallback): void; + + /** + * Calls QueryWriteStatus. + * @param request QueryWriteStatusRequest message or plain object + * @returns Promise + */ + public queryWriteStatus(request: google.storage.v2.IQueryWriteStatusRequest): Promise; + + /** + * Calls MoveObject. + * @param request MoveObjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Object + */ + public moveObject(request: google.storage.v2.IMoveObjectRequest, callback: google.storage.v2.Storage.MoveObjectCallback): void; + + /** + * Calls MoveObject. + * @param request MoveObjectRequest message or plain object + * @returns Promise + */ + public moveObject(request: google.storage.v2.IMoveObjectRequest): Promise; + } + + namespace Storage { + + /** + * Callback as used by {@link google.storage.v2.Storage|deleteBucket}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBucketCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|getBucket}. + * @param error Error, if any + * @param [response] Bucket + */ + type GetBucketCallback = (error: (Error|null), response?: google.storage.v2.Bucket) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|createBucket}. + * @param error Error, if any + * @param [response] Bucket + */ + type CreateBucketCallback = (error: (Error|null), response?: google.storage.v2.Bucket) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|listBuckets}. + * @param error Error, if any + * @param [response] ListBucketsResponse + */ + type ListBucketsCallback = (error: (Error|null), response?: google.storage.v2.ListBucketsResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|lockBucketRetentionPolicy}. + * @param error Error, if any + * @param [response] Bucket + */ + type LockBucketRetentionPolicyCallback = (error: (Error|null), response?: google.storage.v2.Bucket) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|updateBucket}. + * @param error Error, if any + * @param [response] Bucket + */ + type UpdateBucketCallback = (error: (Error|null), response?: google.storage.v2.Bucket) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|composeObject}. + * @param error Error, if any + * @param [response] Object + */ + type ComposeObjectCallback = (error: (Error|null), response?: google.storage.v2.object) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|deleteObject}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteObjectCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|restoreObject}. + * @param error Error, if any + * @param [response] Object + */ + type RestoreObjectCallback = (error: (Error|null), response?: google.storage.v2.object) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|cancelResumableWrite}. + * @param error Error, if any + * @param [response] CancelResumableWriteResponse + */ + type CancelResumableWriteCallback = (error: (Error|null), response?: google.storage.v2.CancelResumableWriteResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|getObject}. + * @param error Error, if any + * @param [response] Object + */ + type GetObjectCallback = (error: (Error|null), response?: google.storage.v2.object) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|readObject}. + * @param error Error, if any + * @param [response] ReadObjectResponse + */ + type ReadObjectCallback = (error: (Error|null), response?: google.storage.v2.ReadObjectResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|bidiReadObject}. + * @param error Error, if any + * @param [response] BidiReadObjectResponse + */ + type BidiReadObjectCallback = (error: (Error|null), response?: google.storage.v2.BidiReadObjectResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|updateObject}. + * @param error Error, if any + * @param [response] Object + */ + type UpdateObjectCallback = (error: (Error|null), response?: google.storage.v2.object) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|writeObject}. + * @param error Error, if any + * @param [response] WriteObjectResponse + */ + type WriteObjectCallback = (error: (Error|null), response?: google.storage.v2.WriteObjectResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|bidiWriteObject}. + * @param error Error, if any + * @param [response] BidiWriteObjectResponse + */ + type BidiWriteObjectCallback = (error: (Error|null), response?: google.storage.v2.BidiWriteObjectResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|listObjects}. + * @param error Error, if any + * @param [response] ListObjectsResponse + */ + type ListObjectsCallback = (error: (Error|null), response?: google.storage.v2.ListObjectsResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|rewriteObject}. + * @param error Error, if any + * @param [response] RewriteResponse + */ + type RewriteObjectCallback = (error: (Error|null), response?: google.storage.v2.RewriteResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|startResumableWrite}. + * @param error Error, if any + * @param [response] StartResumableWriteResponse + */ + type StartResumableWriteCallback = (error: (Error|null), response?: google.storage.v2.StartResumableWriteResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|queryWriteStatus}. + * @param error Error, if any + * @param [response] QueryWriteStatusResponse + */ + type QueryWriteStatusCallback = (error: (Error|null), response?: google.storage.v2.QueryWriteStatusResponse) => void; + + /** + * Callback as used by {@link google.storage.v2.Storage|moveObject}. + * @param error Error, if any + * @param [response] Object + */ + type MoveObjectCallback = (error: (Error|null), response?: google.storage.v2.object) => void; + } + + /** Properties of a DeleteBucketRequest. */ + interface IDeleteBucketRequest { + + /** DeleteBucketRequest name */ + name?: (string|null); + + /** DeleteBucketRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteBucketRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + } + + /** Represents a DeleteBucketRequest. */ + class DeleteBucketRequest implements IDeleteBucketRequest { + + /** + * Constructs a new DeleteBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IDeleteBucketRequest); + + /** DeleteBucketRequest name. */ + public name: string; + + /** DeleteBucketRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteBucketRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** + * Creates a new DeleteBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBucketRequest instance + */ + public static create(properties?: google.storage.v2.IDeleteBucketRequest): google.storage.v2.DeleteBucketRequest; + + /** + * Encodes the specified DeleteBucketRequest message. Does not implicitly {@link google.storage.v2.DeleteBucketRequest.verify|verify} messages. + * @param message DeleteBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IDeleteBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.DeleteBucketRequest.verify|verify} messages. + * @param message DeleteBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IDeleteBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.DeleteBucketRequest; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.DeleteBucketRequest; + + /** + * Verifies a DeleteBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.DeleteBucketRequest; + + /** + * Creates a plain object from a DeleteBucketRequest message. Also converts values to other types if specified. + * @param message DeleteBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.DeleteBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBucketRequest. */ + interface IGetBucketRequest { + + /** GetBucketRequest name */ + name?: (string|null); + + /** GetBucketRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** GetBucketRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetBucketRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetBucketRequest. */ + class GetBucketRequest implements IGetBucketRequest { + + /** + * Constructs a new GetBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IGetBucketRequest); + + /** GetBucketRequest name. */ + public name: string; + + /** GetBucketRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** GetBucketRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetBucketRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBucketRequest instance + */ + public static create(properties?: google.storage.v2.IGetBucketRequest): google.storage.v2.GetBucketRequest; + + /** + * Encodes the specified GetBucketRequest message. Does not implicitly {@link google.storage.v2.GetBucketRequest.verify|verify} messages. + * @param message GetBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IGetBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.GetBucketRequest.verify|verify} messages. + * @param message GetBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IGetBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.GetBucketRequest; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.GetBucketRequest; + + /** + * Verifies a GetBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.GetBucketRequest; + + /** + * Creates a plain object from a GetBucketRequest message. Also converts values to other types if specified. + * @param message GetBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.GetBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBucketRequest. */ + interface ICreateBucketRequest { + + /** CreateBucketRequest parent */ + parent?: (string|null); + + /** CreateBucketRequest bucket */ + bucket?: (google.storage.v2.IBucket|null); + + /** CreateBucketRequest bucketId */ + bucketId?: (string|null); + + /** CreateBucketRequest predefinedAcl */ + predefinedAcl?: (string|null); + + /** CreateBucketRequest predefinedDefaultObjectAcl */ + predefinedDefaultObjectAcl?: (string|null); + + /** CreateBucketRequest enableObjectRetention */ + enableObjectRetention?: (boolean|null); + } + + /** Represents a CreateBucketRequest. */ + class CreateBucketRequest implements ICreateBucketRequest { + + /** + * Constructs a new CreateBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ICreateBucketRequest); + + /** CreateBucketRequest parent. */ + public parent: string; + + /** CreateBucketRequest bucket. */ + public bucket?: (google.storage.v2.IBucket|null); + + /** CreateBucketRequest bucketId. */ + public bucketId: string; + + /** CreateBucketRequest predefinedAcl. */ + public predefinedAcl: string; + + /** CreateBucketRequest predefinedDefaultObjectAcl. */ + public predefinedDefaultObjectAcl: string; + + /** CreateBucketRequest enableObjectRetention. */ + public enableObjectRetention: boolean; + + /** + * Creates a new CreateBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBucketRequest instance + */ + public static create(properties?: google.storage.v2.ICreateBucketRequest): google.storage.v2.CreateBucketRequest; + + /** + * Encodes the specified CreateBucketRequest message. Does not implicitly {@link google.storage.v2.CreateBucketRequest.verify|verify} messages. + * @param message CreateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ICreateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.CreateBucketRequest.verify|verify} messages. + * @param message CreateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ICreateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.CreateBucketRequest; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.CreateBucketRequest; + + /** + * Verifies a CreateBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.CreateBucketRequest; + + /** + * Creates a plain object from a CreateBucketRequest message. Also converts values to other types if specified. + * @param message CreateBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.CreateBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBucketsRequest. */ + interface IListBucketsRequest { + + /** ListBucketsRequest parent */ + parent?: (string|null); + + /** ListBucketsRequest pageSize */ + pageSize?: (number|null); + + /** ListBucketsRequest pageToken */ + pageToken?: (string|null); + + /** ListBucketsRequest prefix */ + prefix?: (string|null); + + /** ListBucketsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** ListBucketsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListBucketsRequest. */ + class ListBucketsRequest implements IListBucketsRequest { + + /** + * Constructs a new ListBucketsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IListBucketsRequest); + + /** ListBucketsRequest parent. */ + public parent: string; + + /** ListBucketsRequest pageSize. */ + public pageSize: number; + + /** ListBucketsRequest pageToken. */ + public pageToken: string; + + /** ListBucketsRequest prefix. */ + public prefix: string; + + /** ListBucketsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** ListBucketsRequest returnPartialSuccess. */ + public returnPartialSuccess: boolean; + + /** + * Creates a new ListBucketsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBucketsRequest instance + */ + public static create(properties?: google.storage.v2.IListBucketsRequest): google.storage.v2.ListBucketsRequest; + + /** + * Encodes the specified ListBucketsRequest message. Does not implicitly {@link google.storage.v2.ListBucketsRequest.verify|verify} messages. + * @param message ListBucketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IListBucketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBucketsRequest message, length delimited. Does not implicitly {@link google.storage.v2.ListBucketsRequest.verify|verify} messages. + * @param message ListBucketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IListBucketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ListBucketsRequest; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ListBucketsRequest; + + /** + * Verifies a ListBucketsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBucketsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBucketsRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ListBucketsRequest; + + /** + * Creates a plain object from a ListBucketsRequest message. Also converts values to other types if specified. + * @param message ListBucketsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ListBucketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBucketsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBucketsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBucketsResponse. */ + interface IListBucketsResponse { + + /** ListBucketsResponse buckets */ + buckets?: (google.storage.v2.IBucket[]|null); + + /** ListBucketsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBucketsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBucketsResponse. */ + class ListBucketsResponse implements IListBucketsResponse { + + /** + * Constructs a new ListBucketsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IListBucketsResponse); + + /** ListBucketsResponse buckets. */ + public buckets: google.storage.v2.IBucket[]; + + /** ListBucketsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBucketsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBucketsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBucketsResponse instance + */ + public static create(properties?: google.storage.v2.IListBucketsResponse): google.storage.v2.ListBucketsResponse; + + /** + * Encodes the specified ListBucketsResponse message. Does not implicitly {@link google.storage.v2.ListBucketsResponse.verify|verify} messages. + * @param message ListBucketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IListBucketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBucketsResponse message, length delimited. Does not implicitly {@link google.storage.v2.ListBucketsResponse.verify|verify} messages. + * @param message ListBucketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IListBucketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBucketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ListBucketsResponse; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBucketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ListBucketsResponse; + + /** + * Verifies a ListBucketsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBucketsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBucketsResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ListBucketsResponse; + + /** + * Creates a plain object from a ListBucketsResponse message. Also converts values to other types if specified. + * @param message ListBucketsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ListBucketsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBucketsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBucketsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LockBucketRetentionPolicyRequest. */ + interface ILockBucketRetentionPolicyRequest { + + /** LockBucketRetentionPolicyRequest bucket */ + bucket?: (string|null); + + /** LockBucketRetentionPolicyRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + } + + /** Represents a LockBucketRetentionPolicyRequest. */ + class LockBucketRetentionPolicyRequest implements ILockBucketRetentionPolicyRequest { + + /** + * Constructs a new LockBucketRetentionPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ILockBucketRetentionPolicyRequest); + + /** LockBucketRetentionPolicyRequest bucket. */ + public bucket: string; + + /** LockBucketRetentionPolicyRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch: (number|Long|string); + + /** + * Creates a new LockBucketRetentionPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LockBucketRetentionPolicyRequest instance + */ + public static create(properties?: google.storage.v2.ILockBucketRetentionPolicyRequest): google.storage.v2.LockBucketRetentionPolicyRequest; + + /** + * Encodes the specified LockBucketRetentionPolicyRequest message. Does not implicitly {@link google.storage.v2.LockBucketRetentionPolicyRequest.verify|verify} messages. + * @param message LockBucketRetentionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ILockBucketRetentionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LockBucketRetentionPolicyRequest message, length delimited. Does not implicitly {@link google.storage.v2.LockBucketRetentionPolicyRequest.verify|verify} messages. + * @param message LockBucketRetentionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ILockBucketRetentionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LockBucketRetentionPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LockBucketRetentionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.LockBucketRetentionPolicyRequest; + + /** + * Decodes a LockBucketRetentionPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LockBucketRetentionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.LockBucketRetentionPolicyRequest; + + /** + * Verifies a LockBucketRetentionPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LockBucketRetentionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LockBucketRetentionPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.LockBucketRetentionPolicyRequest; + + /** + * Creates a plain object from a LockBucketRetentionPolicyRequest message. Also converts values to other types if specified. + * @param message LockBucketRetentionPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.LockBucketRetentionPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LockBucketRetentionPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LockBucketRetentionPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBucketRequest. */ + interface IUpdateBucketRequest { + + /** UpdateBucketRequest bucket */ + bucket?: (google.storage.v2.IBucket|null); + + /** UpdateBucketRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** UpdateBucketRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** UpdateBucketRequest predefinedAcl */ + predefinedAcl?: (string|null); + + /** UpdateBucketRequest predefinedDefaultObjectAcl */ + predefinedDefaultObjectAcl?: (string|null); + + /** UpdateBucketRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBucketRequest. */ + class UpdateBucketRequest implements IUpdateBucketRequest { + + /** + * Constructs a new UpdateBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IUpdateBucketRequest); + + /** UpdateBucketRequest bucket. */ + public bucket?: (google.storage.v2.IBucket|null); + + /** UpdateBucketRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** UpdateBucketRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** UpdateBucketRequest predefinedAcl. */ + public predefinedAcl: string; + + /** UpdateBucketRequest predefinedDefaultObjectAcl. */ + public predefinedDefaultObjectAcl: string; + + /** UpdateBucketRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBucketRequest instance + */ + public static create(properties?: google.storage.v2.IUpdateBucketRequest): google.storage.v2.UpdateBucketRequest; + + /** + * Encodes the specified UpdateBucketRequest message. Does not implicitly {@link google.storage.v2.UpdateBucketRequest.verify|verify} messages. + * @param message UpdateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IUpdateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.UpdateBucketRequest.verify|verify} messages. + * @param message UpdateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IUpdateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.UpdateBucketRequest; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.UpdateBucketRequest; + + /** + * Verifies an UpdateBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.UpdateBucketRequest; + + /** + * Creates a plain object from an UpdateBucketRequest message. Also converts values to other types if specified. + * @param message UpdateBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.UpdateBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComposeObjectRequest. */ + interface IComposeObjectRequest { + + /** ComposeObjectRequest destination */ + destination?: (google.storage.v2.IObject|null); + + /** ComposeObjectRequest sourceObjects */ + sourceObjects?: (google.storage.v2.ComposeObjectRequest.ISourceObject[]|null); + + /** ComposeObjectRequest destinationPredefinedAcl */ + destinationPredefinedAcl?: (string|null); + + /** ComposeObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** ComposeObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** ComposeObjectRequest kmsKey */ + kmsKey?: (string|null); + + /** ComposeObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** ComposeObjectRequest objectChecksums */ + objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** ComposeObjectRequest deleteSourceObjects */ + deleteSourceObjects?: (boolean|null); + } + + /** Represents a ComposeObjectRequest. */ + class ComposeObjectRequest implements IComposeObjectRequest { + + /** + * Constructs a new ComposeObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IComposeObjectRequest); + + /** ComposeObjectRequest destination. */ + public destination?: (google.storage.v2.IObject|null); + + /** ComposeObjectRequest sourceObjects. */ + public sourceObjects: google.storage.v2.ComposeObjectRequest.ISourceObject[]; + + /** ComposeObjectRequest destinationPredefinedAcl. */ + public destinationPredefinedAcl: string; + + /** ComposeObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** ComposeObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** ComposeObjectRequest kmsKey. */ + public kmsKey: string; + + /** ComposeObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** ComposeObjectRequest objectChecksums. */ + public objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** ComposeObjectRequest deleteSourceObjects. */ + public deleteSourceObjects?: (boolean|null); + + /** + * Creates a new ComposeObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComposeObjectRequest instance + */ + public static create(properties?: google.storage.v2.IComposeObjectRequest): google.storage.v2.ComposeObjectRequest; + + /** + * Encodes the specified ComposeObjectRequest message. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.verify|verify} messages. + * @param message ComposeObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IComposeObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComposeObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.verify|verify} messages. + * @param message ComposeObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IComposeObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComposeObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComposeObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ComposeObjectRequest; + + /** + * Decodes a ComposeObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComposeObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ComposeObjectRequest; + + /** + * Verifies a ComposeObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComposeObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComposeObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ComposeObjectRequest; + + /** + * Creates a plain object from a ComposeObjectRequest message. Also converts values to other types if specified. + * @param message ComposeObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ComposeObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComposeObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComposeObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComposeObjectRequest { + + /** Properties of a SourceObject. */ + interface ISourceObject { + + /** SourceObject name */ + name?: (string|null); + + /** SourceObject generation */ + generation?: (number|Long|string|null); + + /** SourceObject objectPreconditions */ + objectPreconditions?: (google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions|null); + } + + /** Represents a SourceObject. */ + class SourceObject implements ISourceObject { + + /** + * Constructs a new SourceObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ComposeObjectRequest.ISourceObject); + + /** SourceObject name. */ + public name: string; + + /** SourceObject generation. */ + public generation: (number|Long|string); + + /** SourceObject objectPreconditions. */ + public objectPreconditions?: (google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions|null); + + /** + * Creates a new SourceObject instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceObject instance + */ + public static create(properties?: google.storage.v2.ComposeObjectRequest.ISourceObject): google.storage.v2.ComposeObjectRequest.SourceObject; + + /** + * Encodes the specified SourceObject message. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.verify|verify} messages. + * @param message SourceObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ComposeObjectRequest.ISourceObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceObject message, length delimited. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.verify|verify} messages. + * @param message SourceObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ComposeObjectRequest.ISourceObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ComposeObjectRequest.SourceObject; + + /** + * Decodes a SourceObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ComposeObjectRequest.SourceObject; + + /** + * Verifies a SourceObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceObject + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ComposeObjectRequest.SourceObject; + + /** + * Creates a plain object from a SourceObject message. Also converts values to other types if specified. + * @param message SourceObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ComposeObjectRequest.SourceObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceObject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceObject { + + /** Properties of an ObjectPreconditions. */ + interface IObjectPreconditions { + + /** ObjectPreconditions ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + } + + /** Represents an ObjectPreconditions. */ + class ObjectPreconditions implements IObjectPreconditions { + + /** + * Constructs a new ObjectPreconditions. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions); + + /** ObjectPreconditions ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** + * Creates a new ObjectPreconditions instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectPreconditions instance + */ + public static create(properties?: google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions): google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions; + + /** + * Encodes the specified ObjectPreconditions message. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.verify|verify} messages. + * @param message ObjectPreconditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectPreconditions message, length delimited. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.verify|verify} messages. + * @param message ObjectPreconditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectPreconditions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectPreconditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions; + + /** + * Decodes an ObjectPreconditions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectPreconditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions; + + /** + * Verifies an ObjectPreconditions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectPreconditions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectPreconditions + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions; + + /** + * Creates a plain object from an ObjectPreconditions message. Also converts values to other types if specified. + * @param message ObjectPreconditions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectPreconditions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectPreconditions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a DeleteObjectRequest. */ + interface IDeleteObjectRequest { + + /** DeleteObjectRequest bucket */ + bucket?: (string|null); + + /** DeleteObjectRequest object */ + object?: (string|null); + + /** DeleteObjectRequest generation */ + generation?: (number|Long|string|null); + + /** DeleteObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** DeleteObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** DeleteObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + } + + /** Represents a DeleteObjectRequest. */ + class DeleteObjectRequest implements IDeleteObjectRequest { + + /** + * Constructs a new DeleteObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IDeleteObjectRequest); + + /** DeleteObjectRequest bucket. */ + public bucket: string; + + /** DeleteObjectRequest object. */ + public object: string; + + /** DeleteObjectRequest generation. */ + public generation: (number|Long|string); + + /** DeleteObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** DeleteObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** DeleteObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** DeleteObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** DeleteObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** + * Creates a new DeleteObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteObjectRequest instance + */ + public static create(properties?: google.storage.v2.IDeleteObjectRequest): google.storage.v2.DeleteObjectRequest; + + /** + * Encodes the specified DeleteObjectRequest message. Does not implicitly {@link google.storage.v2.DeleteObjectRequest.verify|verify} messages. + * @param message DeleteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IDeleteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.DeleteObjectRequest.verify|verify} messages. + * @param message DeleteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IDeleteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.DeleteObjectRequest; + + /** + * Decodes a DeleteObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.DeleteObjectRequest; + + /** + * Verifies a DeleteObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.DeleteObjectRequest; + + /** + * Creates a plain object from a DeleteObjectRequest message. Also converts values to other types if specified. + * @param message DeleteObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.DeleteObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreObjectRequest. */ + interface IRestoreObjectRequest { + + /** RestoreObjectRequest bucket */ + bucket?: (string|null); + + /** RestoreObjectRequest object */ + object?: (string|null); + + /** RestoreObjectRequest generation */ + generation?: (number|Long|string|null); + + /** RestoreObjectRequest restoreToken */ + restoreToken?: (string|null); + + /** RestoreObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** RestoreObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** RestoreObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** RestoreObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** RestoreObjectRequest copySourceAcl */ + copySourceAcl?: (boolean|null); + + /** RestoreObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + } + + /** Represents a RestoreObjectRequest. */ + class RestoreObjectRequest implements IRestoreObjectRequest { + + /** + * Constructs a new RestoreObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IRestoreObjectRequest); + + /** RestoreObjectRequest bucket. */ + public bucket: string; + + /** RestoreObjectRequest object. */ + public object: string; + + /** RestoreObjectRequest generation. */ + public generation: (number|Long|string); + + /** RestoreObjectRequest restoreToken. */ + public restoreToken: string; + + /** RestoreObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** RestoreObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** RestoreObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** RestoreObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** RestoreObjectRequest copySourceAcl. */ + public copySourceAcl?: (boolean|null); + + /** RestoreObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** + * Creates a new RestoreObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreObjectRequest instance + */ + public static create(properties?: google.storage.v2.IRestoreObjectRequest): google.storage.v2.RestoreObjectRequest; + + /** + * Encodes the specified RestoreObjectRequest message. Does not implicitly {@link google.storage.v2.RestoreObjectRequest.verify|verify} messages. + * @param message RestoreObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IRestoreObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.RestoreObjectRequest.verify|verify} messages. + * @param message RestoreObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IRestoreObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.RestoreObjectRequest; + + /** + * Decodes a RestoreObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.RestoreObjectRequest; + + /** + * Verifies a RestoreObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.RestoreObjectRequest; + + /** + * Creates a plain object from a RestoreObjectRequest message. Also converts values to other types if specified. + * @param message RestoreObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.RestoreObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelResumableWriteRequest. */ + interface ICancelResumableWriteRequest { + + /** CancelResumableWriteRequest uploadId */ + uploadId?: (string|null); + } + + /** Represents a CancelResumableWriteRequest. */ + class CancelResumableWriteRequest implements ICancelResumableWriteRequest { + + /** + * Constructs a new CancelResumableWriteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ICancelResumableWriteRequest); + + /** CancelResumableWriteRequest uploadId. */ + public uploadId: string; + + /** + * Creates a new CancelResumableWriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelResumableWriteRequest instance + */ + public static create(properties?: google.storage.v2.ICancelResumableWriteRequest): google.storage.v2.CancelResumableWriteRequest; + + /** + * Encodes the specified CancelResumableWriteRequest message. Does not implicitly {@link google.storage.v2.CancelResumableWriteRequest.verify|verify} messages. + * @param message CancelResumableWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ICancelResumableWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelResumableWriteRequest message, length delimited. Does not implicitly {@link google.storage.v2.CancelResumableWriteRequest.verify|verify} messages. + * @param message CancelResumableWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ICancelResumableWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelResumableWriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.CancelResumableWriteRequest; + + /** + * Decodes a CancelResumableWriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.CancelResumableWriteRequest; + + /** + * Verifies a CancelResumableWriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelResumableWriteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelResumableWriteRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.CancelResumableWriteRequest; + + /** + * Creates a plain object from a CancelResumableWriteRequest message. Also converts values to other types if specified. + * @param message CancelResumableWriteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.CancelResumableWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelResumableWriteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelResumableWriteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelResumableWriteResponse. */ + interface ICancelResumableWriteResponse { + } + + /** Represents a CancelResumableWriteResponse. */ + class CancelResumableWriteResponse implements ICancelResumableWriteResponse { + + /** + * Constructs a new CancelResumableWriteResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ICancelResumableWriteResponse); + + /** + * Creates a new CancelResumableWriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelResumableWriteResponse instance + */ + public static create(properties?: google.storage.v2.ICancelResumableWriteResponse): google.storage.v2.CancelResumableWriteResponse; + + /** + * Encodes the specified CancelResumableWriteResponse message. Does not implicitly {@link google.storage.v2.CancelResumableWriteResponse.verify|verify} messages. + * @param message CancelResumableWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ICancelResumableWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelResumableWriteResponse message, length delimited. Does not implicitly {@link google.storage.v2.CancelResumableWriteResponse.verify|verify} messages. + * @param message CancelResumableWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ICancelResumableWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelResumableWriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.CancelResumableWriteResponse; + + /** + * Decodes a CancelResumableWriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.CancelResumableWriteResponse; + + /** + * Verifies a CancelResumableWriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelResumableWriteResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelResumableWriteResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.CancelResumableWriteResponse; + + /** + * Creates a plain object from a CancelResumableWriteResponse message. Also converts values to other types if specified. + * @param message CancelResumableWriteResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.CancelResumableWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelResumableWriteResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelResumableWriteResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadObjectRequest. */ + interface IReadObjectRequest { + + /** ReadObjectRequest bucket */ + bucket?: (string|null); + + /** ReadObjectRequest object */ + object?: (string|null); + + /** ReadObjectRequest generation */ + generation?: (number|Long|string|null); + + /** ReadObjectRequest readOffset */ + readOffset?: (number|Long|string|null); + + /** ReadObjectRequest readLimit */ + readLimit?: (number|Long|string|null); + + /** ReadObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** ReadObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** ReadObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** ReadObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** ReadObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** ReadObjectRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a ReadObjectRequest. */ + class ReadObjectRequest implements IReadObjectRequest { + + /** + * Constructs a new ReadObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IReadObjectRequest); + + /** ReadObjectRequest bucket. */ + public bucket: string; + + /** ReadObjectRequest object. */ + public object: string; + + /** ReadObjectRequest generation. */ + public generation: (number|Long|string); + + /** ReadObjectRequest readOffset. */ + public readOffset: (number|Long|string); + + /** ReadObjectRequest readLimit. */ + public readLimit: (number|Long|string); + + /** ReadObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** ReadObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** ReadObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** ReadObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** ReadObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** ReadObjectRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new ReadObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadObjectRequest instance + */ + public static create(properties?: google.storage.v2.IReadObjectRequest): google.storage.v2.ReadObjectRequest; + + /** + * Encodes the specified ReadObjectRequest message. Does not implicitly {@link google.storage.v2.ReadObjectRequest.verify|verify} messages. + * @param message ReadObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IReadObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.ReadObjectRequest.verify|verify} messages. + * @param message ReadObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IReadObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ReadObjectRequest; + + /** + * Decodes a ReadObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ReadObjectRequest; + + /** + * Verifies a ReadObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ReadObjectRequest; + + /** + * Creates a plain object from a ReadObjectRequest message. Also converts values to other types if specified. + * @param message ReadObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ReadObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetObjectRequest. */ + interface IGetObjectRequest { + + /** GetObjectRequest bucket */ + bucket?: (string|null); + + /** GetObjectRequest object */ + object?: (string|null); + + /** GetObjectRequest generation */ + generation?: (number|Long|string|null); + + /** GetObjectRequest softDeleted */ + softDeleted?: (boolean|null); + + /** GetObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** GetObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** GetObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** GetObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** GetObjectRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** GetObjectRequest restoreToken */ + restoreToken?: (string|null); + } + + /** Represents a GetObjectRequest. */ + class GetObjectRequest implements IGetObjectRequest { + + /** + * Constructs a new GetObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IGetObjectRequest); + + /** GetObjectRequest bucket. */ + public bucket: string; + + /** GetObjectRequest object. */ + public object: string; + + /** GetObjectRequest generation. */ + public generation: (number|Long|string); + + /** GetObjectRequest softDeleted. */ + public softDeleted?: (boolean|null); + + /** GetObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** GetObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** GetObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** GetObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** GetObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** GetObjectRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** GetObjectRequest restoreToken. */ + public restoreToken: string; + + /** + * Creates a new GetObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetObjectRequest instance + */ + public static create(properties?: google.storage.v2.IGetObjectRequest): google.storage.v2.GetObjectRequest; + + /** + * Encodes the specified GetObjectRequest message. Does not implicitly {@link google.storage.v2.GetObjectRequest.verify|verify} messages. + * @param message GetObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IGetObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.GetObjectRequest.verify|verify} messages. + * @param message GetObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IGetObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.GetObjectRequest; + + /** + * Decodes a GetObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.GetObjectRequest; + + /** + * Verifies a GetObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.GetObjectRequest; + + /** + * Creates a plain object from a GetObjectRequest message. Also converts values to other types if specified. + * @param message GetObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.GetObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadObjectResponse. */ + interface IReadObjectResponse { + + /** ReadObjectResponse checksummedData */ + checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** ReadObjectResponse objectChecksums */ + objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** ReadObjectResponse contentRange */ + contentRange?: (google.storage.v2.IContentRange|null); + + /** ReadObjectResponse metadata */ + metadata?: (google.storage.v2.IObject|null); + } + + /** Represents a ReadObjectResponse. */ + class ReadObjectResponse implements IReadObjectResponse { + + /** + * Constructs a new ReadObjectResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IReadObjectResponse); + + /** ReadObjectResponse checksummedData. */ + public checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** ReadObjectResponse objectChecksums. */ + public objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** ReadObjectResponse contentRange. */ + public contentRange?: (google.storage.v2.IContentRange|null); + + /** ReadObjectResponse metadata. */ + public metadata?: (google.storage.v2.IObject|null); + + /** + * Creates a new ReadObjectResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadObjectResponse instance + */ + public static create(properties?: google.storage.v2.IReadObjectResponse): google.storage.v2.ReadObjectResponse; + + /** + * Encodes the specified ReadObjectResponse message. Does not implicitly {@link google.storage.v2.ReadObjectResponse.verify|verify} messages. + * @param message ReadObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IReadObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.ReadObjectResponse.verify|verify} messages. + * @param message ReadObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IReadObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadObjectResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ReadObjectResponse; + + /** + * Decodes a ReadObjectResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ReadObjectResponse; + + /** + * Verifies a ReadObjectResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadObjectResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadObjectResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ReadObjectResponse; + + /** + * Creates a plain object from a ReadObjectResponse message. Also converts values to other types if specified. + * @param message ReadObjectResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ReadObjectResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadObjectResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadObjectResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiReadObjectSpec. */ + interface IBidiReadObjectSpec { + + /** BidiReadObjectSpec bucket */ + bucket?: (string|null); + + /** BidiReadObjectSpec object */ + object?: (string|null); + + /** BidiReadObjectSpec generation */ + generation?: (number|Long|string|null); + + /** BidiReadObjectSpec ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** BidiReadObjectSpec readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** BidiReadObjectSpec readHandle */ + readHandle?: (google.storage.v2.IBidiReadHandle|null); + + /** BidiReadObjectSpec routingToken */ + routingToken?: (string|null); + } + + /** Represents a BidiReadObjectSpec. */ + class BidiReadObjectSpec implements IBidiReadObjectSpec { + + /** + * Constructs a new BidiReadObjectSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiReadObjectSpec); + + /** BidiReadObjectSpec bucket. */ + public bucket: string; + + /** BidiReadObjectSpec object. */ + public object: string; + + /** BidiReadObjectSpec generation. */ + public generation: (number|Long|string); + + /** BidiReadObjectSpec ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** BidiReadObjectSpec commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** BidiReadObjectSpec readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** BidiReadObjectSpec readHandle. */ + public readHandle?: (google.storage.v2.IBidiReadHandle|null); + + /** BidiReadObjectSpec routingToken. */ + public routingToken?: (string|null); + + /** + * Creates a new BidiReadObjectSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiReadObjectSpec instance + */ + public static create(properties?: google.storage.v2.IBidiReadObjectSpec): google.storage.v2.BidiReadObjectSpec; + + /** + * Encodes the specified BidiReadObjectSpec message. Does not implicitly {@link google.storage.v2.BidiReadObjectSpec.verify|verify} messages. + * @param message BidiReadObjectSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiReadObjectSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiReadObjectSpec message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectSpec.verify|verify} messages. + * @param message BidiReadObjectSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiReadObjectSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiReadObjectSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiReadObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiReadObjectSpec; + + /** + * Decodes a BidiReadObjectSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiReadObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiReadObjectSpec; + + /** + * Verifies a BidiReadObjectSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiReadObjectSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiReadObjectSpec + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiReadObjectSpec; + + /** + * Creates a plain object from a BidiReadObjectSpec message. Also converts values to other types if specified. + * @param message BidiReadObjectSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiReadObjectSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiReadObjectSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiReadObjectSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiReadObjectRequest. */ + interface IBidiReadObjectRequest { + + /** BidiReadObjectRequest readObjectSpec */ + readObjectSpec?: (google.storage.v2.IBidiReadObjectSpec|null); + + /** BidiReadObjectRequest readRanges */ + readRanges?: (google.storage.v2.IReadRange[]|null); + } + + /** Represents a BidiReadObjectRequest. */ + class BidiReadObjectRequest implements IBidiReadObjectRequest { + + /** + * Constructs a new BidiReadObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiReadObjectRequest); + + /** BidiReadObjectRequest readObjectSpec. */ + public readObjectSpec?: (google.storage.v2.IBidiReadObjectSpec|null); + + /** BidiReadObjectRequest readRanges. */ + public readRanges: google.storage.v2.IReadRange[]; + + /** + * Creates a new BidiReadObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiReadObjectRequest instance + */ + public static create(properties?: google.storage.v2.IBidiReadObjectRequest): google.storage.v2.BidiReadObjectRequest; + + /** + * Encodes the specified BidiReadObjectRequest message. Does not implicitly {@link google.storage.v2.BidiReadObjectRequest.verify|verify} messages. + * @param message BidiReadObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiReadObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiReadObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectRequest.verify|verify} messages. + * @param message BidiReadObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiReadObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiReadObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiReadObjectRequest; + + /** + * Decodes a BidiReadObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiReadObjectRequest; + + /** + * Verifies a BidiReadObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiReadObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiReadObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiReadObjectRequest; + + /** + * Creates a plain object from a BidiReadObjectRequest message. Also converts values to other types if specified. + * @param message BidiReadObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiReadObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiReadObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiReadObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiReadObjectResponse. */ + interface IBidiReadObjectResponse { + + /** BidiReadObjectResponse objectDataRanges */ + objectDataRanges?: (google.storage.v2.IObjectRangeData[]|null); + + /** BidiReadObjectResponse metadata */ + metadata?: (google.storage.v2.IObject|null); + + /** BidiReadObjectResponse readHandle */ + readHandle?: (google.storage.v2.IBidiReadHandle|null); + } + + /** Represents a BidiReadObjectResponse. */ + class BidiReadObjectResponse implements IBidiReadObjectResponse { + + /** + * Constructs a new BidiReadObjectResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiReadObjectResponse); + + /** BidiReadObjectResponse objectDataRanges. */ + public objectDataRanges: google.storage.v2.IObjectRangeData[]; + + /** BidiReadObjectResponse metadata. */ + public metadata?: (google.storage.v2.IObject|null); + + /** BidiReadObjectResponse readHandle. */ + public readHandle?: (google.storage.v2.IBidiReadHandle|null); + + /** + * Creates a new BidiReadObjectResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiReadObjectResponse instance + */ + public static create(properties?: google.storage.v2.IBidiReadObjectResponse): google.storage.v2.BidiReadObjectResponse; + + /** + * Encodes the specified BidiReadObjectResponse message. Does not implicitly {@link google.storage.v2.BidiReadObjectResponse.verify|verify} messages. + * @param message BidiReadObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiReadObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiReadObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectResponse.verify|verify} messages. + * @param message BidiReadObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiReadObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiReadObjectResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiReadObjectResponse; + + /** + * Decodes a BidiReadObjectResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiReadObjectResponse; + + /** + * Verifies a BidiReadObjectResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiReadObjectResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiReadObjectResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiReadObjectResponse; + + /** + * Creates a plain object from a BidiReadObjectResponse message. Also converts values to other types if specified. + * @param message BidiReadObjectResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiReadObjectResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiReadObjectResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiReadObjectResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiReadObjectRedirectedError. */ + interface IBidiReadObjectRedirectedError { + + /** BidiReadObjectRedirectedError readHandle */ + readHandle?: (google.storage.v2.IBidiReadHandle|null); + + /** BidiReadObjectRedirectedError routingToken */ + routingToken?: (string|null); + } + + /** Represents a BidiReadObjectRedirectedError. */ + class BidiReadObjectRedirectedError implements IBidiReadObjectRedirectedError { + + /** + * Constructs a new BidiReadObjectRedirectedError. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiReadObjectRedirectedError); + + /** BidiReadObjectRedirectedError readHandle. */ + public readHandle?: (google.storage.v2.IBidiReadHandle|null); + + /** BidiReadObjectRedirectedError routingToken. */ + public routingToken?: (string|null); + + /** + * Creates a new BidiReadObjectRedirectedError instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiReadObjectRedirectedError instance + */ + public static create(properties?: google.storage.v2.IBidiReadObjectRedirectedError): google.storage.v2.BidiReadObjectRedirectedError; + + /** + * Encodes the specified BidiReadObjectRedirectedError message. Does not implicitly {@link google.storage.v2.BidiReadObjectRedirectedError.verify|verify} messages. + * @param message BidiReadObjectRedirectedError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiReadObjectRedirectedError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiReadObjectRedirectedError message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectRedirectedError.verify|verify} messages. + * @param message BidiReadObjectRedirectedError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiReadObjectRedirectedError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiReadObjectRedirectedError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiReadObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiReadObjectRedirectedError; + + /** + * Decodes a BidiReadObjectRedirectedError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiReadObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiReadObjectRedirectedError; + + /** + * Verifies a BidiReadObjectRedirectedError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiReadObjectRedirectedError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiReadObjectRedirectedError + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiReadObjectRedirectedError; + + /** + * Creates a plain object from a BidiReadObjectRedirectedError message. Also converts values to other types if specified. + * @param message BidiReadObjectRedirectedError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiReadObjectRedirectedError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiReadObjectRedirectedError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiReadObjectRedirectedError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiWriteObjectRedirectedError. */ + interface IBidiWriteObjectRedirectedError { + + /** BidiWriteObjectRedirectedError routingToken */ + routingToken?: (string|null); + + /** BidiWriteObjectRedirectedError writeHandle */ + writeHandle?: (google.storage.v2.IBidiWriteHandle|null); + + /** BidiWriteObjectRedirectedError generation */ + generation?: (number|Long|string|null); + } + + /** Represents a BidiWriteObjectRedirectedError. */ + class BidiWriteObjectRedirectedError implements IBidiWriteObjectRedirectedError { + + /** + * Constructs a new BidiWriteObjectRedirectedError. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiWriteObjectRedirectedError); + + /** BidiWriteObjectRedirectedError routingToken. */ + public routingToken?: (string|null); + + /** BidiWriteObjectRedirectedError writeHandle. */ + public writeHandle?: (google.storage.v2.IBidiWriteHandle|null); + + /** BidiWriteObjectRedirectedError generation. */ + public generation?: (number|Long|string|null); + + /** + * Creates a new BidiWriteObjectRedirectedError instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiWriteObjectRedirectedError instance + */ + public static create(properties?: google.storage.v2.IBidiWriteObjectRedirectedError): google.storage.v2.BidiWriteObjectRedirectedError; + + /** + * Encodes the specified BidiWriteObjectRedirectedError message. Does not implicitly {@link google.storage.v2.BidiWriteObjectRedirectedError.verify|verify} messages. + * @param message BidiWriteObjectRedirectedError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiWriteObjectRedirectedError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiWriteObjectRedirectedError message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteObjectRedirectedError.verify|verify} messages. + * @param message BidiWriteObjectRedirectedError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiWriteObjectRedirectedError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiWriteObjectRedirectedError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiWriteObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiWriteObjectRedirectedError; + + /** + * Decodes a BidiWriteObjectRedirectedError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiWriteObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiWriteObjectRedirectedError; + + /** + * Verifies a BidiWriteObjectRedirectedError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiWriteObjectRedirectedError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiWriteObjectRedirectedError + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiWriteObjectRedirectedError; + + /** + * Creates a plain object from a BidiWriteObjectRedirectedError message. Also converts values to other types if specified. + * @param message BidiWriteObjectRedirectedError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiWriteObjectRedirectedError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiWriteObjectRedirectedError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiWriteObjectRedirectedError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiReadObjectError. */ + interface IBidiReadObjectError { + + /** BidiReadObjectError readRangeErrors */ + readRangeErrors?: (google.storage.v2.IReadRangeError[]|null); + } + + /** Represents a BidiReadObjectError. */ + class BidiReadObjectError implements IBidiReadObjectError { + + /** + * Constructs a new BidiReadObjectError. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiReadObjectError); + + /** BidiReadObjectError readRangeErrors. */ + public readRangeErrors: google.storage.v2.IReadRangeError[]; + + /** + * Creates a new BidiReadObjectError instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiReadObjectError instance + */ + public static create(properties?: google.storage.v2.IBidiReadObjectError): google.storage.v2.BidiReadObjectError; + + /** + * Encodes the specified BidiReadObjectError message. Does not implicitly {@link google.storage.v2.BidiReadObjectError.verify|verify} messages. + * @param message BidiReadObjectError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiReadObjectError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiReadObjectError message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectError.verify|verify} messages. + * @param message BidiReadObjectError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiReadObjectError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiReadObjectError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiReadObjectError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiReadObjectError; + + /** + * Decodes a BidiReadObjectError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiReadObjectError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiReadObjectError; + + /** + * Verifies a BidiReadObjectError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiReadObjectError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiReadObjectError + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiReadObjectError; + + /** + * Creates a plain object from a BidiReadObjectError message. Also converts values to other types if specified. + * @param message BidiReadObjectError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiReadObjectError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiReadObjectError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiReadObjectError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadRangeError. */ + interface IReadRangeError { + + /** ReadRangeError readId */ + readId?: (number|Long|string|null); + + /** ReadRangeError status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a ReadRangeError. */ + class ReadRangeError implements IReadRangeError { + + /** + * Constructs a new ReadRangeError. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IReadRangeError); + + /** ReadRangeError readId. */ + public readId: (number|Long|string); + + /** ReadRangeError status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new ReadRangeError instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRangeError instance + */ + public static create(properties?: google.storage.v2.IReadRangeError): google.storage.v2.ReadRangeError; + + /** + * Encodes the specified ReadRangeError message. Does not implicitly {@link google.storage.v2.ReadRangeError.verify|verify} messages. + * @param message ReadRangeError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IReadRangeError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRangeError message, length delimited. Does not implicitly {@link google.storage.v2.ReadRangeError.verify|verify} messages. + * @param message ReadRangeError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IReadRangeError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRangeError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRangeError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ReadRangeError; + + /** + * Decodes a ReadRangeError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRangeError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ReadRangeError; + + /** + * Verifies a ReadRangeError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRangeError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRangeError + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ReadRangeError; + + /** + * Creates a plain object from a ReadRangeError message. Also converts values to other types if specified. + * @param message ReadRangeError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ReadRangeError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRangeError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRangeError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadRange. */ + interface IReadRange { + + /** ReadRange readOffset */ + readOffset?: (number|Long|string|null); + + /** ReadRange readLength */ + readLength?: (number|Long|string|null); + + /** ReadRange readId */ + readId?: (number|Long|string|null); + } + + /** Represents a ReadRange. */ + class ReadRange implements IReadRange { + + /** + * Constructs a new ReadRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IReadRange); + + /** ReadRange readOffset. */ + public readOffset: (number|Long|string); + + /** ReadRange readLength. */ + public readLength: (number|Long|string); + + /** ReadRange readId. */ + public readId: (number|Long|string); + + /** + * Creates a new ReadRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRange instance + */ + public static create(properties?: google.storage.v2.IReadRange): google.storage.v2.ReadRange; + + /** + * Encodes the specified ReadRange message. Does not implicitly {@link google.storage.v2.ReadRange.verify|verify} messages. + * @param message ReadRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IReadRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRange message, length delimited. Does not implicitly {@link google.storage.v2.ReadRange.verify|verify} messages. + * @param message ReadRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IReadRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ReadRange; + + /** + * Decodes a ReadRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ReadRange; + + /** + * Verifies a ReadRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRange + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ReadRange; + + /** + * Creates a plain object from a ReadRange message. Also converts values to other types if specified. + * @param message ReadRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ReadRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectRangeData. */ + interface IObjectRangeData { + + /** ObjectRangeData checksummedData */ + checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** ObjectRangeData readRange */ + readRange?: (google.storage.v2.IReadRange|null); + + /** ObjectRangeData rangeEnd */ + rangeEnd?: (boolean|null); + } + + /** Represents an ObjectRangeData. */ + class ObjectRangeData implements IObjectRangeData { + + /** + * Constructs a new ObjectRangeData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IObjectRangeData); + + /** ObjectRangeData checksummedData. */ + public checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** ObjectRangeData readRange. */ + public readRange?: (google.storage.v2.IReadRange|null); + + /** ObjectRangeData rangeEnd. */ + public rangeEnd: boolean; + + /** + * Creates a new ObjectRangeData instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectRangeData instance + */ + public static create(properties?: google.storage.v2.IObjectRangeData): google.storage.v2.ObjectRangeData; + + /** + * Encodes the specified ObjectRangeData message. Does not implicitly {@link google.storage.v2.ObjectRangeData.verify|verify} messages. + * @param message ObjectRangeData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IObjectRangeData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectRangeData message, length delimited. Does not implicitly {@link google.storage.v2.ObjectRangeData.verify|verify} messages. + * @param message ObjectRangeData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IObjectRangeData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectRangeData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectRangeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ObjectRangeData; + + /** + * Decodes an ObjectRangeData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectRangeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ObjectRangeData; + + /** + * Verifies an ObjectRangeData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectRangeData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectRangeData + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ObjectRangeData; + + /** + * Creates a plain object from an ObjectRangeData message. Also converts values to other types if specified. + * @param message ObjectRangeData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ObjectRangeData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectRangeData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectRangeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiReadHandle. */ + interface IBidiReadHandle { + + /** BidiReadHandle handle */ + handle?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BidiReadHandle. */ + class BidiReadHandle implements IBidiReadHandle { + + /** + * Constructs a new BidiReadHandle. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiReadHandle); + + /** BidiReadHandle handle. */ + public handle: (Uint8Array|Buffer|string); + + /** + * Creates a new BidiReadHandle instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiReadHandle instance + */ + public static create(properties?: google.storage.v2.IBidiReadHandle): google.storage.v2.BidiReadHandle; + + /** + * Encodes the specified BidiReadHandle message. Does not implicitly {@link google.storage.v2.BidiReadHandle.verify|verify} messages. + * @param message BidiReadHandle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiReadHandle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiReadHandle message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadHandle.verify|verify} messages. + * @param message BidiReadHandle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiReadHandle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiReadHandle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiReadHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiReadHandle; + + /** + * Decodes a BidiReadHandle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiReadHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiReadHandle; + + /** + * Verifies a BidiReadHandle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiReadHandle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiReadHandle + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiReadHandle; + + /** + * Creates a plain object from a BidiReadHandle message. Also converts values to other types if specified. + * @param message BidiReadHandle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiReadHandle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiReadHandle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiReadHandle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiWriteHandle. */ + interface IBidiWriteHandle { + + /** BidiWriteHandle handle */ + handle?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BidiWriteHandle. */ + class BidiWriteHandle implements IBidiWriteHandle { + + /** + * Constructs a new BidiWriteHandle. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiWriteHandle); + + /** BidiWriteHandle handle. */ + public handle: (Uint8Array|Buffer|string); + + /** + * Creates a new BidiWriteHandle instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiWriteHandle instance + */ + public static create(properties?: google.storage.v2.IBidiWriteHandle): google.storage.v2.BidiWriteHandle; + + /** + * Encodes the specified BidiWriteHandle message. Does not implicitly {@link google.storage.v2.BidiWriteHandle.verify|verify} messages. + * @param message BidiWriteHandle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiWriteHandle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiWriteHandle message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteHandle.verify|verify} messages. + * @param message BidiWriteHandle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiWriteHandle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiWriteHandle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiWriteHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiWriteHandle; + + /** + * Decodes a BidiWriteHandle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiWriteHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiWriteHandle; + + /** + * Verifies a BidiWriteHandle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiWriteHandle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiWriteHandle + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiWriteHandle; + + /** + * Creates a plain object from a BidiWriteHandle message. Also converts values to other types if specified. + * @param message BidiWriteHandle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiWriteHandle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiWriteHandle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiWriteHandle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WriteObjectSpec. */ + interface IWriteObjectSpec { + + /** WriteObjectSpec resource */ + resource?: (google.storage.v2.IObject|null); + + /** WriteObjectSpec predefinedAcl */ + predefinedAcl?: (string|null); + + /** WriteObjectSpec ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** WriteObjectSpec ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** WriteObjectSpec ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** WriteObjectSpec ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** WriteObjectSpec objectSize */ + objectSize?: (number|Long|string|null); + + /** WriteObjectSpec appendable */ + appendable?: (boolean|null); + } + + /** Represents a WriteObjectSpec. */ + class WriteObjectSpec implements IWriteObjectSpec { + + /** + * Constructs a new WriteObjectSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IWriteObjectSpec); + + /** WriteObjectSpec resource. */ + public resource?: (google.storage.v2.IObject|null); + + /** WriteObjectSpec predefinedAcl. */ + public predefinedAcl: string; + + /** WriteObjectSpec ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** WriteObjectSpec ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** WriteObjectSpec ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** WriteObjectSpec ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** WriteObjectSpec objectSize. */ + public objectSize?: (number|Long|string|null); + + /** WriteObjectSpec appendable. */ + public appendable?: (boolean|null); + + /** + * Creates a new WriteObjectSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteObjectSpec instance + */ + public static create(properties?: google.storage.v2.IWriteObjectSpec): google.storage.v2.WriteObjectSpec; + + /** + * Encodes the specified WriteObjectSpec message. Does not implicitly {@link google.storage.v2.WriteObjectSpec.verify|verify} messages. + * @param message WriteObjectSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IWriteObjectSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteObjectSpec message, length delimited. Does not implicitly {@link google.storage.v2.WriteObjectSpec.verify|verify} messages. + * @param message WriteObjectSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IWriteObjectSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteObjectSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.WriteObjectSpec; + + /** + * Decodes a WriteObjectSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.WriteObjectSpec; + + /** + * Verifies a WriteObjectSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WriteObjectSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteObjectSpec + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.WriteObjectSpec; + + /** + * Creates a plain object from a WriteObjectSpec message. Also converts values to other types if specified. + * @param message WriteObjectSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.WriteObjectSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteObjectSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteObjectSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WriteObjectRequest. */ + interface IWriteObjectRequest { + + /** WriteObjectRequest uploadId */ + uploadId?: (string|null); + + /** WriteObjectRequest writeObjectSpec */ + writeObjectSpec?: (google.storage.v2.IWriteObjectSpec|null); + + /** WriteObjectRequest writeOffset */ + writeOffset?: (number|Long|string|null); + + /** WriteObjectRequest checksummedData */ + checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** WriteObjectRequest objectChecksums */ + objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** WriteObjectRequest finishWrite */ + finishWrite?: (boolean|null); + + /** WriteObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + } + + /** Represents a WriteObjectRequest. */ + class WriteObjectRequest implements IWriteObjectRequest { + + /** + * Constructs a new WriteObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IWriteObjectRequest); + + /** WriteObjectRequest uploadId. */ + public uploadId?: (string|null); + + /** WriteObjectRequest writeObjectSpec. */ + public writeObjectSpec?: (google.storage.v2.IWriteObjectSpec|null); + + /** WriteObjectRequest writeOffset. */ + public writeOffset: (number|Long|string); + + /** WriteObjectRequest checksummedData. */ + public checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** WriteObjectRequest objectChecksums. */ + public objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** WriteObjectRequest finishWrite. */ + public finishWrite: boolean; + + /** WriteObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** WriteObjectRequest firstMessage. */ + public firstMessage?: ("uploadId"|"writeObjectSpec"); + + /** WriteObjectRequest data. */ + public data?: "checksummedData"; + + /** + * Creates a new WriteObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteObjectRequest instance + */ + public static create(properties?: google.storage.v2.IWriteObjectRequest): google.storage.v2.WriteObjectRequest; + + /** + * Encodes the specified WriteObjectRequest message. Does not implicitly {@link google.storage.v2.WriteObjectRequest.verify|verify} messages. + * @param message WriteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IWriteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.WriteObjectRequest.verify|verify} messages. + * @param message WriteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IWriteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.WriteObjectRequest; + + /** + * Decodes a WriteObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.WriteObjectRequest; + + /** + * Verifies a WriteObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WriteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.WriteObjectRequest; + + /** + * Creates a plain object from a WriteObjectRequest message. Also converts values to other types if specified. + * @param message WriteObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.WriteObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WriteObjectResponse. */ + interface IWriteObjectResponse { + + /** WriteObjectResponse persistedSize */ + persistedSize?: (number|Long|string|null); + + /** WriteObjectResponse resource */ + resource?: (google.storage.v2.IObject|null); + + /** WriteObjectResponse persistedDataChecksums */ + persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + } + + /** Represents a WriteObjectResponse. */ + class WriteObjectResponse implements IWriteObjectResponse { + + /** + * Constructs a new WriteObjectResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IWriteObjectResponse); + + /** WriteObjectResponse persistedSize. */ + public persistedSize?: (number|Long|string|null); + + /** WriteObjectResponse resource. */ + public resource?: (google.storage.v2.IObject|null); + + /** WriteObjectResponse persistedDataChecksums. */ + public persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** WriteObjectResponse writeStatus. */ + public writeStatus?: ("persistedSize"|"resource"); + + /** + * Creates a new WriteObjectResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteObjectResponse instance + */ + public static create(properties?: google.storage.v2.IWriteObjectResponse): google.storage.v2.WriteObjectResponse; + + /** + * Encodes the specified WriteObjectResponse message. Does not implicitly {@link google.storage.v2.WriteObjectResponse.verify|verify} messages. + * @param message WriteObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IWriteObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.WriteObjectResponse.verify|verify} messages. + * @param message WriteObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IWriteObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteObjectResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.WriteObjectResponse; + + /** + * Decodes a WriteObjectResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.WriteObjectResponse; + + /** + * Verifies a WriteObjectResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WriteObjectResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteObjectResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.WriteObjectResponse; + + /** + * Creates a plain object from a WriteObjectResponse message. Also converts values to other types if specified. + * @param message WriteObjectResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.WriteObjectResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteObjectResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteObjectResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppendObjectSpec. */ + interface IAppendObjectSpec { + + /** AppendObjectSpec bucket */ + bucket?: (string|null); + + /** AppendObjectSpec object */ + object?: (string|null); + + /** AppendObjectSpec generation */ + generation?: (number|Long|string|null); + + /** AppendObjectSpec ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** AppendObjectSpec ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** AppendObjectSpec routingToken */ + routingToken?: (string|null); + + /** AppendObjectSpec writeHandle */ + writeHandle?: (google.storage.v2.IBidiWriteHandle|null); + } + + /** Represents an AppendObjectSpec. */ + class AppendObjectSpec implements IAppendObjectSpec { + + /** + * Constructs a new AppendObjectSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IAppendObjectSpec); + + /** AppendObjectSpec bucket. */ + public bucket: string; + + /** AppendObjectSpec object. */ + public object: string; + + /** AppendObjectSpec generation. */ + public generation: (number|Long|string); + + /** AppendObjectSpec ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** AppendObjectSpec ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** AppendObjectSpec routingToken. */ + public routingToken?: (string|null); + + /** AppendObjectSpec writeHandle. */ + public writeHandle?: (google.storage.v2.IBidiWriteHandle|null); + + /** + * Creates a new AppendObjectSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AppendObjectSpec instance + */ + public static create(properties?: google.storage.v2.IAppendObjectSpec): google.storage.v2.AppendObjectSpec; + + /** + * Encodes the specified AppendObjectSpec message. Does not implicitly {@link google.storage.v2.AppendObjectSpec.verify|verify} messages. + * @param message AppendObjectSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IAppendObjectSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppendObjectSpec message, length delimited. Does not implicitly {@link google.storage.v2.AppendObjectSpec.verify|verify} messages. + * @param message AppendObjectSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IAppendObjectSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppendObjectSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppendObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.AppendObjectSpec; + + /** + * Decodes an AppendObjectSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppendObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.AppendObjectSpec; + + /** + * Verifies an AppendObjectSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppendObjectSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppendObjectSpec + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.AppendObjectSpec; + + /** + * Creates a plain object from an AppendObjectSpec message. Also converts values to other types if specified. + * @param message AppendObjectSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.AppendObjectSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppendObjectSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppendObjectSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiWriteObjectRequest. */ + interface IBidiWriteObjectRequest { + + /** BidiWriteObjectRequest uploadId */ + uploadId?: (string|null); + + /** BidiWriteObjectRequest writeObjectSpec */ + writeObjectSpec?: (google.storage.v2.IWriteObjectSpec|null); + + /** BidiWriteObjectRequest appendObjectSpec */ + appendObjectSpec?: (google.storage.v2.IAppendObjectSpec|null); + + /** BidiWriteObjectRequest writeOffset */ + writeOffset?: (number|Long|string|null); + + /** BidiWriteObjectRequest checksummedData */ + checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** BidiWriteObjectRequest objectChecksums */ + objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** BidiWriteObjectRequest stateLookup */ + stateLookup?: (boolean|null); + + /** BidiWriteObjectRequest flush */ + flush?: (boolean|null); + + /** BidiWriteObjectRequest finishWrite */ + finishWrite?: (boolean|null); + + /** BidiWriteObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + } + + /** Represents a BidiWriteObjectRequest. */ + class BidiWriteObjectRequest implements IBidiWriteObjectRequest { + + /** + * Constructs a new BidiWriteObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiWriteObjectRequest); + + /** BidiWriteObjectRequest uploadId. */ + public uploadId?: (string|null); + + /** BidiWriteObjectRequest writeObjectSpec. */ + public writeObjectSpec?: (google.storage.v2.IWriteObjectSpec|null); + + /** BidiWriteObjectRequest appendObjectSpec. */ + public appendObjectSpec?: (google.storage.v2.IAppendObjectSpec|null); + + /** BidiWriteObjectRequest writeOffset. */ + public writeOffset: (number|Long|string); + + /** BidiWriteObjectRequest checksummedData. */ + public checksummedData?: (google.storage.v2.IChecksummedData|null); + + /** BidiWriteObjectRequest objectChecksums. */ + public objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** BidiWriteObjectRequest stateLookup. */ + public stateLookup: boolean; + + /** BidiWriteObjectRequest flush. */ + public flush: boolean; + + /** BidiWriteObjectRequest finishWrite. */ + public finishWrite: boolean; + + /** BidiWriteObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** BidiWriteObjectRequest firstMessage. */ + public firstMessage?: ("uploadId"|"writeObjectSpec"|"appendObjectSpec"); + + /** BidiWriteObjectRequest data. */ + public data?: "checksummedData"; + + /** + * Creates a new BidiWriteObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiWriteObjectRequest instance + */ + public static create(properties?: google.storage.v2.IBidiWriteObjectRequest): google.storage.v2.BidiWriteObjectRequest; + + /** + * Encodes the specified BidiWriteObjectRequest message. Does not implicitly {@link google.storage.v2.BidiWriteObjectRequest.verify|verify} messages. + * @param message BidiWriteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiWriteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiWriteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteObjectRequest.verify|verify} messages. + * @param message BidiWriteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiWriteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiWriteObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiWriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiWriteObjectRequest; + + /** + * Decodes a BidiWriteObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiWriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiWriteObjectRequest; + + /** + * Verifies a BidiWriteObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiWriteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiWriteObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiWriteObjectRequest; + + /** + * Creates a plain object from a BidiWriteObjectRequest message. Also converts values to other types if specified. + * @param message BidiWriteObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiWriteObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiWriteObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiWriteObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiWriteObjectResponse. */ + interface IBidiWriteObjectResponse { + + /** BidiWriteObjectResponse persistedSize */ + persistedSize?: (number|Long|string|null); + + /** BidiWriteObjectResponse resource */ + resource?: (google.storage.v2.IObject|null); + + /** BidiWriteObjectResponse persistedDataChecksums */ + persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** BidiWriteObjectResponse writeHandle */ + writeHandle?: (google.storage.v2.IBidiWriteHandle|null); + } + + /** Represents a BidiWriteObjectResponse. */ + class BidiWriteObjectResponse implements IBidiWriteObjectResponse { + + /** + * Constructs a new BidiWriteObjectResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBidiWriteObjectResponse); + + /** BidiWriteObjectResponse persistedSize. */ + public persistedSize?: (number|Long|string|null); + + /** BidiWriteObjectResponse resource. */ + public resource?: (google.storage.v2.IObject|null); + + /** BidiWriteObjectResponse persistedDataChecksums. */ + public persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** BidiWriteObjectResponse writeHandle. */ + public writeHandle?: (google.storage.v2.IBidiWriteHandle|null); + + /** BidiWriteObjectResponse writeStatus. */ + public writeStatus?: ("persistedSize"|"resource"); + + /** + * Creates a new BidiWriteObjectResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiWriteObjectResponse instance + */ + public static create(properties?: google.storage.v2.IBidiWriteObjectResponse): google.storage.v2.BidiWriteObjectResponse; + + /** + * Encodes the specified BidiWriteObjectResponse message. Does not implicitly {@link google.storage.v2.BidiWriteObjectResponse.verify|verify} messages. + * @param message BidiWriteObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBidiWriteObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiWriteObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteObjectResponse.verify|verify} messages. + * @param message BidiWriteObjectResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBidiWriteObjectResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiWriteObjectResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiWriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BidiWriteObjectResponse; + + /** + * Decodes a BidiWriteObjectResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiWriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BidiWriteObjectResponse; + + /** + * Verifies a BidiWriteObjectResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiWriteObjectResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiWriteObjectResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BidiWriteObjectResponse; + + /** + * Creates a plain object from a BidiWriteObjectResponse message. Also converts values to other types if specified. + * @param message BidiWriteObjectResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BidiWriteObjectResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiWriteObjectResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiWriteObjectResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListObjectsRequest. */ + interface IListObjectsRequest { + + /** ListObjectsRequest parent */ + parent?: (string|null); + + /** ListObjectsRequest pageSize */ + pageSize?: (number|null); + + /** ListObjectsRequest pageToken */ + pageToken?: (string|null); + + /** ListObjectsRequest delimiter */ + delimiter?: (string|null); + + /** ListObjectsRequest includeTrailingDelimiter */ + includeTrailingDelimiter?: (boolean|null); + + /** ListObjectsRequest prefix */ + prefix?: (string|null); + + /** ListObjectsRequest versions */ + versions?: (boolean|null); + + /** ListObjectsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** ListObjectsRequest lexicographicStart */ + lexicographicStart?: (string|null); + + /** ListObjectsRequest lexicographicEnd */ + lexicographicEnd?: (string|null); + + /** ListObjectsRequest softDeleted */ + softDeleted?: (boolean|null); + + /** ListObjectsRequest includeFoldersAsPrefixes */ + includeFoldersAsPrefixes?: (boolean|null); + + /** ListObjectsRequest matchGlob */ + matchGlob?: (string|null); + + /** ListObjectsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListObjectsRequest. */ + class ListObjectsRequest implements IListObjectsRequest { + + /** + * Constructs a new ListObjectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IListObjectsRequest); + + /** ListObjectsRequest parent. */ + public parent: string; + + /** ListObjectsRequest pageSize. */ + public pageSize: number; + + /** ListObjectsRequest pageToken. */ + public pageToken: string; + + /** ListObjectsRequest delimiter. */ + public delimiter: string; + + /** ListObjectsRequest includeTrailingDelimiter. */ + public includeTrailingDelimiter: boolean; + + /** ListObjectsRequest prefix. */ + public prefix: string; + + /** ListObjectsRequest versions. */ + public versions: boolean; + + /** ListObjectsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** ListObjectsRequest lexicographicStart. */ + public lexicographicStart: string; + + /** ListObjectsRequest lexicographicEnd. */ + public lexicographicEnd: string; + + /** ListObjectsRequest softDeleted. */ + public softDeleted: boolean; + + /** ListObjectsRequest includeFoldersAsPrefixes. */ + public includeFoldersAsPrefixes: boolean; + + /** ListObjectsRequest matchGlob. */ + public matchGlob: string; + + /** ListObjectsRequest filter. */ + public filter: string; + + /** + * Creates a new ListObjectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListObjectsRequest instance + */ + public static create(properties?: google.storage.v2.IListObjectsRequest): google.storage.v2.ListObjectsRequest; + + /** + * Encodes the specified ListObjectsRequest message. Does not implicitly {@link google.storage.v2.ListObjectsRequest.verify|verify} messages. + * @param message ListObjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IListObjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListObjectsRequest message, length delimited. Does not implicitly {@link google.storage.v2.ListObjectsRequest.verify|verify} messages. + * @param message ListObjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IListObjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListObjectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListObjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ListObjectsRequest; + + /** + * Decodes a ListObjectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListObjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ListObjectsRequest; + + /** + * Verifies a ListObjectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListObjectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListObjectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ListObjectsRequest; + + /** + * Creates a plain object from a ListObjectsRequest message. Also converts values to other types if specified. + * @param message ListObjectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ListObjectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListObjectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListObjectsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryWriteStatusRequest. */ + interface IQueryWriteStatusRequest { + + /** QueryWriteStatusRequest uploadId */ + uploadId?: (string|null); + + /** QueryWriteStatusRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + } + + /** Represents a QueryWriteStatusRequest. */ + class QueryWriteStatusRequest implements IQueryWriteStatusRequest { + + /** + * Constructs a new QueryWriteStatusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IQueryWriteStatusRequest); + + /** QueryWriteStatusRequest uploadId. */ + public uploadId: string; + + /** QueryWriteStatusRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** + * Creates a new QueryWriteStatusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryWriteStatusRequest instance + */ + public static create(properties?: google.storage.v2.IQueryWriteStatusRequest): google.storage.v2.QueryWriteStatusRequest; + + /** + * Encodes the specified QueryWriteStatusRequest message. Does not implicitly {@link google.storage.v2.QueryWriteStatusRequest.verify|verify} messages. + * @param message QueryWriteStatusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IQueryWriteStatusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryWriteStatusRequest message, length delimited. Does not implicitly {@link google.storage.v2.QueryWriteStatusRequest.verify|verify} messages. + * @param message QueryWriteStatusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IQueryWriteStatusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryWriteStatusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryWriteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.QueryWriteStatusRequest; + + /** + * Decodes a QueryWriteStatusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryWriteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.QueryWriteStatusRequest; + + /** + * Verifies a QueryWriteStatusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryWriteStatusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryWriteStatusRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.QueryWriteStatusRequest; + + /** + * Creates a plain object from a QueryWriteStatusRequest message. Also converts values to other types if specified. + * @param message QueryWriteStatusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.QueryWriteStatusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryWriteStatusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryWriteStatusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryWriteStatusResponse. */ + interface IQueryWriteStatusResponse { + + /** QueryWriteStatusResponse persistedSize */ + persistedSize?: (number|Long|string|null); + + /** QueryWriteStatusResponse resource */ + resource?: (google.storage.v2.IObject|null); + + /** QueryWriteStatusResponse persistedDataChecksums */ + persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + } + + /** Represents a QueryWriteStatusResponse. */ + class QueryWriteStatusResponse implements IQueryWriteStatusResponse { + + /** + * Constructs a new QueryWriteStatusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IQueryWriteStatusResponse); + + /** QueryWriteStatusResponse persistedSize. */ + public persistedSize?: (number|Long|string|null); + + /** QueryWriteStatusResponse resource. */ + public resource?: (google.storage.v2.IObject|null); + + /** QueryWriteStatusResponse persistedDataChecksums. */ + public persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** QueryWriteStatusResponse writeStatus. */ + public writeStatus?: ("persistedSize"|"resource"); + + /** + * Creates a new QueryWriteStatusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryWriteStatusResponse instance + */ + public static create(properties?: google.storage.v2.IQueryWriteStatusResponse): google.storage.v2.QueryWriteStatusResponse; + + /** + * Encodes the specified QueryWriteStatusResponse message. Does not implicitly {@link google.storage.v2.QueryWriteStatusResponse.verify|verify} messages. + * @param message QueryWriteStatusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IQueryWriteStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryWriteStatusResponse message, length delimited. Does not implicitly {@link google.storage.v2.QueryWriteStatusResponse.verify|verify} messages. + * @param message QueryWriteStatusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IQueryWriteStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryWriteStatusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryWriteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.QueryWriteStatusResponse; + + /** + * Decodes a QueryWriteStatusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryWriteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.QueryWriteStatusResponse; + + /** + * Verifies a QueryWriteStatusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryWriteStatusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryWriteStatusResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.QueryWriteStatusResponse; + + /** + * Creates a plain object from a QueryWriteStatusResponse message. Also converts values to other types if specified. + * @param message QueryWriteStatusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.QueryWriteStatusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryWriteStatusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryWriteStatusResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RewriteObjectRequest. */ + interface IRewriteObjectRequest { + + /** RewriteObjectRequest destinationName */ + destinationName?: (string|null); + + /** RewriteObjectRequest destinationBucket */ + destinationBucket?: (string|null); + + /** RewriteObjectRequest destinationKmsKey */ + destinationKmsKey?: (string|null); + + /** RewriteObjectRequest destination */ + destination?: (google.storage.v2.IObject|null); + + /** RewriteObjectRequest sourceBucket */ + sourceBucket?: (string|null); + + /** RewriteObjectRequest sourceObject */ + sourceObject?: (string|null); + + /** RewriteObjectRequest sourceGeneration */ + sourceGeneration?: (number|Long|string|null); + + /** RewriteObjectRequest rewriteToken */ + rewriteToken?: (string|null); + + /** RewriteObjectRequest destinationPredefinedAcl */ + destinationPredefinedAcl?: (string|null); + + /** RewriteObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceGenerationMatch */ + ifSourceGenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceGenerationNotMatch */ + ifSourceGenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceMetagenerationMatch */ + ifSourceMetagenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceMetagenerationNotMatch */ + ifSourceMetagenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest maxBytesRewrittenPerCall */ + maxBytesRewrittenPerCall?: (number|Long|string|null); + + /** RewriteObjectRequest copySourceEncryptionAlgorithm */ + copySourceEncryptionAlgorithm?: (string|null); + + /** RewriteObjectRequest copySourceEncryptionKeyBytes */ + copySourceEncryptionKeyBytes?: (Uint8Array|Buffer|string|null); + + /** RewriteObjectRequest copySourceEncryptionKeySha256Bytes */ + copySourceEncryptionKeySha256Bytes?: (Uint8Array|Buffer|string|null); + + /** RewriteObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** RewriteObjectRequest objectChecksums */ + objectChecksums?: (google.storage.v2.IObjectChecksums|null); + } + + /** Represents a RewriteObjectRequest. */ + class RewriteObjectRequest implements IRewriteObjectRequest { + + /** + * Constructs a new RewriteObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IRewriteObjectRequest); + + /** RewriteObjectRequest destinationName. */ + public destinationName: string; + + /** RewriteObjectRequest destinationBucket. */ + public destinationBucket: string; + + /** RewriteObjectRequest destinationKmsKey. */ + public destinationKmsKey: string; + + /** RewriteObjectRequest destination. */ + public destination?: (google.storage.v2.IObject|null); + + /** RewriteObjectRequest sourceBucket. */ + public sourceBucket: string; + + /** RewriteObjectRequest sourceObject. */ + public sourceObject: string; + + /** RewriteObjectRequest sourceGeneration. */ + public sourceGeneration: (number|Long|string); + + /** RewriteObjectRequest rewriteToken. */ + public rewriteToken: string; + + /** RewriteObjectRequest destinationPredefinedAcl. */ + public destinationPredefinedAcl: string; + + /** RewriteObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceGenerationMatch. */ + public ifSourceGenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceGenerationNotMatch. */ + public ifSourceGenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceMetagenerationMatch. */ + public ifSourceMetagenerationMatch?: (number|Long|string|null); + + /** RewriteObjectRequest ifSourceMetagenerationNotMatch. */ + public ifSourceMetagenerationNotMatch?: (number|Long|string|null); + + /** RewriteObjectRequest maxBytesRewrittenPerCall. */ + public maxBytesRewrittenPerCall: (number|Long|string); + + /** RewriteObjectRequest copySourceEncryptionAlgorithm. */ + public copySourceEncryptionAlgorithm: string; + + /** RewriteObjectRequest copySourceEncryptionKeyBytes. */ + public copySourceEncryptionKeyBytes: (Uint8Array|Buffer|string); + + /** RewriteObjectRequest copySourceEncryptionKeySha256Bytes. */ + public copySourceEncryptionKeySha256Bytes: (Uint8Array|Buffer|string); + + /** RewriteObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** RewriteObjectRequest objectChecksums. */ + public objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** + * Creates a new RewriteObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriteObjectRequest instance + */ + public static create(properties?: google.storage.v2.IRewriteObjectRequest): google.storage.v2.RewriteObjectRequest; + + /** + * Encodes the specified RewriteObjectRequest message. Does not implicitly {@link google.storage.v2.RewriteObjectRequest.verify|verify} messages. + * @param message RewriteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IRewriteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.RewriteObjectRequest.verify|verify} messages. + * @param message RewriteObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IRewriteObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriteObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.RewriteObjectRequest; + + /** + * Decodes a RewriteObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.RewriteObjectRequest; + + /** + * Verifies a RewriteObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RewriteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriteObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.RewriteObjectRequest; + + /** + * Creates a plain object from a RewriteObjectRequest message. Also converts values to other types if specified. + * @param message RewriteObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.RewriteObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriteObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriteObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RewriteResponse. */ + interface IRewriteResponse { + + /** RewriteResponse totalBytesRewritten */ + totalBytesRewritten?: (number|Long|string|null); + + /** RewriteResponse objectSize */ + objectSize?: (number|Long|string|null); + + /** RewriteResponse done */ + done?: (boolean|null); + + /** RewriteResponse rewriteToken */ + rewriteToken?: (string|null); + + /** RewriteResponse resource */ + resource?: (google.storage.v2.IObject|null); + } + + /** Represents a RewriteResponse. */ + class RewriteResponse implements IRewriteResponse { + + /** + * Constructs a new RewriteResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IRewriteResponse); + + /** RewriteResponse totalBytesRewritten. */ + public totalBytesRewritten: (number|Long|string); + + /** RewriteResponse objectSize. */ + public objectSize: (number|Long|string); + + /** RewriteResponse done. */ + public done: boolean; + + /** RewriteResponse rewriteToken. */ + public rewriteToken: string; + + /** RewriteResponse resource. */ + public resource?: (google.storage.v2.IObject|null); + + /** + * Creates a new RewriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriteResponse instance + */ + public static create(properties?: google.storage.v2.IRewriteResponse): google.storage.v2.RewriteResponse; + + /** + * Encodes the specified RewriteResponse message. Does not implicitly {@link google.storage.v2.RewriteResponse.verify|verify} messages. + * @param message RewriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IRewriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriteResponse message, length delimited. Does not implicitly {@link google.storage.v2.RewriteResponse.verify|verify} messages. + * @param message RewriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IRewriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.RewriteResponse; + + /** + * Decodes a RewriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.RewriteResponse; + + /** + * Verifies a RewriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RewriteResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriteResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.RewriteResponse; + + /** + * Creates a plain object from a RewriteResponse message. Also converts values to other types if specified. + * @param message RewriteResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.RewriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriteResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriteResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveObjectRequest. */ + interface IMoveObjectRequest { + + /** MoveObjectRequest bucket */ + bucket?: (string|null); + + /** MoveObjectRequest sourceObject */ + sourceObject?: (string|null); + + /** MoveObjectRequest destinationObject */ + destinationObject?: (string|null); + + /** MoveObjectRequest ifSourceGenerationMatch */ + ifSourceGenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifSourceGenerationNotMatch */ + ifSourceGenerationNotMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifSourceMetagenerationMatch */ + ifSourceMetagenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifSourceMetagenerationNotMatch */ + ifSourceMetagenerationNotMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + } + + /** Represents a MoveObjectRequest. */ + class MoveObjectRequest implements IMoveObjectRequest { + + /** + * Constructs a new MoveObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IMoveObjectRequest); + + /** MoveObjectRequest bucket. */ + public bucket: string; + + /** MoveObjectRequest sourceObject. */ + public sourceObject: string; + + /** MoveObjectRequest destinationObject. */ + public destinationObject: string; + + /** MoveObjectRequest ifSourceGenerationMatch. */ + public ifSourceGenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifSourceGenerationNotMatch. */ + public ifSourceGenerationNotMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifSourceMetagenerationMatch. */ + public ifSourceMetagenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifSourceMetagenerationNotMatch. */ + public ifSourceMetagenerationNotMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** MoveObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** + * Creates a new MoveObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveObjectRequest instance + */ + public static create(properties?: google.storage.v2.IMoveObjectRequest): google.storage.v2.MoveObjectRequest; + + /** + * Encodes the specified MoveObjectRequest message. Does not implicitly {@link google.storage.v2.MoveObjectRequest.verify|verify} messages. + * @param message MoveObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IMoveObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.MoveObjectRequest.verify|verify} messages. + * @param message MoveObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IMoveObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.MoveObjectRequest; + + /** + * Decodes a MoveObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.MoveObjectRequest; + + /** + * Verifies a MoveObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.MoveObjectRequest; + + /** + * Creates a plain object from a MoveObjectRequest message. Also converts values to other types if specified. + * @param message MoveObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.MoveObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartResumableWriteRequest. */ + interface IStartResumableWriteRequest { + + /** StartResumableWriteRequest writeObjectSpec */ + writeObjectSpec?: (google.storage.v2.IWriteObjectSpec|null); + + /** StartResumableWriteRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** StartResumableWriteRequest objectChecksums */ + objectChecksums?: (google.storage.v2.IObjectChecksums|null); + } + + /** Represents a StartResumableWriteRequest. */ + class StartResumableWriteRequest implements IStartResumableWriteRequest { + + /** + * Constructs a new StartResumableWriteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IStartResumableWriteRequest); + + /** StartResumableWriteRequest writeObjectSpec. */ + public writeObjectSpec?: (google.storage.v2.IWriteObjectSpec|null); + + /** StartResumableWriteRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** StartResumableWriteRequest objectChecksums. */ + public objectChecksums?: (google.storage.v2.IObjectChecksums|null); + + /** + * Creates a new StartResumableWriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartResumableWriteRequest instance + */ + public static create(properties?: google.storage.v2.IStartResumableWriteRequest): google.storage.v2.StartResumableWriteRequest; + + /** + * Encodes the specified StartResumableWriteRequest message. Does not implicitly {@link google.storage.v2.StartResumableWriteRequest.verify|verify} messages. + * @param message StartResumableWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IStartResumableWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartResumableWriteRequest message, length delimited. Does not implicitly {@link google.storage.v2.StartResumableWriteRequest.verify|verify} messages. + * @param message StartResumableWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IStartResumableWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartResumableWriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.StartResumableWriteRequest; + + /** + * Decodes a StartResumableWriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.StartResumableWriteRequest; + + /** + * Verifies a StartResumableWriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartResumableWriteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartResumableWriteRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.StartResumableWriteRequest; + + /** + * Creates a plain object from a StartResumableWriteRequest message. Also converts values to other types if specified. + * @param message StartResumableWriteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.StartResumableWriteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartResumableWriteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartResumableWriteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartResumableWriteResponse. */ + interface IStartResumableWriteResponse { + + /** StartResumableWriteResponse uploadId */ + uploadId?: (string|null); + } + + /** Represents a StartResumableWriteResponse. */ + class StartResumableWriteResponse implements IStartResumableWriteResponse { + + /** + * Constructs a new StartResumableWriteResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IStartResumableWriteResponse); + + /** StartResumableWriteResponse uploadId. */ + public uploadId: string; + + /** + * Creates a new StartResumableWriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StartResumableWriteResponse instance + */ + public static create(properties?: google.storage.v2.IStartResumableWriteResponse): google.storage.v2.StartResumableWriteResponse; + + /** + * Encodes the specified StartResumableWriteResponse message. Does not implicitly {@link google.storage.v2.StartResumableWriteResponse.verify|verify} messages. + * @param message StartResumableWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IStartResumableWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartResumableWriteResponse message, length delimited. Does not implicitly {@link google.storage.v2.StartResumableWriteResponse.verify|verify} messages. + * @param message StartResumableWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IStartResumableWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartResumableWriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.StartResumableWriteResponse; + + /** + * Decodes a StartResumableWriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.StartResumableWriteResponse; + + /** + * Verifies a StartResumableWriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartResumableWriteResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartResumableWriteResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.StartResumableWriteResponse; + + /** + * Creates a plain object from a StartResumableWriteResponse message. Also converts values to other types if specified. + * @param message StartResumableWriteResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.StartResumableWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartResumableWriteResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartResumableWriteResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateObjectRequest. */ + interface IUpdateObjectRequest { + + /** UpdateObjectRequest object */ + object?: (google.storage.v2.IObject|null); + + /** UpdateObjectRequest ifGenerationMatch */ + ifGenerationMatch?: (number|Long|string|null); + + /** UpdateObjectRequest ifGenerationNotMatch */ + ifGenerationNotMatch?: (number|Long|string|null); + + /** UpdateObjectRequest ifMetagenerationMatch */ + ifMetagenerationMatch?: (number|Long|string|null); + + /** UpdateObjectRequest ifMetagenerationNotMatch */ + ifMetagenerationNotMatch?: (number|Long|string|null); + + /** UpdateObjectRequest predefinedAcl */ + predefinedAcl?: (string|null); + + /** UpdateObjectRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateObjectRequest commonObjectRequestParams */ + commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** UpdateObjectRequest overrideUnlockedRetention */ + overrideUnlockedRetention?: (boolean|null); + } + + /** Represents an UpdateObjectRequest. */ + class UpdateObjectRequest implements IUpdateObjectRequest { + + /** + * Constructs a new UpdateObjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IUpdateObjectRequest); + + /** UpdateObjectRequest object. */ + public object?: (google.storage.v2.IObject|null); + + /** UpdateObjectRequest ifGenerationMatch. */ + public ifGenerationMatch?: (number|Long|string|null); + + /** UpdateObjectRequest ifGenerationNotMatch. */ + public ifGenerationNotMatch?: (number|Long|string|null); + + /** UpdateObjectRequest ifMetagenerationMatch. */ + public ifMetagenerationMatch?: (number|Long|string|null); + + /** UpdateObjectRequest ifMetagenerationNotMatch. */ + public ifMetagenerationNotMatch?: (number|Long|string|null); + + /** UpdateObjectRequest predefinedAcl. */ + public predefinedAcl: string; + + /** UpdateObjectRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateObjectRequest commonObjectRequestParams. */ + public commonObjectRequestParams?: (google.storage.v2.ICommonObjectRequestParams|null); + + /** UpdateObjectRequest overrideUnlockedRetention. */ + public overrideUnlockedRetention: boolean; + + /** + * Creates a new UpdateObjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateObjectRequest instance + */ + public static create(properties?: google.storage.v2.IUpdateObjectRequest): google.storage.v2.UpdateObjectRequest; + + /** + * Encodes the specified UpdateObjectRequest message. Does not implicitly {@link google.storage.v2.UpdateObjectRequest.verify|verify} messages. + * @param message UpdateObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IUpdateObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.UpdateObjectRequest.verify|verify} messages. + * @param message UpdateObjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IUpdateObjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateObjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.UpdateObjectRequest; + + /** + * Decodes an UpdateObjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.UpdateObjectRequest; + + /** + * Verifies an UpdateObjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateObjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateObjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.UpdateObjectRequest; + + /** + * Creates a plain object from an UpdateObjectRequest message. Also converts values to other types if specified. + * @param message UpdateObjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.UpdateObjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateObjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateObjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonObjectRequestParams. */ + interface ICommonObjectRequestParams { + + /** CommonObjectRequestParams encryptionAlgorithm */ + encryptionAlgorithm?: (string|null); + + /** CommonObjectRequestParams encryptionKeyBytes */ + encryptionKeyBytes?: (Uint8Array|Buffer|string|null); + + /** CommonObjectRequestParams encryptionKeySha256Bytes */ + encryptionKeySha256Bytes?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CommonObjectRequestParams. */ + class CommonObjectRequestParams implements ICommonObjectRequestParams { + + /** + * Constructs a new CommonObjectRequestParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ICommonObjectRequestParams); + + /** CommonObjectRequestParams encryptionAlgorithm. */ + public encryptionAlgorithm: string; + + /** CommonObjectRequestParams encryptionKeyBytes. */ + public encryptionKeyBytes: (Uint8Array|Buffer|string); + + /** CommonObjectRequestParams encryptionKeySha256Bytes. */ + public encryptionKeySha256Bytes: (Uint8Array|Buffer|string); + + /** + * Creates a new CommonObjectRequestParams instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonObjectRequestParams instance + */ + public static create(properties?: google.storage.v2.ICommonObjectRequestParams): google.storage.v2.CommonObjectRequestParams; + + /** + * Encodes the specified CommonObjectRequestParams message. Does not implicitly {@link google.storage.v2.CommonObjectRequestParams.verify|verify} messages. + * @param message CommonObjectRequestParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ICommonObjectRequestParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonObjectRequestParams message, length delimited. Does not implicitly {@link google.storage.v2.CommonObjectRequestParams.verify|verify} messages. + * @param message CommonObjectRequestParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ICommonObjectRequestParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonObjectRequestParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonObjectRequestParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.CommonObjectRequestParams; + + /** + * Decodes a CommonObjectRequestParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonObjectRequestParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.CommonObjectRequestParams; + + /** + * Verifies a CommonObjectRequestParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonObjectRequestParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonObjectRequestParams + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.CommonObjectRequestParams; + + /** + * Creates a plain object from a CommonObjectRequestParams message. Also converts values to other types if specified. + * @param message CommonObjectRequestParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.CommonObjectRequestParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonObjectRequestParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonObjectRequestParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceConstants. */ + interface IServiceConstants { + } + + /** Represents a ServiceConstants. */ + class ServiceConstants implements IServiceConstants { + + /** + * Constructs a new ServiceConstants. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IServiceConstants); + + /** + * Creates a new ServiceConstants instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceConstants instance + */ + public static create(properties?: google.storage.v2.IServiceConstants): google.storage.v2.ServiceConstants; + + /** + * Encodes the specified ServiceConstants message. Does not implicitly {@link google.storage.v2.ServiceConstants.verify|verify} messages. + * @param message ServiceConstants message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IServiceConstants, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceConstants message, length delimited. Does not implicitly {@link google.storage.v2.ServiceConstants.verify|verify} messages. + * @param message ServiceConstants message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IServiceConstants, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceConstants message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceConstants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ServiceConstants; + + /** + * Decodes a ServiceConstants message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceConstants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ServiceConstants; + + /** + * Verifies a ServiceConstants message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceConstants message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceConstants + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ServiceConstants; + + /** + * Creates a plain object from a ServiceConstants message. Also converts values to other types if specified. + * @param message ServiceConstants + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ServiceConstants, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceConstants to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceConstants + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServiceConstants { + + /** Values enum. */ + enum Values { + VALUES_UNSPECIFIED = 0, + MAX_READ_CHUNK_BYTES = 2097152, + MAX_WRITE_CHUNK_BYTES = 2097152, + MAX_OBJECT_SIZE_MB = 5242880, + MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024, + MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096, + MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192, + MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480, + MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100, + MAX_LIFECYCLE_RULES_PER_BUCKET = 100, + MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5, + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256, + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024, + MAX_LABELS_ENTRIES_COUNT = 64, + MAX_LABELS_KEY_VALUE_LENGTH = 63, + MAX_LABELS_KEY_VALUE_BYTES = 128, + MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000, + SPLIT_TOKEN_MAX_VALID_DAYS = 14 + } + } + + /** Properties of a Bucket. */ + interface IBucket { + + /** Bucket name */ + name?: (string|null); + + /** Bucket bucketId */ + bucketId?: (string|null); + + /** Bucket etag */ + etag?: (string|null); + + /** Bucket project */ + project?: (string|null); + + /** Bucket metageneration */ + metageneration?: (number|Long|string|null); + + /** Bucket location */ + location?: (string|null); + + /** Bucket locationType */ + locationType?: (string|null); + + /** Bucket storageClass */ + storageClass?: (string|null); + + /** Bucket rpo */ + rpo?: (string|null); + + /** Bucket acl */ + acl?: (google.storage.v2.IBucketAccessControl[]|null); + + /** Bucket defaultObjectAcl */ + defaultObjectAcl?: (google.storage.v2.IObjectAccessControl[]|null); + + /** Bucket lifecycle */ + lifecycle?: (google.storage.v2.Bucket.ILifecycle|null); + + /** Bucket createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Bucket cors */ + cors?: (google.storage.v2.Bucket.ICors[]|null); + + /** Bucket updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Bucket defaultEventBasedHold */ + defaultEventBasedHold?: (boolean|null); + + /** Bucket labels */ + labels?: ({ [k: string]: string }|null); + + /** Bucket website */ + website?: (google.storage.v2.Bucket.IWebsite|null); + + /** Bucket versioning */ + versioning?: (google.storage.v2.Bucket.IVersioning|null); + + /** Bucket logging */ + logging?: (google.storage.v2.Bucket.ILogging|null); + + /** Bucket owner */ + owner?: (google.storage.v2.IOwner|null); + + /** Bucket encryption */ + encryption?: (google.storage.v2.Bucket.IEncryption|null); + + /** Bucket billing */ + billing?: (google.storage.v2.Bucket.IBilling|null); + + /** Bucket retentionPolicy */ + retentionPolicy?: (google.storage.v2.Bucket.IRetentionPolicy|null); + + /** Bucket iamConfig */ + iamConfig?: (google.storage.v2.Bucket.IIamConfig|null); + + /** Bucket satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Bucket customPlacementConfig */ + customPlacementConfig?: (google.storage.v2.Bucket.ICustomPlacementConfig|null); + + /** Bucket autoclass */ + autoclass?: (google.storage.v2.Bucket.IAutoclass|null); + + /** Bucket hierarchicalNamespace */ + hierarchicalNamespace?: (google.storage.v2.Bucket.IHierarchicalNamespace|null); + + /** Bucket softDeletePolicy */ + softDeletePolicy?: (google.storage.v2.Bucket.ISoftDeletePolicy|null); + + /** Bucket objectRetention */ + objectRetention?: (google.storage.v2.Bucket.IObjectRetention|null); + + /** Bucket ipFilter */ + ipFilter?: (google.storage.v2.Bucket.IIpFilter|null); + } + + /** Represents a Bucket. */ + class Bucket implements IBucket { + + /** + * Constructs a new Bucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBucket); + + /** Bucket name. */ + public name: string; + + /** Bucket bucketId. */ + public bucketId: string; + + /** Bucket etag. */ + public etag: string; + + /** Bucket project. */ + public project: string; + + /** Bucket metageneration. */ + public metageneration: (number|Long|string); + + /** Bucket location. */ + public location: string; + + /** Bucket locationType. */ + public locationType: string; + + /** Bucket storageClass. */ + public storageClass: string; + + /** Bucket rpo. */ + public rpo: string; + + /** Bucket acl. */ + public acl: google.storage.v2.IBucketAccessControl[]; + + /** Bucket defaultObjectAcl. */ + public defaultObjectAcl: google.storage.v2.IObjectAccessControl[]; + + /** Bucket lifecycle. */ + public lifecycle?: (google.storage.v2.Bucket.ILifecycle|null); + + /** Bucket createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Bucket cors. */ + public cors: google.storage.v2.Bucket.ICors[]; + + /** Bucket updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Bucket defaultEventBasedHold. */ + public defaultEventBasedHold: boolean; + + /** Bucket labels. */ + public labels: { [k: string]: string }; + + /** Bucket website. */ + public website?: (google.storage.v2.Bucket.IWebsite|null); + + /** Bucket versioning. */ + public versioning?: (google.storage.v2.Bucket.IVersioning|null); + + /** Bucket logging. */ + public logging?: (google.storage.v2.Bucket.ILogging|null); + + /** Bucket owner. */ + public owner?: (google.storage.v2.IOwner|null); + + /** Bucket encryption. */ + public encryption?: (google.storage.v2.Bucket.IEncryption|null); + + /** Bucket billing. */ + public billing?: (google.storage.v2.Bucket.IBilling|null); + + /** Bucket retentionPolicy. */ + public retentionPolicy?: (google.storage.v2.Bucket.IRetentionPolicy|null); + + /** Bucket iamConfig. */ + public iamConfig?: (google.storage.v2.Bucket.IIamConfig|null); + + /** Bucket satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Bucket customPlacementConfig. */ + public customPlacementConfig?: (google.storage.v2.Bucket.ICustomPlacementConfig|null); + + /** Bucket autoclass. */ + public autoclass?: (google.storage.v2.Bucket.IAutoclass|null); + + /** Bucket hierarchicalNamespace. */ + public hierarchicalNamespace?: (google.storage.v2.Bucket.IHierarchicalNamespace|null); + + /** Bucket softDeletePolicy. */ + public softDeletePolicy?: (google.storage.v2.Bucket.ISoftDeletePolicy|null); + + /** Bucket objectRetention. */ + public objectRetention?: (google.storage.v2.Bucket.IObjectRetention|null); + + /** Bucket ipFilter. */ + public ipFilter?: (google.storage.v2.Bucket.IIpFilter|null); + + /** + * Creates a new Bucket instance using the specified properties. + * @param [properties] Properties to set + * @returns Bucket instance + */ + public static create(properties?: google.storage.v2.IBucket): google.storage.v2.Bucket; + + /** + * Encodes the specified Bucket message. Does not implicitly {@link google.storage.v2.Bucket.verify|verify} messages. + * @param message Bucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.verify|verify} messages. + * @param message Bucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Bucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket; + + /** + * Decodes a Bucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket; + + /** + * Verifies a Bucket message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Bucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bucket + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket; + + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @param message Bucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Bucket { + + /** Properties of a Billing. */ + interface IBilling { + + /** Billing requesterPays */ + requesterPays?: (boolean|null); + } + + /** Represents a Billing. */ + class Billing implements IBilling { + + /** + * Constructs a new Billing. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IBilling); + + /** Billing requesterPays. */ + public requesterPays: boolean; + + /** + * Creates a new Billing instance using the specified properties. + * @param [properties] Properties to set + * @returns Billing instance + */ + public static create(properties?: google.storage.v2.Bucket.IBilling): google.storage.v2.Bucket.Billing; + + /** + * Encodes the specified Billing message. Does not implicitly {@link google.storage.v2.Bucket.Billing.verify|verify} messages. + * @param message Billing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IBilling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Billing message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Billing.verify|verify} messages. + * @param message Billing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IBilling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Billing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Billing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Billing; + + /** + * Decodes a Billing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Billing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Billing; + + /** + * Verifies a Billing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Billing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Billing + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Billing; + + /** + * Creates a plain object from a Billing message. Also converts values to other types if specified. + * @param message Billing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Billing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Billing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Billing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cors. */ + interface ICors { + + /** Cors origin */ + origin?: (string[]|null); + + /** Cors method */ + method?: (string[]|null); + + /** Cors responseHeader */ + responseHeader?: (string[]|null); + + /** Cors maxAgeSeconds */ + maxAgeSeconds?: (number|null); + } + + /** Represents a Cors. */ + class Cors implements ICors { + + /** + * Constructs a new Cors. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.ICors); + + /** Cors origin. */ + public origin: string[]; + + /** Cors method. */ + public method: string[]; + + /** Cors responseHeader. */ + public responseHeader: string[]; + + /** Cors maxAgeSeconds. */ + public maxAgeSeconds: number; + + /** + * Creates a new Cors instance using the specified properties. + * @param [properties] Properties to set + * @returns Cors instance + */ + public static create(properties?: google.storage.v2.Bucket.ICors): google.storage.v2.Bucket.Cors; + + /** + * Encodes the specified Cors message. Does not implicitly {@link google.storage.v2.Bucket.Cors.verify|verify} messages. + * @param message Cors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.ICors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cors message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Cors.verify|verify} messages. + * @param message Cors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.ICors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cors message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Cors; + + /** + * Decodes a Cors message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Cors; + + /** + * Verifies a Cors message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cors message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cors + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Cors; + + /** + * Creates a plain object from a Cors message. Also converts values to other types if specified. + * @param message Cors + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Cors, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cors to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cors + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Encryption. */ + interface IEncryption { + + /** Encryption defaultKmsKey */ + defaultKmsKey?: (string|null); + + /** Encryption googleManagedEncryptionEnforcementConfig */ + googleManagedEncryptionEnforcementConfig?: (google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig|null); + + /** Encryption customerManagedEncryptionEnforcementConfig */ + customerManagedEncryptionEnforcementConfig?: (google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig|null); + + /** Encryption customerSuppliedEncryptionEnforcementConfig */ + customerSuppliedEncryptionEnforcementConfig?: (google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig|null); + } + + /** Represents an Encryption. */ + class Encryption implements IEncryption { + + /** + * Constructs a new Encryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IEncryption); + + /** Encryption defaultKmsKey. */ + public defaultKmsKey: string; + + /** Encryption googleManagedEncryptionEnforcementConfig. */ + public googleManagedEncryptionEnforcementConfig?: (google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig|null); + + /** Encryption customerManagedEncryptionEnforcementConfig. */ + public customerManagedEncryptionEnforcementConfig?: (google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig|null); + + /** Encryption customerSuppliedEncryptionEnforcementConfig. */ + public customerSuppliedEncryptionEnforcementConfig?: (google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig|null); + + /** + * Creates a new Encryption instance using the specified properties. + * @param [properties] Properties to set + * @returns Encryption instance + */ + public static create(properties?: google.storage.v2.Bucket.IEncryption): google.storage.v2.Bucket.Encryption; + + /** + * Encodes the specified Encryption message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.verify|verify} messages. + * @param message Encryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encryption message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.verify|verify} messages. + * @param message Encryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Encryption; + + /** + * Decodes an Encryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Encryption; + + /** + * Verifies an Encryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encryption + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Encryption; + + /** + * Creates a plain object from an Encryption message. Also converts values to other types if specified. + * @param message Encryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Encryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encryption { + + /** Properties of a GoogleManagedEncryptionEnforcementConfig. */ + interface IGoogleManagedEncryptionEnforcementConfig { + + /** GoogleManagedEncryptionEnforcementConfig restrictionMode */ + restrictionMode?: (string|null); + + /** GoogleManagedEncryptionEnforcementConfig effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GoogleManagedEncryptionEnforcementConfig. */ + class GoogleManagedEncryptionEnforcementConfig implements IGoogleManagedEncryptionEnforcementConfig { + + /** + * Constructs a new GoogleManagedEncryptionEnforcementConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig); + + /** GoogleManagedEncryptionEnforcementConfig restrictionMode. */ + public restrictionMode?: (string|null); + + /** GoogleManagedEncryptionEnforcementConfig effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GoogleManagedEncryptionEnforcementConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleManagedEncryptionEnforcementConfig instance + */ + public static create(properties?: google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig): google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig; + + /** + * Encodes the specified GoogleManagedEncryptionEnforcementConfig message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.verify|verify} messages. + * @param message GoogleManagedEncryptionEnforcementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleManagedEncryptionEnforcementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.verify|verify} messages. + * @param message GoogleManagedEncryptionEnforcementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleManagedEncryptionEnforcementConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig; + + /** + * Decodes a GoogleManagedEncryptionEnforcementConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig; + + /** + * Verifies a GoogleManagedEncryptionEnforcementConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleManagedEncryptionEnforcementConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleManagedEncryptionEnforcementConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig; + + /** + * Creates a plain object from a GoogleManagedEncryptionEnforcementConfig message. Also converts values to other types if specified. + * @param message GoogleManagedEncryptionEnforcementConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleManagedEncryptionEnforcementConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleManagedEncryptionEnforcementConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerManagedEncryptionEnforcementConfig. */ + interface ICustomerManagedEncryptionEnforcementConfig { + + /** CustomerManagedEncryptionEnforcementConfig restrictionMode */ + restrictionMode?: (string|null); + + /** CustomerManagedEncryptionEnforcementConfig effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CustomerManagedEncryptionEnforcementConfig. */ + class CustomerManagedEncryptionEnforcementConfig implements ICustomerManagedEncryptionEnforcementConfig { + + /** + * Constructs a new CustomerManagedEncryptionEnforcementConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig); + + /** CustomerManagedEncryptionEnforcementConfig restrictionMode. */ + public restrictionMode?: (string|null); + + /** CustomerManagedEncryptionEnforcementConfig effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CustomerManagedEncryptionEnforcementConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerManagedEncryptionEnforcementConfig instance + */ + public static create(properties?: google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig): google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig; + + /** + * Encodes the specified CustomerManagedEncryptionEnforcementConfig message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.verify|verify} messages. + * @param message CustomerManagedEncryptionEnforcementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerManagedEncryptionEnforcementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.verify|verify} messages. + * @param message CustomerManagedEncryptionEnforcementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerManagedEncryptionEnforcementConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig; + + /** + * Decodes a CustomerManagedEncryptionEnforcementConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig; + + /** + * Verifies a CustomerManagedEncryptionEnforcementConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerManagedEncryptionEnforcementConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerManagedEncryptionEnforcementConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig; + + /** + * Creates a plain object from a CustomerManagedEncryptionEnforcementConfig message. Also converts values to other types if specified. + * @param message CustomerManagedEncryptionEnforcementConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerManagedEncryptionEnforcementConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerManagedEncryptionEnforcementConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerSuppliedEncryptionEnforcementConfig. */ + interface ICustomerSuppliedEncryptionEnforcementConfig { + + /** CustomerSuppliedEncryptionEnforcementConfig restrictionMode */ + restrictionMode?: (string|null); + + /** CustomerSuppliedEncryptionEnforcementConfig effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CustomerSuppliedEncryptionEnforcementConfig. */ + class CustomerSuppliedEncryptionEnforcementConfig implements ICustomerSuppliedEncryptionEnforcementConfig { + + /** + * Constructs a new CustomerSuppliedEncryptionEnforcementConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig); + + /** CustomerSuppliedEncryptionEnforcementConfig restrictionMode. */ + public restrictionMode?: (string|null); + + /** CustomerSuppliedEncryptionEnforcementConfig effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CustomerSuppliedEncryptionEnforcementConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerSuppliedEncryptionEnforcementConfig instance + */ + public static create(properties?: google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig): google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig; + + /** + * Encodes the specified CustomerSuppliedEncryptionEnforcementConfig message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.verify|verify} messages. + * @param message CustomerSuppliedEncryptionEnforcementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerSuppliedEncryptionEnforcementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.verify|verify} messages. + * @param message CustomerSuppliedEncryptionEnforcementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerSuppliedEncryptionEnforcementConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerSuppliedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig; + + /** + * Decodes a CustomerSuppliedEncryptionEnforcementConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerSuppliedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig; + + /** + * Verifies a CustomerSuppliedEncryptionEnforcementConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerSuppliedEncryptionEnforcementConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerSuppliedEncryptionEnforcementConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig; + + /** + * Creates a plain object from a CustomerSuppliedEncryptionEnforcementConfig message. Also converts values to other types if specified. + * @param message CustomerSuppliedEncryptionEnforcementConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerSuppliedEncryptionEnforcementConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerSuppliedEncryptionEnforcementConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IamConfig. */ + interface IIamConfig { + + /** IamConfig uniformBucketLevelAccess */ + uniformBucketLevelAccess?: (google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess|null); + + /** IamConfig publicAccessPrevention */ + publicAccessPrevention?: (string|null); + } + + /** Represents an IamConfig. */ + class IamConfig implements IIamConfig { + + /** + * Constructs a new IamConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IIamConfig); + + /** IamConfig uniformBucketLevelAccess. */ + public uniformBucketLevelAccess?: (google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess|null); + + /** IamConfig publicAccessPrevention. */ + public publicAccessPrevention: string; + + /** + * Creates a new IamConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IamConfig instance + */ + public static create(properties?: google.storage.v2.Bucket.IIamConfig): google.storage.v2.Bucket.IamConfig; + + /** + * Encodes the specified IamConfig message. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.verify|verify} messages. + * @param message IamConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IIamConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.verify|verify} messages. + * @param message IamConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IIamConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.IamConfig; + + /** + * Decodes an IamConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.IamConfig; + + /** + * Verifies an IamConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.IamConfig; + + /** + * Creates a plain object from an IamConfig message. Also converts values to other types if specified. + * @param message IamConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.IamConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IamConfig { + + /** Properties of an UniformBucketLevelAccess. */ + interface IUniformBucketLevelAccess { + + /** UniformBucketLevelAccess enabled */ + enabled?: (boolean|null); + + /** UniformBucketLevelAccess lockTime */ + lockTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UniformBucketLevelAccess. */ + class UniformBucketLevelAccess implements IUniformBucketLevelAccess { + + /** + * Constructs a new UniformBucketLevelAccess. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess); + + /** UniformBucketLevelAccess enabled. */ + public enabled: boolean; + + /** UniformBucketLevelAccess lockTime. */ + public lockTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UniformBucketLevelAccess instance using the specified properties. + * @param [properties] Properties to set + * @returns UniformBucketLevelAccess instance + */ + public static create(properties?: google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess): google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess; + + /** + * Encodes the specified UniformBucketLevelAccess message. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.verify|verify} messages. + * @param message UniformBucketLevelAccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UniformBucketLevelAccess message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.verify|verify} messages. + * @param message UniformBucketLevelAccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UniformBucketLevelAccess message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UniformBucketLevelAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess; + + /** + * Decodes an UniformBucketLevelAccess message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UniformBucketLevelAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess; + + /** + * Verifies an UniformBucketLevelAccess message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UniformBucketLevelAccess message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UniformBucketLevelAccess + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess; + + /** + * Creates a plain object from an UniformBucketLevelAccess message. Also converts values to other types if specified. + * @param message UniformBucketLevelAccess + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UniformBucketLevelAccess to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UniformBucketLevelAccess + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Lifecycle. */ + interface ILifecycle { + + /** Lifecycle rule */ + rule?: (google.storage.v2.Bucket.Lifecycle.IRule[]|null); + } + + /** Represents a Lifecycle. */ + class Lifecycle implements ILifecycle { + + /** + * Constructs a new Lifecycle. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.ILifecycle); + + /** Lifecycle rule. */ + public rule: google.storage.v2.Bucket.Lifecycle.IRule[]; + + /** + * Creates a new Lifecycle instance using the specified properties. + * @param [properties] Properties to set + * @returns Lifecycle instance + */ + public static create(properties?: google.storage.v2.Bucket.ILifecycle): google.storage.v2.Bucket.Lifecycle; + + /** + * Encodes the specified Lifecycle message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.verify|verify} messages. + * @param message Lifecycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.ILifecycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Lifecycle message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.verify|verify} messages. + * @param message Lifecycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.ILifecycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Lifecycle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Lifecycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Lifecycle; + + /** + * Decodes a Lifecycle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Lifecycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Lifecycle; + + /** + * Verifies a Lifecycle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Lifecycle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Lifecycle + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Lifecycle; + + /** + * Creates a plain object from a Lifecycle message. Also converts values to other types if specified. + * @param message Lifecycle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Lifecycle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Lifecycle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Lifecycle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Lifecycle { + + /** Properties of a Rule. */ + interface IRule { + + /** Rule action */ + action?: (google.storage.v2.Bucket.Lifecycle.Rule.IAction|null); + + /** Rule condition */ + condition?: (google.storage.v2.Bucket.Lifecycle.Rule.ICondition|null); + } + + /** Represents a Rule. */ + class Rule implements IRule { + + /** + * Constructs a new Rule. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.Lifecycle.IRule); + + /** Rule action. */ + public action?: (google.storage.v2.Bucket.Lifecycle.Rule.IAction|null); + + /** Rule condition. */ + public condition?: (google.storage.v2.Bucket.Lifecycle.Rule.ICondition|null); + + /** + * Creates a new Rule instance using the specified properties. + * @param [properties] Properties to set + * @returns Rule instance + */ + public static create(properties?: google.storage.v2.Bucket.Lifecycle.IRule): google.storage.v2.Bucket.Lifecycle.Rule; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.Lifecycle.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.Lifecycle.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Lifecycle.Rule; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Lifecycle.Rule; + + /** + * Verifies a Rule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rule + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Lifecycle.Rule; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Lifecycle.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Rule { + + /** Properties of an Action. */ + interface IAction { + + /** Action type */ + type?: (string|null); + + /** Action storageClass */ + storageClass?: (string|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.Lifecycle.Rule.IAction); + + /** Action type. */ + public type: string; + + /** Action storageClass. */ + public storageClass: string; + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.storage.v2.Bucket.Lifecycle.Rule.IAction): google.storage.v2.Bucket.Lifecycle.Rule.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.Lifecycle.Rule.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.Lifecycle.Rule.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Lifecycle.Rule.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Lifecycle.Rule.Action; + + /** + * Verifies an Action message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Lifecycle.Rule.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Lifecycle.Rule.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition ageDays */ + ageDays?: (number|null); + + /** Condition createdBefore */ + createdBefore?: (google.type.IDate|null); + + /** Condition isLive */ + isLive?: (boolean|null); + + /** Condition numNewerVersions */ + numNewerVersions?: (number|null); + + /** Condition matchesStorageClass */ + matchesStorageClass?: (string[]|null); + + /** Condition daysSinceCustomTime */ + daysSinceCustomTime?: (number|null); + + /** Condition customTimeBefore */ + customTimeBefore?: (google.type.IDate|null); + + /** Condition daysSinceNoncurrentTime */ + daysSinceNoncurrentTime?: (number|null); + + /** Condition noncurrentTimeBefore */ + noncurrentTimeBefore?: (google.type.IDate|null); + + /** Condition matchesPrefix */ + matchesPrefix?: (string[]|null); + + /** Condition matchesSuffix */ + matchesSuffix?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.Lifecycle.Rule.ICondition); + + /** Condition ageDays. */ + public ageDays?: (number|null); + + /** Condition createdBefore. */ + public createdBefore?: (google.type.IDate|null); + + /** Condition isLive. */ + public isLive?: (boolean|null); + + /** Condition numNewerVersions. */ + public numNewerVersions?: (number|null); + + /** Condition matchesStorageClass. */ + public matchesStorageClass: string[]; + + /** Condition daysSinceCustomTime. */ + public daysSinceCustomTime?: (number|null); + + /** Condition customTimeBefore. */ + public customTimeBefore?: (google.type.IDate|null); + + /** Condition daysSinceNoncurrentTime. */ + public daysSinceNoncurrentTime?: (number|null); + + /** Condition noncurrentTimeBefore. */ + public noncurrentTimeBefore?: (google.type.IDate|null); + + /** Condition matchesPrefix. */ + public matchesPrefix: string[]; + + /** Condition matchesSuffix. */ + public matchesSuffix: string[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.storage.v2.Bucket.Lifecycle.Rule.ICondition): google.storage.v2.Bucket.Lifecycle.Rule.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.Lifecycle.Rule.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.Lifecycle.Rule.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Lifecycle.Rule.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Lifecycle.Rule.Condition; + + /** + * Verifies a Condition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Lifecycle.Rule.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Lifecycle.Rule.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Logging. */ + interface ILogging { + + /** Logging logBucket */ + logBucket?: (string|null); + + /** Logging logObjectPrefix */ + logObjectPrefix?: (string|null); + } + + /** Represents a Logging. */ + class Logging implements ILogging { + + /** + * Constructs a new Logging. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.ILogging); + + /** Logging logBucket. */ + public logBucket: string; + + /** Logging logObjectPrefix. */ + public logObjectPrefix: string; + + /** + * Creates a new Logging instance using the specified properties. + * @param [properties] Properties to set + * @returns Logging instance + */ + public static create(properties?: google.storage.v2.Bucket.ILogging): google.storage.v2.Bucket.Logging; + + /** + * Encodes the specified Logging message. Does not implicitly {@link google.storage.v2.Bucket.Logging.verify|verify} messages. + * @param message Logging message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.ILogging, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Logging message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Logging.verify|verify} messages. + * @param message Logging message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.ILogging, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Logging message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Logging + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Logging; + + /** + * Decodes a Logging message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Logging + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Logging; + + /** + * Verifies a Logging message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Logging message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Logging + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Logging; + + /** + * Creates a plain object from a Logging message. Also converts values to other types if specified. + * @param message Logging + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Logging, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Logging to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Logging + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectRetention. */ + interface IObjectRetention { + + /** ObjectRetention enabled */ + enabled?: (boolean|null); + } + + /** Represents an ObjectRetention. */ + class ObjectRetention implements IObjectRetention { + + /** + * Constructs a new ObjectRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IObjectRetention); + + /** ObjectRetention enabled. */ + public enabled: boolean; + + /** + * Creates a new ObjectRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectRetention instance + */ + public static create(properties?: google.storage.v2.Bucket.IObjectRetention): google.storage.v2.Bucket.ObjectRetention; + + /** + * Encodes the specified ObjectRetention message. Does not implicitly {@link google.storage.v2.Bucket.ObjectRetention.verify|verify} messages. + * @param message ObjectRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IObjectRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectRetention message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.ObjectRetention.verify|verify} messages. + * @param message ObjectRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IObjectRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.ObjectRetention; + + /** + * Decodes an ObjectRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.ObjectRetention; + + /** + * Verifies an ObjectRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectRetention + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.ObjectRetention; + + /** + * Creates a plain object from an ObjectRetention message. Also converts values to other types if specified. + * @param message ObjectRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.ObjectRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetentionPolicy. */ + interface IRetentionPolicy { + + /** RetentionPolicy effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + + /** RetentionPolicy isLocked */ + isLocked?: (boolean|null); + + /** RetentionPolicy retentionDuration */ + retentionDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a RetentionPolicy. */ + class RetentionPolicy implements IRetentionPolicy { + + /** + * Constructs a new RetentionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IRetentionPolicy); + + /** RetentionPolicy effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** RetentionPolicy isLocked. */ + public isLocked: boolean; + + /** RetentionPolicy retentionDuration. */ + public retentionDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new RetentionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetentionPolicy instance + */ + public static create(properties?: google.storage.v2.Bucket.IRetentionPolicy): google.storage.v2.Bucket.RetentionPolicy; + + /** + * Encodes the specified RetentionPolicy message. Does not implicitly {@link google.storage.v2.Bucket.RetentionPolicy.verify|verify} messages. + * @param message RetentionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IRetentionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetentionPolicy message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.RetentionPolicy.verify|verify} messages. + * @param message RetentionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IRetentionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.RetentionPolicy; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.RetentionPolicy; + + /** + * Verifies a RetentionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetentionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetentionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.RetentionPolicy; + + /** + * Creates a plain object from a RetentionPolicy message. Also converts values to other types if specified. + * @param message RetentionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.RetentionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetentionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetentionPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SoftDeletePolicy. */ + interface ISoftDeletePolicy { + + /** SoftDeletePolicy retentionDuration */ + retentionDuration?: (google.protobuf.IDuration|null); + + /** SoftDeletePolicy effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SoftDeletePolicy. */ + class SoftDeletePolicy implements ISoftDeletePolicy { + + /** + * Constructs a new SoftDeletePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.ISoftDeletePolicy); + + /** SoftDeletePolicy retentionDuration. */ + public retentionDuration?: (google.protobuf.IDuration|null); + + /** SoftDeletePolicy effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SoftDeletePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftDeletePolicy instance + */ + public static create(properties?: google.storage.v2.Bucket.ISoftDeletePolicy): google.storage.v2.Bucket.SoftDeletePolicy; + + /** + * Encodes the specified SoftDeletePolicy message. Does not implicitly {@link google.storage.v2.Bucket.SoftDeletePolicy.verify|verify} messages. + * @param message SoftDeletePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.ISoftDeletePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftDeletePolicy message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.SoftDeletePolicy.verify|verify} messages. + * @param message SoftDeletePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.ISoftDeletePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftDeletePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftDeletePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.SoftDeletePolicy; + + /** + * Decodes a SoftDeletePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftDeletePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.SoftDeletePolicy; + + /** + * Verifies a SoftDeletePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoftDeletePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftDeletePolicy + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.SoftDeletePolicy; + + /** + * Creates a plain object from a SoftDeletePolicy message. Also converts values to other types if specified. + * @param message SoftDeletePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.SoftDeletePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftDeletePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftDeletePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Versioning. */ + interface IVersioning { + + /** Versioning enabled */ + enabled?: (boolean|null); + } + + /** Represents a Versioning. */ + class Versioning implements IVersioning { + + /** + * Constructs a new Versioning. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IVersioning); + + /** Versioning enabled. */ + public enabled: boolean; + + /** + * Creates a new Versioning instance using the specified properties. + * @param [properties] Properties to set + * @returns Versioning instance + */ + public static create(properties?: google.storage.v2.Bucket.IVersioning): google.storage.v2.Bucket.Versioning; + + /** + * Encodes the specified Versioning message. Does not implicitly {@link google.storage.v2.Bucket.Versioning.verify|verify} messages. + * @param message Versioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IVersioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Versioning message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Versioning.verify|verify} messages. + * @param message Versioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IVersioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Versioning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Versioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Versioning; + + /** + * Decodes a Versioning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Versioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Versioning; + + /** + * Verifies a Versioning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Versioning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Versioning + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Versioning; + + /** + * Creates a plain object from a Versioning message. Also converts values to other types if specified. + * @param message Versioning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Versioning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Versioning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Versioning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Website. */ + interface IWebsite { + + /** Website mainPageSuffix */ + mainPageSuffix?: (string|null); + + /** Website notFoundPage */ + notFoundPage?: (string|null); + } + + /** Represents a Website. */ + class Website implements IWebsite { + + /** + * Constructs a new Website. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IWebsite); + + /** Website mainPageSuffix. */ + public mainPageSuffix: string; + + /** Website notFoundPage. */ + public notFoundPage: string; + + /** + * Creates a new Website instance using the specified properties. + * @param [properties] Properties to set + * @returns Website instance + */ + public static create(properties?: google.storage.v2.Bucket.IWebsite): google.storage.v2.Bucket.Website; + + /** + * Encodes the specified Website message. Does not implicitly {@link google.storage.v2.Bucket.Website.verify|verify} messages. + * @param message Website message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IWebsite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Website message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Website.verify|verify} messages. + * @param message Website message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IWebsite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Website message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Website + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Website; + + /** + * Decodes a Website message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Website + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Website; + + /** + * Verifies a Website message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Website message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Website + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Website; + + /** + * Creates a plain object from a Website message. Also converts values to other types if specified. + * @param message Website + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Website, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Website to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Website + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomPlacementConfig. */ + interface ICustomPlacementConfig { + + /** CustomPlacementConfig dataLocations */ + dataLocations?: (string[]|null); + } + + /** Represents a CustomPlacementConfig. */ + class CustomPlacementConfig implements ICustomPlacementConfig { + + /** + * Constructs a new CustomPlacementConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.ICustomPlacementConfig); + + /** CustomPlacementConfig dataLocations. */ + public dataLocations: string[]; + + /** + * Creates a new CustomPlacementConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomPlacementConfig instance + */ + public static create(properties?: google.storage.v2.Bucket.ICustomPlacementConfig): google.storage.v2.Bucket.CustomPlacementConfig; + + /** + * Encodes the specified CustomPlacementConfig message. Does not implicitly {@link google.storage.v2.Bucket.CustomPlacementConfig.verify|verify} messages. + * @param message CustomPlacementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.ICustomPlacementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomPlacementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.CustomPlacementConfig.verify|verify} messages. + * @param message CustomPlacementConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.ICustomPlacementConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.CustomPlacementConfig; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.CustomPlacementConfig; + + /** + * Verifies a CustomPlacementConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomPlacementConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomPlacementConfig + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.CustomPlacementConfig; + + /** + * Creates a plain object from a CustomPlacementConfig message. Also converts values to other types if specified. + * @param message CustomPlacementConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.CustomPlacementConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomPlacementConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomPlacementConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Autoclass. */ + interface IAutoclass { + + /** Autoclass enabled */ + enabled?: (boolean|null); + + /** Autoclass toggleTime */ + toggleTime?: (google.protobuf.ITimestamp|null); + + /** Autoclass terminalStorageClass */ + terminalStorageClass?: (string|null); + + /** Autoclass terminalStorageClassUpdateTime */ + terminalStorageClassUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Autoclass. */ + class Autoclass implements IAutoclass { + + /** + * Constructs a new Autoclass. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IAutoclass); + + /** Autoclass enabled. */ + public enabled: boolean; + + /** Autoclass toggleTime. */ + public toggleTime?: (google.protobuf.ITimestamp|null); + + /** Autoclass terminalStorageClass. */ + public terminalStorageClass?: (string|null); + + /** Autoclass terminalStorageClassUpdateTime. */ + public terminalStorageClassUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Autoclass instance using the specified properties. + * @param [properties] Properties to set + * @returns Autoclass instance + */ + public static create(properties?: google.storage.v2.Bucket.IAutoclass): google.storage.v2.Bucket.Autoclass; + + /** + * Encodes the specified Autoclass message. Does not implicitly {@link google.storage.v2.Bucket.Autoclass.verify|verify} messages. + * @param message Autoclass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IAutoclass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Autoclass message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Autoclass.verify|verify} messages. + * @param message Autoclass message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IAutoclass, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Autoclass message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Autoclass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.Autoclass; + + /** + * Decodes an Autoclass message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Autoclass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.Autoclass; + + /** + * Verifies an Autoclass message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Autoclass message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Autoclass + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.Autoclass; + + /** + * Creates a plain object from an Autoclass message. Also converts values to other types if specified. + * @param message Autoclass + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.Autoclass, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Autoclass to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Autoclass + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IpFilter. */ + interface IIpFilter { + + /** IpFilter mode */ + mode?: (string|null); + + /** IpFilter publicNetworkSource */ + publicNetworkSource?: (google.storage.v2.Bucket.IpFilter.IPublicNetworkSource|null); + + /** IpFilter vpcNetworkSources */ + vpcNetworkSources?: (google.storage.v2.Bucket.IpFilter.IVpcNetworkSource[]|null); + + /** IpFilter allowCrossOrgVpcs */ + allowCrossOrgVpcs?: (boolean|null); + + /** IpFilter allowAllServiceAgentAccess */ + allowAllServiceAgentAccess?: (boolean|null); + } + + /** Represents an IpFilter. */ + class IpFilter implements IIpFilter { + + /** + * Constructs a new IpFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IIpFilter); + + /** IpFilter mode. */ + public mode?: (string|null); + + /** IpFilter publicNetworkSource. */ + public publicNetworkSource?: (google.storage.v2.Bucket.IpFilter.IPublicNetworkSource|null); + + /** IpFilter vpcNetworkSources. */ + public vpcNetworkSources: google.storage.v2.Bucket.IpFilter.IVpcNetworkSource[]; + + /** IpFilter allowCrossOrgVpcs. */ + public allowCrossOrgVpcs: boolean; + + /** IpFilter allowAllServiceAgentAccess. */ + public allowAllServiceAgentAccess?: (boolean|null); + + /** + * Creates a new IpFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns IpFilter instance + */ + public static create(properties?: google.storage.v2.Bucket.IIpFilter): google.storage.v2.Bucket.IpFilter; + + /** + * Encodes the specified IpFilter message. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.verify|verify} messages. + * @param message IpFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IIpFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IpFilter message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.verify|verify} messages. + * @param message IpFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IIpFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IpFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IpFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.IpFilter; + + /** + * Decodes an IpFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IpFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.IpFilter; + + /** + * Verifies an IpFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IpFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IpFilter + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.IpFilter; + + /** + * Creates a plain object from an IpFilter message. Also converts values to other types if specified. + * @param message IpFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.IpFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IpFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IpFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IpFilter { + + /** Properties of a PublicNetworkSource. */ + interface IPublicNetworkSource { + + /** PublicNetworkSource allowedIpCidrRanges */ + allowedIpCidrRanges?: (string[]|null); + } + + /** Represents a PublicNetworkSource. */ + class PublicNetworkSource implements IPublicNetworkSource { + + /** + * Constructs a new PublicNetworkSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IpFilter.IPublicNetworkSource); + + /** PublicNetworkSource allowedIpCidrRanges. */ + public allowedIpCidrRanges: string[]; + + /** + * Creates a new PublicNetworkSource instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicNetworkSource instance + */ + public static create(properties?: google.storage.v2.Bucket.IpFilter.IPublicNetworkSource): google.storage.v2.Bucket.IpFilter.PublicNetworkSource; + + /** + * Encodes the specified PublicNetworkSource message. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.PublicNetworkSource.verify|verify} messages. + * @param message PublicNetworkSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IpFilter.IPublicNetworkSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicNetworkSource message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.PublicNetworkSource.verify|verify} messages. + * @param message PublicNetworkSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IpFilter.IPublicNetworkSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicNetworkSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.IpFilter.PublicNetworkSource; + + /** + * Decodes a PublicNetworkSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.IpFilter.PublicNetworkSource; + + /** + * Verifies a PublicNetworkSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicNetworkSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicNetworkSource + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.IpFilter.PublicNetworkSource; + + /** + * Creates a plain object from a PublicNetworkSource message. Also converts values to other types if specified. + * @param message PublicNetworkSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.IpFilter.PublicNetworkSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicNetworkSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublicNetworkSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VpcNetworkSource. */ + interface IVpcNetworkSource { + + /** VpcNetworkSource network */ + network?: (string|null); + + /** VpcNetworkSource allowedIpCidrRanges */ + allowedIpCidrRanges?: (string[]|null); + } + + /** Represents a VpcNetworkSource. */ + class VpcNetworkSource implements IVpcNetworkSource { + + /** + * Constructs a new VpcNetworkSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IpFilter.IVpcNetworkSource); + + /** VpcNetworkSource network. */ + public network?: (string|null); + + /** VpcNetworkSource allowedIpCidrRanges. */ + public allowedIpCidrRanges: string[]; + + /** + * Creates a new VpcNetworkSource instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcNetworkSource instance + */ + public static create(properties?: google.storage.v2.Bucket.IpFilter.IVpcNetworkSource): google.storage.v2.Bucket.IpFilter.VpcNetworkSource; + + /** + * Encodes the specified VpcNetworkSource message. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.VpcNetworkSource.verify|verify} messages. + * @param message VpcNetworkSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IpFilter.IVpcNetworkSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcNetworkSource message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.VpcNetworkSource.verify|verify} messages. + * @param message VpcNetworkSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IpFilter.IVpcNetworkSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcNetworkSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.IpFilter.VpcNetworkSource; + + /** + * Decodes a VpcNetworkSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.IpFilter.VpcNetworkSource; + + /** + * Verifies a VpcNetworkSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcNetworkSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcNetworkSource + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.IpFilter.VpcNetworkSource; + + /** + * Creates a plain object from a VpcNetworkSource message. Also converts values to other types if specified. + * @param message VpcNetworkSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.IpFilter.VpcNetworkSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcNetworkSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcNetworkSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a HierarchicalNamespace. */ + interface IHierarchicalNamespace { + + /** HierarchicalNamespace enabled */ + enabled?: (boolean|null); + } + + /** Represents a HierarchicalNamespace. */ + class HierarchicalNamespace implements IHierarchicalNamespace { + + /** + * Constructs a new HierarchicalNamespace. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Bucket.IHierarchicalNamespace); + + /** HierarchicalNamespace enabled. */ + public enabled: boolean; + + /** + * Creates a new HierarchicalNamespace instance using the specified properties. + * @param [properties] Properties to set + * @returns HierarchicalNamespace instance + */ + public static create(properties?: google.storage.v2.Bucket.IHierarchicalNamespace): google.storage.v2.Bucket.HierarchicalNamespace; + + /** + * Encodes the specified HierarchicalNamespace message. Does not implicitly {@link google.storage.v2.Bucket.HierarchicalNamespace.verify|verify} messages. + * @param message HierarchicalNamespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Bucket.IHierarchicalNamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HierarchicalNamespace message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.HierarchicalNamespace.verify|verify} messages. + * @param message HierarchicalNamespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Bucket.IHierarchicalNamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Bucket.HierarchicalNamespace; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Bucket.HierarchicalNamespace; + + /** + * Verifies a HierarchicalNamespace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HierarchicalNamespace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HierarchicalNamespace + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Bucket.HierarchicalNamespace; + + /** + * Creates a plain object from a HierarchicalNamespace message. Also converts values to other types if specified. + * @param message HierarchicalNamespace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Bucket.HierarchicalNamespace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HierarchicalNamespace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HierarchicalNamespace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BucketAccessControl. */ + interface IBucketAccessControl { + + /** BucketAccessControl role */ + role?: (string|null); + + /** BucketAccessControl id */ + id?: (string|null); + + /** BucketAccessControl entity */ + entity?: (string|null); + + /** BucketAccessControl entityAlt */ + entityAlt?: (string|null); + + /** BucketAccessControl entityId */ + entityId?: (string|null); + + /** BucketAccessControl etag */ + etag?: (string|null); + + /** BucketAccessControl email */ + email?: (string|null); + + /** BucketAccessControl domain */ + domain?: (string|null); + + /** BucketAccessControl projectTeam */ + projectTeam?: (google.storage.v2.IProjectTeam|null); + } + + /** Represents a BucketAccessControl. */ + class BucketAccessControl implements IBucketAccessControl { + + /** + * Constructs a new BucketAccessControl. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IBucketAccessControl); + + /** BucketAccessControl role. */ + public role: string; + + /** BucketAccessControl id. */ + public id: string; + + /** BucketAccessControl entity. */ + public entity: string; + + /** BucketAccessControl entityAlt. */ + public entityAlt: string; + + /** BucketAccessControl entityId. */ + public entityId: string; + + /** BucketAccessControl etag. */ + public etag: string; + + /** BucketAccessControl email. */ + public email: string; + + /** BucketAccessControl domain. */ + public domain: string; + + /** BucketAccessControl projectTeam. */ + public projectTeam?: (google.storage.v2.IProjectTeam|null); + + /** + * Creates a new BucketAccessControl instance using the specified properties. + * @param [properties] Properties to set + * @returns BucketAccessControl instance + */ + public static create(properties?: google.storage.v2.IBucketAccessControl): google.storage.v2.BucketAccessControl; + + /** + * Encodes the specified BucketAccessControl message. Does not implicitly {@link google.storage.v2.BucketAccessControl.verify|verify} messages. + * @param message BucketAccessControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IBucketAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BucketAccessControl message, length delimited. Does not implicitly {@link google.storage.v2.BucketAccessControl.verify|verify} messages. + * @param message BucketAccessControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IBucketAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BucketAccessControl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BucketAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.BucketAccessControl; + + /** + * Decodes a BucketAccessControl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BucketAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.BucketAccessControl; + + /** + * Verifies a BucketAccessControl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BucketAccessControl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BucketAccessControl + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.BucketAccessControl; + + /** + * Creates a plain object from a BucketAccessControl message. Also converts values to other types if specified. + * @param message BucketAccessControl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.BucketAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BucketAccessControl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BucketAccessControl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChecksummedData. */ + interface IChecksummedData { + + /** ChecksummedData content */ + content?: (Uint8Array|Buffer|string|null); + + /** ChecksummedData crc32c */ + crc32c?: (number|null); + } + + /** Represents a ChecksummedData. */ + class ChecksummedData implements IChecksummedData { + + /** + * Constructs a new ChecksummedData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IChecksummedData); + + /** ChecksummedData content. */ + public content: (Uint8Array|Buffer|string); + + /** ChecksummedData crc32c. */ + public crc32c?: (number|null); + + /** + * Creates a new ChecksummedData instance using the specified properties. + * @param [properties] Properties to set + * @returns ChecksummedData instance + */ + public static create(properties?: google.storage.v2.IChecksummedData): google.storage.v2.ChecksummedData; + + /** + * Encodes the specified ChecksummedData message. Does not implicitly {@link google.storage.v2.ChecksummedData.verify|verify} messages. + * @param message ChecksummedData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IChecksummedData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChecksummedData message, length delimited. Does not implicitly {@link google.storage.v2.ChecksummedData.verify|verify} messages. + * @param message ChecksummedData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IChecksummedData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChecksummedData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChecksummedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ChecksummedData; + + /** + * Decodes a ChecksummedData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChecksummedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ChecksummedData; + + /** + * Verifies a ChecksummedData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChecksummedData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChecksummedData + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ChecksummedData; + + /** + * Creates a plain object from a ChecksummedData message. Also converts values to other types if specified. + * @param message ChecksummedData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ChecksummedData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChecksummedData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChecksummedData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectChecksums. */ + interface IObjectChecksums { + + /** ObjectChecksums crc32c */ + crc32c?: (number|null); + + /** ObjectChecksums md5Hash */ + md5Hash?: (Uint8Array|Buffer|string|null); + } + + /** Represents an ObjectChecksums. */ + class ObjectChecksums implements IObjectChecksums { + + /** + * Constructs a new ObjectChecksums. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IObjectChecksums); + + /** ObjectChecksums crc32c. */ + public crc32c?: (number|null); + + /** ObjectChecksums md5Hash. */ + public md5Hash: (Uint8Array|Buffer|string); + + /** + * Creates a new ObjectChecksums instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectChecksums instance + */ + public static create(properties?: google.storage.v2.IObjectChecksums): google.storage.v2.ObjectChecksums; + + /** + * Encodes the specified ObjectChecksums message. Does not implicitly {@link google.storage.v2.ObjectChecksums.verify|verify} messages. + * @param message ObjectChecksums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IObjectChecksums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectChecksums message, length delimited. Does not implicitly {@link google.storage.v2.ObjectChecksums.verify|verify} messages. + * @param message ObjectChecksums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IObjectChecksums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectChecksums message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectChecksums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ObjectChecksums; + + /** + * Decodes an ObjectChecksums message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectChecksums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ObjectChecksums; + + /** + * Verifies an ObjectChecksums message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectChecksums message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectChecksums + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ObjectChecksums; + + /** + * Creates a plain object from an ObjectChecksums message. Also converts values to other types if specified. + * @param message ObjectChecksums + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ObjectChecksums, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectChecksums to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectChecksums + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectCustomContextPayload. */ + interface IObjectCustomContextPayload { + + /** ObjectCustomContextPayload value */ + value?: (string|null); + + /** ObjectCustomContextPayload createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ObjectCustomContextPayload updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ObjectCustomContextPayload. */ + class ObjectCustomContextPayload implements IObjectCustomContextPayload { + + /** + * Constructs a new ObjectCustomContextPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IObjectCustomContextPayload); + + /** ObjectCustomContextPayload value. */ + public value: string; + + /** ObjectCustomContextPayload createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ObjectCustomContextPayload updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ObjectCustomContextPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectCustomContextPayload instance + */ + public static create(properties?: google.storage.v2.IObjectCustomContextPayload): google.storage.v2.ObjectCustomContextPayload; + + /** + * Encodes the specified ObjectCustomContextPayload message. Does not implicitly {@link google.storage.v2.ObjectCustomContextPayload.verify|verify} messages. + * @param message ObjectCustomContextPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IObjectCustomContextPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectCustomContextPayload message, length delimited. Does not implicitly {@link google.storage.v2.ObjectCustomContextPayload.verify|verify} messages. + * @param message ObjectCustomContextPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IObjectCustomContextPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectCustomContextPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectCustomContextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ObjectCustomContextPayload; + + /** + * Decodes an ObjectCustomContextPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectCustomContextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ObjectCustomContextPayload; + + /** + * Verifies an ObjectCustomContextPayload message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectCustomContextPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectCustomContextPayload + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ObjectCustomContextPayload; + + /** + * Creates a plain object from an ObjectCustomContextPayload message. Also converts values to other types if specified. + * @param message ObjectCustomContextPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ObjectCustomContextPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectCustomContextPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectCustomContextPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectContexts. */ + interface IObjectContexts { + + /** ObjectContexts custom */ + custom?: ({ [k: string]: google.storage.v2.IObjectCustomContextPayload }|null); + } + + /** Represents an ObjectContexts. */ + class ObjectContexts implements IObjectContexts { + + /** + * Constructs a new ObjectContexts. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IObjectContexts); + + /** ObjectContexts custom. */ + public custom: { [k: string]: google.storage.v2.IObjectCustomContextPayload }; + + /** + * Creates a new ObjectContexts instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectContexts instance + */ + public static create(properties?: google.storage.v2.IObjectContexts): google.storage.v2.ObjectContexts; + + /** + * Encodes the specified ObjectContexts message. Does not implicitly {@link google.storage.v2.ObjectContexts.verify|verify} messages. + * @param message ObjectContexts message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IObjectContexts, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectContexts message, length delimited. Does not implicitly {@link google.storage.v2.ObjectContexts.verify|verify} messages. + * @param message ObjectContexts message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IObjectContexts, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectContexts message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectContexts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ObjectContexts; + + /** + * Decodes an ObjectContexts message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectContexts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ObjectContexts; + + /** + * Verifies an ObjectContexts message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectContexts message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectContexts + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ObjectContexts; + + /** + * Creates a plain object from an ObjectContexts message. Also converts values to other types if specified. + * @param message ObjectContexts + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ObjectContexts, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectContexts to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectContexts + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerEncryption. */ + interface ICustomerEncryption { + + /** CustomerEncryption encryptionAlgorithm */ + encryptionAlgorithm?: (string|null); + + /** CustomerEncryption keySha256Bytes */ + keySha256Bytes?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CustomerEncryption. */ + class CustomerEncryption implements ICustomerEncryption { + + /** + * Constructs a new CustomerEncryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.ICustomerEncryption); + + /** CustomerEncryption encryptionAlgorithm. */ + public encryptionAlgorithm: string; + + /** CustomerEncryption keySha256Bytes. */ + public keySha256Bytes: (Uint8Array|Buffer|string); + + /** + * Creates a new CustomerEncryption instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryption instance + */ + public static create(properties?: google.storage.v2.ICustomerEncryption): google.storage.v2.CustomerEncryption; + + /** + * Encodes the specified CustomerEncryption message. Does not implicitly {@link google.storage.v2.CustomerEncryption.verify|verify} messages. + * @param message CustomerEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.ICustomerEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryption message, length delimited. Does not implicitly {@link google.storage.v2.CustomerEncryption.verify|verify} messages. + * @param message CustomerEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.ICustomerEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.CustomerEncryption; + + /** + * Decodes a CustomerEncryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.CustomerEncryption; + + /** + * Verifies a CustomerEncryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryption + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.CustomerEncryption; + + /** + * Creates a plain object from a CustomerEncryption message. Also converts values to other types if specified. + * @param message CustomerEncryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.CustomerEncryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerEncryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Object. */ + interface IObject { + + /** Object name */ + name?: (string|null); + + /** Object bucket */ + bucket?: (string|null); + + /** Object etag */ + etag?: (string|null); + + /** Object generation */ + generation?: (number|Long|string|null); + + /** Object restoreToken */ + restoreToken?: (string|null); + + /** Object metageneration */ + metageneration?: (number|Long|string|null); + + /** Object storageClass */ + storageClass?: (string|null); + + /** Object size */ + size?: (number|Long|string|null); + + /** Object contentEncoding */ + contentEncoding?: (string|null); + + /** Object contentDisposition */ + contentDisposition?: (string|null); + + /** Object cacheControl */ + cacheControl?: (string|null); + + /** Object acl */ + acl?: (google.storage.v2.IObjectAccessControl[]|null); + + /** Object contentLanguage */ + contentLanguage?: (string|null); + + /** Object deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Object finalizeTime */ + finalizeTime?: (google.protobuf.ITimestamp|null); + + /** Object contentType */ + contentType?: (string|null); + + /** Object createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Object componentCount */ + componentCount?: (number|null); + + /** Object checksums */ + checksums?: (google.storage.v2.IObjectChecksums|null); + + /** Object updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Object kmsKey */ + kmsKey?: (string|null); + + /** Object updateStorageClassTime */ + updateStorageClassTime?: (google.protobuf.ITimestamp|null); + + /** Object temporaryHold */ + temporaryHold?: (boolean|null); + + /** Object retentionExpireTime */ + retentionExpireTime?: (google.protobuf.ITimestamp|null); + + /** Object metadata */ + metadata?: ({ [k: string]: string }|null); + + /** Object contexts */ + contexts?: (google.storage.v2.IObjectContexts|null); + + /** Object eventBasedHold */ + eventBasedHold?: (boolean|null); + + /** Object owner */ + owner?: (google.storage.v2.IOwner|null); + + /** Object customerEncryption */ + customerEncryption?: (google.storage.v2.ICustomerEncryption|null); + + /** Object customTime */ + customTime?: (google.protobuf.ITimestamp|null); + + /** Object softDeleteTime */ + softDeleteTime?: (google.protobuf.ITimestamp|null); + + /** Object hardDeleteTime */ + hardDeleteTime?: (google.protobuf.ITimestamp|null); + + /** Object retention */ + retention?: (google.storage.v2.Object.IRetention|null); + } + + /** Represents an Object. */ + class Object implements IObject { + + /** + * Constructs a new Object. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IObject); + + /** Object name. */ + public name: string; + + /** Object bucket. */ + public bucket: string; + + /** Object etag. */ + public etag: string; + + /** Object generation. */ + public generation: (number|Long|string); + + /** Object restoreToken. */ + public restoreToken?: (string|null); + + /** Object metageneration. */ + public metageneration: (number|Long|string); + + /** Object storageClass. */ + public storageClass: string; + + /** Object size. */ + public size: (number|Long|string); + + /** Object contentEncoding. */ + public contentEncoding: string; + + /** Object contentDisposition. */ + public contentDisposition: string; + + /** Object cacheControl. */ + public cacheControl: string; + + /** Object acl. */ + public acl: google.storage.v2.IObjectAccessControl[]; + + /** Object contentLanguage. */ + public contentLanguage: string; + + /** Object deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Object finalizeTime. */ + public finalizeTime?: (google.protobuf.ITimestamp|null); + + /** Object contentType. */ + public contentType: string; + + /** Object createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Object componentCount. */ + public componentCount: number; + + /** Object checksums. */ + public checksums?: (google.storage.v2.IObjectChecksums|null); + + /** Object updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Object kmsKey. */ + public kmsKey: string; + + /** Object updateStorageClassTime. */ + public updateStorageClassTime?: (google.protobuf.ITimestamp|null); + + /** Object temporaryHold. */ + public temporaryHold: boolean; + + /** Object retentionExpireTime. */ + public retentionExpireTime?: (google.protobuf.ITimestamp|null); + + /** Object metadata. */ + public metadata: { [k: string]: string }; + + /** Object contexts. */ + public contexts?: (google.storage.v2.IObjectContexts|null); + + /** Object eventBasedHold. */ + public eventBasedHold?: (boolean|null); + + /** Object owner. */ + public owner?: (google.storage.v2.IOwner|null); + + /** Object customerEncryption. */ + public customerEncryption?: (google.storage.v2.ICustomerEncryption|null); + + /** Object customTime. */ + public customTime?: (google.protobuf.ITimestamp|null); + + /** Object softDeleteTime. */ + public softDeleteTime?: (google.protobuf.ITimestamp|null); + + /** Object hardDeleteTime. */ + public hardDeleteTime?: (google.protobuf.ITimestamp|null); + + /** Object retention. */ + public retention?: (google.storage.v2.Object.IRetention|null); + + /** + * Creates a new Object instance using the specified properties. + * @param [properties] Properties to set + * @returns Object instance + */ + public static create(properties?: google.storage.v2.IObject): google.storage.v2.object; + + /** + * Encodes the specified Object message. Does not implicitly {@link google.storage.v2.Object.verify|verify} messages. + * @param message Object message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.storage.v2.Object.verify|verify} messages. + * @param message Object message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Object message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.object; + + /** + * Decodes an Object message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.object; + + /** + * Verifies an Object message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Object message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Object + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.object; + + /** + * Creates a plain object from an Object message. Also converts values to other types if specified. + * @param message Object + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.object, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Object to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Object + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Object { + + /** Properties of a Retention. */ + interface IRetention { + + /** Retention mode */ + mode?: (google.storage.v2.Object.Retention.Mode|keyof typeof google.storage.v2.Object.Retention.Mode|null); + + /** Retention retainUntilTime */ + retainUntilTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Retention. */ + class Retention implements IRetention { + + /** + * Constructs a new Retention. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.Object.IRetention); + + /** Retention mode. */ + public mode: (google.storage.v2.Object.Retention.Mode|keyof typeof google.storage.v2.Object.Retention.Mode); + + /** Retention retainUntilTime. */ + public retainUntilTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Retention instance using the specified properties. + * @param [properties] Properties to set + * @returns Retention instance + */ + public static create(properties?: google.storage.v2.Object.IRetention): google.storage.v2.Object.Retention; + + /** + * Encodes the specified Retention message. Does not implicitly {@link google.storage.v2.Object.Retention.verify|verify} messages. + * @param message Retention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.Object.IRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Retention message, length delimited. Does not implicitly {@link google.storage.v2.Object.Retention.verify|verify} messages. + * @param message Retention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.Object.IRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Retention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Retention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Object.Retention; + + /** + * Decodes a Retention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Retention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Object.Retention; + + /** + * Verifies a Retention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Retention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Retention + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Object.Retention; + + /** + * Creates a plain object from a Retention message. Also converts values to other types if specified. + * @param message Retention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Object.Retention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Retention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Retention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Retention { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + UNLOCKED = 1, + LOCKED = 2 + } + } + } + + /** Properties of an ObjectAccessControl. */ + interface IObjectAccessControl { + + /** ObjectAccessControl role */ + role?: (string|null); + + /** ObjectAccessControl id */ + id?: (string|null); + + /** ObjectAccessControl entity */ + entity?: (string|null); + + /** ObjectAccessControl entityAlt */ + entityAlt?: (string|null); + + /** ObjectAccessControl entityId */ + entityId?: (string|null); + + /** ObjectAccessControl etag */ + etag?: (string|null); + + /** ObjectAccessControl email */ + email?: (string|null); + + /** ObjectAccessControl domain */ + domain?: (string|null); + + /** ObjectAccessControl projectTeam */ + projectTeam?: (google.storage.v2.IProjectTeam|null); + } + + /** Represents an ObjectAccessControl. */ + class ObjectAccessControl implements IObjectAccessControl { + + /** + * Constructs a new ObjectAccessControl. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IObjectAccessControl); + + /** ObjectAccessControl role. */ + public role: string; + + /** ObjectAccessControl id. */ + public id: string; + + /** ObjectAccessControl entity. */ + public entity: string; + + /** ObjectAccessControl entityAlt. */ + public entityAlt: string; + + /** ObjectAccessControl entityId. */ + public entityId: string; + + /** ObjectAccessControl etag. */ + public etag: string; + + /** ObjectAccessControl email. */ + public email: string; + + /** ObjectAccessControl domain. */ + public domain: string; + + /** ObjectAccessControl projectTeam. */ + public projectTeam?: (google.storage.v2.IProjectTeam|null); + + /** + * Creates a new ObjectAccessControl instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectAccessControl instance + */ + public static create(properties?: google.storage.v2.IObjectAccessControl): google.storage.v2.ObjectAccessControl; + + /** + * Encodes the specified ObjectAccessControl message. Does not implicitly {@link google.storage.v2.ObjectAccessControl.verify|verify} messages. + * @param message ObjectAccessControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IObjectAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectAccessControl message, length delimited. Does not implicitly {@link google.storage.v2.ObjectAccessControl.verify|verify} messages. + * @param message ObjectAccessControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IObjectAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectAccessControl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ObjectAccessControl; + + /** + * Decodes an ObjectAccessControl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ObjectAccessControl; + + /** + * Verifies an ObjectAccessControl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectAccessControl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectAccessControl + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ObjectAccessControl; + + /** + * Creates a plain object from an ObjectAccessControl message. Also converts values to other types if specified. + * @param message ObjectAccessControl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ObjectAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectAccessControl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectAccessControl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListObjectsResponse. */ + interface IListObjectsResponse { + + /** ListObjectsResponse objects */ + objects?: (google.storage.v2.IObject[]|null); + + /** ListObjectsResponse prefixes */ + prefixes?: (string[]|null); + + /** ListObjectsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListObjectsResponse. */ + class ListObjectsResponse implements IListObjectsResponse { + + /** + * Constructs a new ListObjectsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IListObjectsResponse); + + /** ListObjectsResponse objects. */ + public objects: google.storage.v2.IObject[]; + + /** ListObjectsResponse prefixes. */ + public prefixes: string[]; + + /** ListObjectsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListObjectsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListObjectsResponse instance + */ + public static create(properties?: google.storage.v2.IListObjectsResponse): google.storage.v2.ListObjectsResponse; + + /** + * Encodes the specified ListObjectsResponse message. Does not implicitly {@link google.storage.v2.ListObjectsResponse.verify|verify} messages. + * @param message ListObjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IListObjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListObjectsResponse message, length delimited. Does not implicitly {@link google.storage.v2.ListObjectsResponse.verify|verify} messages. + * @param message ListObjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IListObjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListObjectsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListObjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ListObjectsResponse; + + /** + * Decodes a ListObjectsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListObjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ListObjectsResponse; + + /** + * Verifies a ListObjectsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListObjectsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListObjectsResponse + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ListObjectsResponse; + + /** + * Creates a plain object from a ListObjectsResponse message. Also converts values to other types if specified. + * @param message ListObjectsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ListObjectsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListObjectsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListObjectsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProjectTeam. */ + interface IProjectTeam { + + /** ProjectTeam projectNumber */ + projectNumber?: (string|null); + + /** ProjectTeam team */ + team?: (string|null); + } + + /** Represents a ProjectTeam. */ + class ProjectTeam implements IProjectTeam { + + /** + * Constructs a new ProjectTeam. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IProjectTeam); + + /** ProjectTeam projectNumber. */ + public projectNumber: string; + + /** ProjectTeam team. */ + public team: string; + + /** + * Creates a new ProjectTeam instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectTeam instance + */ + public static create(properties?: google.storage.v2.IProjectTeam): google.storage.v2.ProjectTeam; + + /** + * Encodes the specified ProjectTeam message. Does not implicitly {@link google.storage.v2.ProjectTeam.verify|verify} messages. + * @param message ProjectTeam message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IProjectTeam, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectTeam message, length delimited. Does not implicitly {@link google.storage.v2.ProjectTeam.verify|verify} messages. + * @param message ProjectTeam message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IProjectTeam, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectTeam message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ProjectTeam; + + /** + * Decodes a ProjectTeam message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ProjectTeam; + + /** + * Verifies a ProjectTeam message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProjectTeam message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProjectTeam + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ProjectTeam; + + /** + * Creates a plain object from a ProjectTeam message. Also converts values to other types if specified. + * @param message ProjectTeam + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ProjectTeam, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProjectTeam to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProjectTeam + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Owner. */ + interface IOwner { + + /** Owner entity */ + entity?: (string|null); + + /** Owner entityId */ + entityId?: (string|null); + } + + /** Represents an Owner. */ + class Owner implements IOwner { + + /** + * Constructs a new Owner. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IOwner); + + /** Owner entity. */ + public entity: string; + + /** Owner entityId. */ + public entityId: string; + + /** + * Creates a new Owner instance using the specified properties. + * @param [properties] Properties to set + * @returns Owner instance + */ + public static create(properties?: google.storage.v2.IOwner): google.storage.v2.Owner; + + /** + * Encodes the specified Owner message. Does not implicitly {@link google.storage.v2.Owner.verify|verify} messages. + * @param message Owner message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.storage.v2.Owner.verify|verify} messages. + * @param message Owner message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.Owner; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.Owner; + + /** + * Verifies an Owner message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Owner message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Owner + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.Owner; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @param message Owner + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.Owner, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Owner to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Owner + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContentRange. */ + interface IContentRange { + + /** ContentRange start */ + start?: (number|Long|string|null); + + /** ContentRange end */ + end?: (number|Long|string|null); + + /** ContentRange completeLength */ + completeLength?: (number|Long|string|null); + } + + /** Represents a ContentRange. */ + class ContentRange implements IContentRange { + + /** + * Constructs a new ContentRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.storage.v2.IContentRange); + + /** ContentRange start. */ + public start: (number|Long|string); + + /** ContentRange end. */ + public end: (number|Long|string); + + /** ContentRange completeLength. */ + public completeLength: (number|Long|string); + + /** + * Creates a new ContentRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentRange instance + */ + public static create(properties?: google.storage.v2.IContentRange): google.storage.v2.ContentRange; + + /** + * Encodes the specified ContentRange message. Does not implicitly {@link google.storage.v2.ContentRange.verify|verify} messages. + * @param message ContentRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storage.v2.IContentRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentRange message, length delimited. Does not implicitly {@link google.storage.v2.ContentRange.verify|verify} messages. + * @param message ContentRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storage.v2.IContentRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storage.v2.ContentRange; + + /** + * Decodes a ContentRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storage.v2.ContentRange; + + /** + * Verifies a ContentRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentRange + */ + public static fromObject(object: { [k: string]: any }): google.storage.v2.ContentRange; + + /** + * Creates a plain object from a ContentRange message. Also converts values to other types if specified. + * @param message ContentRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storage.v2.ContentRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** 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 RoutingRule. */ + interface IRoutingRule { + + /** RoutingRule routingParameters */ + routingParameters?: (google.api.IRoutingParameter[]|null); + } + + /** Represents a RoutingRule. */ + class RoutingRule implements IRoutingRule { + + /** + * Constructs a new RoutingRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingRule); + + /** RoutingRule routingParameters. */ + public routingParameters: google.api.IRoutingParameter[]; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingRule instance + */ + public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingRule + * @throws {Error} If the payload is not 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.RoutingRule; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingRule + * @throws {Error} If the payload 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.RoutingRule; + + /** + * Verifies a RoutingRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingRule + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @param message RoutingRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingParameter. */ + interface IRoutingParameter { + + /** RoutingParameter field */ + field?: (string|null); + + /** RoutingParameter pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a RoutingParameter. */ + class RoutingParameter implements IRoutingParameter { + + /** + * Constructs a new RoutingParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingParameter); + + /** RoutingParameter field. */ + public field: string; + + /** RoutingParameter pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingParameter instance + */ + public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingParameter + * @throws {Error} If the payload is not 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.RoutingParameter; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingParameter + * @throws {Error} If the payload 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.RoutingParameter; + + /** + * Verifies a RoutingParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingParameter + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @param message RoutingParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.api.routing */ + ".google.api.routing"?: (google.api.IRoutingRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|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|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|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|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-storage-control/protos/protos.js b/owl-bot-staging/google-storage-control/protos/protos.js new file mode 100644 index 00000000000..1832dd12b0a --- /dev/null +++ b/owl-bot-staging/google-storage-control/protos/protos.js @@ -0,0 +1,68272 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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_storage_control_protos || ($protobuf.roots._google_cloud_storage_control_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.storage = (function() { + + /** + * Namespace storage. + * @memberof google + * @namespace + */ + var storage = {}; + + storage.control = (function() { + + /** + * Namespace control. + * @memberof google.storage + * @namespace + */ + var control = {}; + + control.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.storage.control + * @namespace + */ + var v2 = {}; + + v2.StorageControl = (function() { + + /** + * Constructs a new StorageControl service. + * @memberof google.storage.control.v2 + * @classdesc Represents a StorageControl + * @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 StorageControl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (StorageControl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = StorageControl; + + /** + * Creates new StorageControl service using the specified rpc implementation. + * @function create + * @memberof google.storage.control.v2.StorageControl + * @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 {StorageControl} RPC service. Useful where requests and/or responses are streamed. + */ + StorageControl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|createFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef CreateFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.Folder} [response] Folder + */ + + /** + * Calls CreateFolder. + * @function createFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.ICreateFolderRequest} request CreateFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.CreateFolderCallback} callback Node-style callback called with the error, if any, and Folder + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.createFolder = function createFolder(request, callback) { + return this.rpcCall(createFolder, $root.google.storage.control.v2.CreateFolderRequest, $root.google.storage.control.v2.Folder, request, callback); + }, "name", { value: "CreateFolder" }); + + /** + * Calls CreateFolder. + * @function createFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.ICreateFolderRequest} request CreateFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|deleteFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef DeleteFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFolder. + * @function deleteFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDeleteFolderRequest} request DeleteFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.DeleteFolderCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.deleteFolder = function deleteFolder(request, callback) { + return this.rpcCall(deleteFolder, $root.google.storage.control.v2.DeleteFolderRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFolder" }); + + /** + * Calls DeleteFolder. + * @function deleteFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDeleteFolderRequest} request DeleteFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.Folder} [response] Folder + */ + + /** + * Calls GetFolder. + * @function getFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetFolderRequest} request GetFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetFolderCallback} callback Node-style callback called with the error, if any, and Folder + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getFolder = function getFolder(request, callback) { + return this.rpcCall(getFolder, $root.google.storage.control.v2.GetFolderRequest, $root.google.storage.control.v2.Folder, request, callback); + }, "name", { value: "GetFolder" }); + + /** + * Calls GetFolder. + * @function getFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetFolderRequest} request GetFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|listFolders}. + * @memberof google.storage.control.v2.StorageControl + * @typedef ListFoldersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.ListFoldersResponse} [response] ListFoldersResponse + */ + + /** + * Calls ListFolders. + * @function listFolders + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IListFoldersRequest} request ListFoldersRequest message or plain object + * @param {google.storage.control.v2.StorageControl.ListFoldersCallback} callback Node-style callback called with the error, if any, and ListFoldersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.listFolders = function listFolders(request, callback) { + return this.rpcCall(listFolders, $root.google.storage.control.v2.ListFoldersRequest, $root.google.storage.control.v2.ListFoldersResponse, request, callback); + }, "name", { value: "ListFolders" }); + + /** + * Calls ListFolders. + * @function listFolders + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IListFoldersRequest} request ListFoldersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|renameFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef RenameFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RenameFolder. + * @function renameFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IRenameFolderRequest} request RenameFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.RenameFolderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.renameFolder = function renameFolder(request, callback) { + return this.rpcCall(renameFolder, $root.google.storage.control.v2.RenameFolderRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RenameFolder" }); + + /** + * Calls RenameFolder. + * @function renameFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IRenameFolderRequest} request RenameFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|deleteFolderRecursive}. + * @memberof google.storage.control.v2.StorageControl + * @typedef DeleteFolderRecursiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteFolderRecursive. + * @function deleteFolderRecursive + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDeleteFolderRecursiveRequest} request DeleteFolderRecursiveRequest message or plain object + * @param {google.storage.control.v2.StorageControl.DeleteFolderRecursiveCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.deleteFolderRecursive = function deleteFolderRecursive(request, callback) { + return this.rpcCall(deleteFolderRecursive, $root.google.storage.control.v2.DeleteFolderRecursiveRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteFolderRecursive" }); + + /** + * Calls DeleteFolderRecursive. + * @function deleteFolderRecursive + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDeleteFolderRecursiveRequest} request DeleteFolderRecursiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getStorageLayout}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetStorageLayoutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.StorageLayout} [response] StorageLayout + */ + + /** + * Calls GetStorageLayout. + * @function getStorageLayout + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetStorageLayoutRequest} request GetStorageLayoutRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetStorageLayoutCallback} callback Node-style callback called with the error, if any, and StorageLayout + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getStorageLayout = function getStorageLayout(request, callback) { + return this.rpcCall(getStorageLayout, $root.google.storage.control.v2.GetStorageLayoutRequest, $root.google.storage.control.v2.StorageLayout, request, callback); + }, "name", { value: "GetStorageLayout" }); + + /** + * Calls GetStorageLayout. + * @function getStorageLayout + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetStorageLayoutRequest} request GetStorageLayoutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|createManagedFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef CreateManagedFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.ManagedFolder} [response] ManagedFolder + */ + + /** + * Calls CreateManagedFolder. + * @function createManagedFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.ICreateManagedFolderRequest} request CreateManagedFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.CreateManagedFolderCallback} callback Node-style callback called with the error, if any, and ManagedFolder + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.createManagedFolder = function createManagedFolder(request, callback) { + return this.rpcCall(createManagedFolder, $root.google.storage.control.v2.CreateManagedFolderRequest, $root.google.storage.control.v2.ManagedFolder, request, callback); + }, "name", { value: "CreateManagedFolder" }); + + /** + * Calls CreateManagedFolder. + * @function createManagedFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.ICreateManagedFolderRequest} request CreateManagedFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|deleteManagedFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef DeleteManagedFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteManagedFolder. + * @function deleteManagedFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDeleteManagedFolderRequest} request DeleteManagedFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.DeleteManagedFolderCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.deleteManagedFolder = function deleteManagedFolder(request, callback) { + return this.rpcCall(deleteManagedFolder, $root.google.storage.control.v2.DeleteManagedFolderRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteManagedFolder" }); + + /** + * Calls DeleteManagedFolder. + * @function deleteManagedFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDeleteManagedFolderRequest} request DeleteManagedFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getManagedFolder}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetManagedFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.ManagedFolder} [response] ManagedFolder + */ + + /** + * Calls GetManagedFolder. + * @function getManagedFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetManagedFolderRequest} request GetManagedFolderRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetManagedFolderCallback} callback Node-style callback called with the error, if any, and ManagedFolder + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getManagedFolder = function getManagedFolder(request, callback) { + return this.rpcCall(getManagedFolder, $root.google.storage.control.v2.GetManagedFolderRequest, $root.google.storage.control.v2.ManagedFolder, request, callback); + }, "name", { value: "GetManagedFolder" }); + + /** + * Calls GetManagedFolder. + * @function getManagedFolder + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetManagedFolderRequest} request GetManagedFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|listManagedFolders}. + * @memberof google.storage.control.v2.StorageControl + * @typedef ListManagedFoldersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.ListManagedFoldersResponse} [response] ListManagedFoldersResponse + */ + + /** + * Calls ListManagedFolders. + * @function listManagedFolders + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IListManagedFoldersRequest} request ListManagedFoldersRequest message or plain object + * @param {google.storage.control.v2.StorageControl.ListManagedFoldersCallback} callback Node-style callback called with the error, if any, and ListManagedFoldersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.listManagedFolders = function listManagedFolders(request, callback) { + return this.rpcCall(listManagedFolders, $root.google.storage.control.v2.ListManagedFoldersRequest, $root.google.storage.control.v2.ListManagedFoldersResponse, request, callback); + }, "name", { value: "ListManagedFolders" }); + + /** + * Calls ListManagedFolders. + * @function listManagedFolders + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IListManagedFoldersRequest} request ListManagedFoldersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|createAnywhereCache}. + * @memberof google.storage.control.v2.StorageControl + * @typedef CreateAnywhereCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAnywhereCache. + * @function createAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.ICreateAnywhereCacheRequest} request CreateAnywhereCacheRequest message or plain object + * @param {google.storage.control.v2.StorageControl.CreateAnywhereCacheCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.createAnywhereCache = function createAnywhereCache(request, callback) { + return this.rpcCall(createAnywhereCache, $root.google.storage.control.v2.CreateAnywhereCacheRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAnywhereCache" }); + + /** + * Calls CreateAnywhereCache. + * @function createAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.ICreateAnywhereCacheRequest} request CreateAnywhereCacheRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateAnywhereCache}. + * @memberof google.storage.control.v2.StorageControl + * @typedef UpdateAnywhereCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAnywhereCache. + * @function updateAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateAnywhereCacheRequest} request UpdateAnywhereCacheRequest message or plain object + * @param {google.storage.control.v2.StorageControl.UpdateAnywhereCacheCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.updateAnywhereCache = function updateAnywhereCache(request, callback) { + return this.rpcCall(updateAnywhereCache, $root.google.storage.control.v2.UpdateAnywhereCacheRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAnywhereCache" }); + + /** + * Calls UpdateAnywhereCache. + * @function updateAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateAnywhereCacheRequest} request UpdateAnywhereCacheRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|disableAnywhereCache}. + * @memberof google.storage.control.v2.StorageControl + * @typedef DisableAnywhereCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.AnywhereCache} [response] AnywhereCache + */ + + /** + * Calls DisableAnywhereCache. + * @function disableAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDisableAnywhereCacheRequest} request DisableAnywhereCacheRequest message or plain object + * @param {google.storage.control.v2.StorageControl.DisableAnywhereCacheCallback} callback Node-style callback called with the error, if any, and AnywhereCache + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.disableAnywhereCache = function disableAnywhereCache(request, callback) { + return this.rpcCall(disableAnywhereCache, $root.google.storage.control.v2.DisableAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + }, "name", { value: "DisableAnywhereCache" }); + + /** + * Calls DisableAnywhereCache. + * @function disableAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IDisableAnywhereCacheRequest} request DisableAnywhereCacheRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|pauseAnywhereCache}. + * @memberof google.storage.control.v2.StorageControl + * @typedef PauseAnywhereCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.AnywhereCache} [response] AnywhereCache + */ + + /** + * Calls PauseAnywhereCache. + * @function pauseAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IPauseAnywhereCacheRequest} request PauseAnywhereCacheRequest message or plain object + * @param {google.storage.control.v2.StorageControl.PauseAnywhereCacheCallback} callback Node-style callback called with the error, if any, and AnywhereCache + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.pauseAnywhereCache = function pauseAnywhereCache(request, callback) { + return this.rpcCall(pauseAnywhereCache, $root.google.storage.control.v2.PauseAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + }, "name", { value: "PauseAnywhereCache" }); + + /** + * Calls PauseAnywhereCache. + * @function pauseAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IPauseAnywhereCacheRequest} request PauseAnywhereCacheRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|resumeAnywhereCache}. + * @memberof google.storage.control.v2.StorageControl + * @typedef ResumeAnywhereCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.AnywhereCache} [response] AnywhereCache + */ + + /** + * Calls ResumeAnywhereCache. + * @function resumeAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IResumeAnywhereCacheRequest} request ResumeAnywhereCacheRequest message or plain object + * @param {google.storage.control.v2.StorageControl.ResumeAnywhereCacheCallback} callback Node-style callback called with the error, if any, and AnywhereCache + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.resumeAnywhereCache = function resumeAnywhereCache(request, callback) { + return this.rpcCall(resumeAnywhereCache, $root.google.storage.control.v2.ResumeAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + }, "name", { value: "ResumeAnywhereCache" }); + + /** + * Calls ResumeAnywhereCache. + * @function resumeAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IResumeAnywhereCacheRequest} request ResumeAnywhereCacheRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getAnywhereCache}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetAnywhereCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.AnywhereCache} [response] AnywhereCache + */ + + /** + * Calls GetAnywhereCache. + * @function getAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetAnywhereCacheRequest} request GetAnywhereCacheRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetAnywhereCacheCallback} callback Node-style callback called with the error, if any, and AnywhereCache + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getAnywhereCache = function getAnywhereCache(request, callback) { + return this.rpcCall(getAnywhereCache, $root.google.storage.control.v2.GetAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + }, "name", { value: "GetAnywhereCache" }); + + /** + * Calls GetAnywhereCache. + * @function getAnywhereCache + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetAnywhereCacheRequest} request GetAnywhereCacheRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|listAnywhereCaches}. + * @memberof google.storage.control.v2.StorageControl + * @typedef ListAnywhereCachesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.ListAnywhereCachesResponse} [response] ListAnywhereCachesResponse + */ + + /** + * Calls ListAnywhereCaches. + * @function listAnywhereCaches + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IListAnywhereCachesRequest} request ListAnywhereCachesRequest message or plain object + * @param {google.storage.control.v2.StorageControl.ListAnywhereCachesCallback} callback Node-style callback called with the error, if any, and ListAnywhereCachesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.listAnywhereCaches = function listAnywhereCaches(request, callback) { + return this.rpcCall(listAnywhereCaches, $root.google.storage.control.v2.ListAnywhereCachesRequest, $root.google.storage.control.v2.ListAnywhereCachesResponse, request, callback); + }, "name", { value: "ListAnywhereCaches" }); + + /** + * Calls ListAnywhereCaches. + * @function listAnywhereCaches + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IListAnywhereCachesRequest} request ListAnywhereCachesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getProjectIntelligenceConfig}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetProjectIntelligenceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.IntelligenceConfig} [response] IntelligenceConfig + */ + + /** + * Calls GetProjectIntelligenceConfig. + * @function getProjectIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetProjectIntelligenceConfigRequest} request GetProjectIntelligenceConfigRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetProjectIntelligenceConfigCallback} callback Node-style callback called with the error, if any, and IntelligenceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getProjectIntelligenceConfig = function getProjectIntelligenceConfig(request, callback) { + return this.rpcCall(getProjectIntelligenceConfig, $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + }, "name", { value: "GetProjectIntelligenceConfig" }); + + /** + * Calls GetProjectIntelligenceConfig. + * @function getProjectIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetProjectIntelligenceConfigRequest} request GetProjectIntelligenceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateProjectIntelligenceConfig}. + * @memberof google.storage.control.v2.StorageControl + * @typedef UpdateProjectIntelligenceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.IntelligenceConfig} [response] IntelligenceConfig + */ + + /** + * Calls UpdateProjectIntelligenceConfig. + * @function updateProjectIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest} request UpdateProjectIntelligenceConfigRequest message or plain object + * @param {google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfigCallback} callback Node-style callback called with the error, if any, and IntelligenceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.updateProjectIntelligenceConfig = function updateProjectIntelligenceConfig(request, callback) { + return this.rpcCall(updateProjectIntelligenceConfig, $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + }, "name", { value: "UpdateProjectIntelligenceConfig" }); + + /** + * Calls UpdateProjectIntelligenceConfig. + * @function updateProjectIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest} request UpdateProjectIntelligenceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getFolderIntelligenceConfig}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetFolderIntelligenceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.IntelligenceConfig} [response] IntelligenceConfig + */ + + /** + * Calls GetFolderIntelligenceConfig. + * @function getFolderIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetFolderIntelligenceConfigRequest} request GetFolderIntelligenceConfigRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetFolderIntelligenceConfigCallback} callback Node-style callback called with the error, if any, and IntelligenceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getFolderIntelligenceConfig = function getFolderIntelligenceConfig(request, callback) { + return this.rpcCall(getFolderIntelligenceConfig, $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + }, "name", { value: "GetFolderIntelligenceConfig" }); + + /** + * Calls GetFolderIntelligenceConfig. + * @function getFolderIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetFolderIntelligenceConfigRequest} request GetFolderIntelligenceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateFolderIntelligenceConfig}. + * @memberof google.storage.control.v2.StorageControl + * @typedef UpdateFolderIntelligenceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.IntelligenceConfig} [response] IntelligenceConfig + */ + + /** + * Calls UpdateFolderIntelligenceConfig. + * @function updateFolderIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest} request UpdateFolderIntelligenceConfigRequest message or plain object + * @param {google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfigCallback} callback Node-style callback called with the error, if any, and IntelligenceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.updateFolderIntelligenceConfig = function updateFolderIntelligenceConfig(request, callback) { + return this.rpcCall(updateFolderIntelligenceConfig, $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + }, "name", { value: "UpdateFolderIntelligenceConfig" }); + + /** + * Calls UpdateFolderIntelligenceConfig. + * @function updateFolderIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest} request UpdateFolderIntelligenceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getOrganizationIntelligenceConfig}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetOrganizationIntelligenceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.IntelligenceConfig} [response] IntelligenceConfig + */ + + /** + * Calls GetOrganizationIntelligenceConfig. + * @function getOrganizationIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest} request GetOrganizationIntelligenceConfigRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfigCallback} callback Node-style callback called with the error, if any, and IntelligenceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getOrganizationIntelligenceConfig = function getOrganizationIntelligenceConfig(request, callback) { + return this.rpcCall(getOrganizationIntelligenceConfig, $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + }, "name", { value: "GetOrganizationIntelligenceConfig" }); + + /** + * Calls GetOrganizationIntelligenceConfig. + * @function getOrganizationIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest} request GetOrganizationIntelligenceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|updateOrganizationIntelligenceConfig}. + * @memberof google.storage.control.v2.StorageControl + * @typedef UpdateOrganizationIntelligenceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.control.v2.IntelligenceConfig} [response] IntelligenceConfig + */ + + /** + * Calls UpdateOrganizationIntelligenceConfig. + * @function updateOrganizationIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest} request UpdateOrganizationIntelligenceConfigRequest message or plain object + * @param {google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfigCallback} callback Node-style callback called with the error, if any, and IntelligenceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.updateOrganizationIntelligenceConfig = function updateOrganizationIntelligenceConfig(request, callback) { + return this.rpcCall(updateOrganizationIntelligenceConfig, $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + }, "name", { value: "UpdateOrganizationIntelligenceConfig" }); + + /** + * Calls UpdateOrganizationIntelligenceConfig. + * @function updateOrganizationIntelligenceConfig + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest} request UpdateOrganizationIntelligenceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|getIamPolicy}. + * @memberof google.storage.control.v2.StorageControl + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.storage.control.v2.StorageControl.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|setIamPolicy}. + * @memberof google.storage.control.v2.StorageControl + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.storage.control.v2.StorageControl.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.control.v2.StorageControl|testIamPermissions}. + * @memberof google.storage.control.v2.StorageControl + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.storage.control.v2.StorageControl.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageControl.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.storage.control.v2.StorageControl + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return StorageControl; + })(); + + v2.PendingRenameInfo = (function() { + + /** + * Properties of a PendingRenameInfo. + * @memberof google.storage.control.v2 + * @interface IPendingRenameInfo + * @property {string|null} [operation] PendingRenameInfo operation + */ + + /** + * Constructs a new PendingRenameInfo. + * @memberof google.storage.control.v2 + * @classdesc Represents a PendingRenameInfo. + * @implements IPendingRenameInfo + * @constructor + * @param {google.storage.control.v2.IPendingRenameInfo=} [properties] Properties to set + */ + function PendingRenameInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingRenameInfo operation. + * @member {string} operation + * @memberof google.storage.control.v2.PendingRenameInfo + * @instance + */ + PendingRenameInfo.prototype.operation = ""; + + /** + * Creates a new PendingRenameInfo instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {google.storage.control.v2.IPendingRenameInfo=} [properties] Properties to set + * @returns {google.storage.control.v2.PendingRenameInfo} PendingRenameInfo instance + */ + PendingRenameInfo.create = function create(properties) { + return new PendingRenameInfo(properties); + }; + + /** + * Encodes the specified PendingRenameInfo message. Does not implicitly {@link google.storage.control.v2.PendingRenameInfo.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {google.storage.control.v2.IPendingRenameInfo} message PendingRenameInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingRenameInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + return writer; + }; + + /** + * Encodes the specified PendingRenameInfo message, length delimited. Does not implicitly {@link google.storage.control.v2.PendingRenameInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {google.storage.control.v2.IPendingRenameInfo} message PendingRenameInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingRenameInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PendingRenameInfo message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.PendingRenameInfo} PendingRenameInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingRenameInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.PendingRenameInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PendingRenameInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.PendingRenameInfo} PendingRenameInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingRenameInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PendingRenameInfo message. + * @function verify + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PendingRenameInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + return null; + }; + + /** + * Creates a PendingRenameInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.PendingRenameInfo} PendingRenameInfo + */ + PendingRenameInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.PendingRenameInfo) + return object; + var message = new $root.google.storage.control.v2.PendingRenameInfo(); + if (object.operation != null) + message.operation = String(object.operation); + return message; + }; + + /** + * Creates a plain object from a PendingRenameInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {google.storage.control.v2.PendingRenameInfo} message PendingRenameInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PendingRenameInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + return object; + }; + + /** + * Converts this PendingRenameInfo to JSON. + * @function toJSON + * @memberof google.storage.control.v2.PendingRenameInfo + * @instance + * @returns {Object.} JSON object + */ + PendingRenameInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PendingRenameInfo + * @function getTypeUrl + * @memberof google.storage.control.v2.PendingRenameInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingRenameInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.PendingRenameInfo"; + }; + + return PendingRenameInfo; + })(); + + v2.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.storage.control.v2 + * @interface IFolder + * @property {string|null} [name] Folder name + * @property {number|Long|null} [metageneration] Folder metageneration + * @property {google.protobuf.ITimestamp|null} [createTime] Folder createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Folder updateTime + * @property {google.storage.control.v2.IPendingRenameInfo|null} [pendingRenameInfo] Folder pendingRenameInfo + */ + + /** + * Constructs a new Folder. + * @memberof google.storage.control.v2 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.storage.control.v2.IFolder=} [properties] Properties to set + */ + function Folder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Folder name. + * @member {string} name + * @memberof google.storage.control.v2.Folder + * @instance + */ + Folder.prototype.name = ""; + + /** + * Folder metageneration. + * @member {number|Long} metageneration + * @memberof google.storage.control.v2.Folder + * @instance + */ + Folder.prototype.metageneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Folder createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.control.v2.Folder + * @instance + */ + Folder.prototype.createTime = null; + + /** + * Folder updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.control.v2.Folder + * @instance + */ + Folder.prototype.updateTime = null; + + /** + * Folder pendingRenameInfo. + * @member {google.storage.control.v2.IPendingRenameInfo|null|undefined} pendingRenameInfo + * @memberof google.storage.control.v2.Folder + * @instance + */ + Folder.prototype.pendingRenameInfo = null; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.Folder + * @static + * @param {google.storage.control.v2.IFolder=} [properties] Properties to set + * @returns {google.storage.control.v2.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.storage.control.v2.Folder.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.Folder + * @static + * @param {google.storage.control.v2.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encode = function encode(message, writer) { + 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.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.metageneration); + 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.pendingRenameInfo != null && Object.hasOwnProperty.call(message, "pendingRenameInfo")) + $root.google.storage.control.v2.PendingRenameInfo.encode(message.pendingRenameInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.storage.control.v2.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.Folder + * @static + * @param {google.storage.control.v2.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.metageneration = reader.int64(); + 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 7: { + message.pendingRenameInfo = $root.google.storage.control.v2.PendingRenameInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.storage.control.v2.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.verify = function verify(message) { + if (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.metageneration != null && message.hasOwnProperty("metageneration")) + if (!$util.isInteger(message.metageneration) && !(message.metageneration && $util.isInteger(message.metageneration.low) && $util.isInteger(message.metageneration.high))) + return "metageneration: integer|Long 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.pendingRenameInfo != null && message.hasOwnProperty("pendingRenameInfo")) { + var error = $root.google.storage.control.v2.PendingRenameInfo.verify(message.pendingRenameInfo); + if (error) + return "pendingRenameInfo." + error; + } + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.Folder) + return object; + var message = new $root.google.storage.control.v2.Folder(); + if (object.name != null) + message.name = String(object.name); + if (object.metageneration != null) + if ($util.Long) + (message.metageneration = $util.Long.fromValue(object.metageneration)).unsigned = false; + else if (typeof object.metageneration === "string") + message.metageneration = parseInt(object.metageneration, 10); + else if (typeof object.metageneration === "number") + message.metageneration = object.metageneration; + else if (typeof object.metageneration === "object") + message.metageneration = new $util.LongBits(object.metageneration.low >>> 0, object.metageneration.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.control.v2.Folder.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.control.v2.Folder.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.pendingRenameInfo != null) { + if (typeof object.pendingRenameInfo !== "object") + throw TypeError(".google.storage.control.v2.Folder.pendingRenameInfo: object expected"); + message.pendingRenameInfo = $root.google.storage.control.v2.PendingRenameInfo.fromObject(object.pendingRenameInfo); + } + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.Folder + * @static + * @param {google.storage.control.v2.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.metageneration = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.pendingRenameInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metageneration != null && message.hasOwnProperty("metageneration")) + if (typeof message.metageneration === "number") + object.metageneration = options.longs === String ? String(message.metageneration) : message.metageneration; + else + object.metageneration = options.longs === String ? $util.Long.prototype.toString.call(message.metageneration) : options.longs === Number ? new $util.LongBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0).toNumber() : message.metageneration; + 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.pendingRenameInfo != null && message.hasOwnProperty("pendingRenameInfo")) + object.pendingRenameInfo = $root.google.storage.control.v2.PendingRenameInfo.toObject(message.pendingRenameInfo, options); + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.storage.control.v2.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.storage.control.v2.Folder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Folder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.Folder"; + }; + + return Folder; + })(); + + v2.GetFolderRequest = (function() { + + /** + * Properties of a GetFolderRequest. + * @memberof google.storage.control.v2 + * @interface IGetFolderRequest + * @property {string|null} [name] GetFolderRequest name + * @property {number|Long|null} [ifMetagenerationMatch] GetFolderRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] GetFolderRequest ifMetagenerationNotMatch + * @property {string|null} [requestId] GetFolderRequest requestId + */ + + /** + * Constructs a new GetFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetFolderRequest. + * @implements IGetFolderRequest + * @constructor + * @param {google.storage.control.v2.IGetFolderRequest=} [properties] Properties to set + */ + function GetFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFolderRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetFolderRequest + * @instance + */ + GetFolderRequest.prototype.name = ""; + + /** + * GetFolderRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.control.v2.GetFolderRequest + * @instance + */ + GetFolderRequest.prototype.ifMetagenerationMatch = null; + + /** + * GetFolderRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.control.v2.GetFolderRequest + * @instance + */ + GetFolderRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * GetFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.GetFolderRequest + * @instance + */ + GetFolderRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetFolderRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetFolderRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {google.storage.control.v2.IGetFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetFolderRequest} GetFolderRequest instance + */ + GetFolderRequest.create = function create(properties) { + return new GetFolderRequest(properties); + }; + + /** + * Encodes the specified GetFolderRequest message. Does not implicitly {@link google.storage.control.v2.GetFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {google.storage.control.v2.IGetFolderRequest} message GetFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationNotMatch); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {google.storage.control.v2.IGetFolderRequest} message GetFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetFolderRequest} GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 3: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 4: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetFolderRequest} GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFolderRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetFolderRequest} GetFolderRequest + */ + GetFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetFolderRequest) + return object; + var message = new $root.google.storage.control.v2.GetFolderRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {google.storage.control.v2.GetFolderRequest} message GetFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.name = ""; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetFolderRequest + * @instance + * @returns {Object.} JSON object + */ + GetFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetFolderRequest"; + }; + + return GetFolderRequest; + })(); + + v2.CreateFolderRequest = (function() { + + /** + * Properties of a CreateFolderRequest. + * @memberof google.storage.control.v2 + * @interface ICreateFolderRequest + * @property {string|null} [parent] CreateFolderRequest parent + * @property {google.storage.control.v2.IFolder|null} [folder] CreateFolderRequest folder + * @property {string|null} [folderId] CreateFolderRequest folderId + * @property {boolean|null} [recursive] CreateFolderRequest recursive + * @property {string|null} [requestId] CreateFolderRequest requestId + */ + + /** + * Constructs a new CreateFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a CreateFolderRequest. + * @implements ICreateFolderRequest + * @constructor + * @param {google.storage.control.v2.ICreateFolderRequest=} [properties] Properties to set + */ + function CreateFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFolderRequest parent. + * @member {string} parent + * @memberof google.storage.control.v2.CreateFolderRequest + * @instance + */ + CreateFolderRequest.prototype.parent = ""; + + /** + * CreateFolderRequest folder. + * @member {google.storage.control.v2.IFolder|null|undefined} folder + * @memberof google.storage.control.v2.CreateFolderRequest + * @instance + */ + CreateFolderRequest.prototype.folder = null; + + /** + * CreateFolderRequest folderId. + * @member {string} folderId + * @memberof google.storage.control.v2.CreateFolderRequest + * @instance + */ + CreateFolderRequest.prototype.folderId = ""; + + /** + * CreateFolderRequest recursive. + * @member {boolean} recursive + * @memberof google.storage.control.v2.CreateFolderRequest + * @instance + */ + CreateFolderRequest.prototype.recursive = false; + + /** + * CreateFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.CreateFolderRequest + * @instance + */ + CreateFolderRequest.prototype.requestId = ""; + + /** + * Creates a new CreateFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {google.storage.control.v2.ICreateFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.CreateFolderRequest} CreateFolderRequest instance + */ + CreateFolderRequest.create = function create(properties) { + return new CreateFolderRequest(properties); + }; + + /** + * Encodes the specified CreateFolderRequest message. Does not implicitly {@link google.storage.control.v2.CreateFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {google.storage.control.v2.ICreateFolderRequest} message CreateFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFolderRequest.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.folder != null && Object.hasOwnProperty.call(message, "folder")) + $root.google.storage.control.v2.Folder.encode(message.folder, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.folderId != null && Object.hasOwnProperty.call(message, "folderId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.folderId); + if (message.recursive != null && Object.hasOwnProperty.call(message, "recursive")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.recursive); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {google.storage.control.v2.ICreateFolderRequest} message CreateFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.CreateFolderRequest} CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.CreateFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.folder = $root.google.storage.control.v2.Folder.decode(reader, reader.uint32()); + break; + } + case 3: { + message.folderId = reader.string(); + break; + } + case 4: { + message.recursive = reader.bool(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.CreateFolderRequest} CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFolderRequest.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.folder != null && message.hasOwnProperty("folder")) { + var error = $root.google.storage.control.v2.Folder.verify(message.folder); + if (error) + return "folder." + error; + } + if (message.folderId != null && message.hasOwnProperty("folderId")) + if (!$util.isString(message.folderId)) + return "folderId: string expected"; + if (message.recursive != null && message.hasOwnProperty("recursive")) + if (typeof message.recursive !== "boolean") + return "recursive: boolean expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.CreateFolderRequest} CreateFolderRequest + */ + CreateFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.CreateFolderRequest) + return object; + var message = new $root.google.storage.control.v2.CreateFolderRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.folder != null) { + if (typeof object.folder !== "object") + throw TypeError(".google.storage.control.v2.CreateFolderRequest.folder: object expected"); + message.folder = $root.google.storage.control.v2.Folder.fromObject(object.folder); + } + if (object.folderId != null) + message.folderId = String(object.folderId); + if (object.recursive != null) + message.recursive = Boolean(object.recursive); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {google.storage.control.v2.CreateFolderRequest} message CreateFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.folder = null; + object.folderId = ""; + object.recursive = false; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.folder != null && message.hasOwnProperty("folder")) + object.folder = $root.google.storage.control.v2.Folder.toObject(message.folder, options); + if (message.folderId != null && message.hasOwnProperty("folderId")) + object.folderId = message.folderId; + if (message.recursive != null && message.hasOwnProperty("recursive")) + object.recursive = message.recursive; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.CreateFolderRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.CreateFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.CreateFolderRequest"; + }; + + return CreateFolderRequest; + })(); + + v2.DeleteFolderRequest = (function() { + + /** + * Properties of a DeleteFolderRequest. + * @memberof google.storage.control.v2 + * @interface IDeleteFolderRequest + * @property {string|null} [name] DeleteFolderRequest name + * @property {number|Long|null} [ifMetagenerationMatch] DeleteFolderRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] DeleteFolderRequest ifMetagenerationNotMatch + * @property {string|null} [requestId] DeleteFolderRequest requestId + */ + + /** + * Constructs a new DeleteFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a DeleteFolderRequest. + * @implements IDeleteFolderRequest + * @constructor + * @param {google.storage.control.v2.IDeleteFolderRequest=} [properties] Properties to set + */ + function DeleteFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFolderRequest name. + * @member {string} name + * @memberof google.storage.control.v2.DeleteFolderRequest + * @instance + */ + DeleteFolderRequest.prototype.name = ""; + + /** + * DeleteFolderRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.control.v2.DeleteFolderRequest + * @instance + */ + DeleteFolderRequest.prototype.ifMetagenerationMatch = null; + + /** + * DeleteFolderRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.control.v2.DeleteFolderRequest + * @instance + */ + DeleteFolderRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * DeleteFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.DeleteFolderRequest + * @instance + */ + DeleteFolderRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteFolderRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteFolderRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {google.storage.control.v2.IDeleteFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.DeleteFolderRequest} DeleteFolderRequest instance + */ + DeleteFolderRequest.create = function create(properties) { + return new DeleteFolderRequest(properties); + }; + + /** + * Encodes the specified DeleteFolderRequest message. Does not implicitly {@link google.storage.control.v2.DeleteFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {google.storage.control.v2.IDeleteFolderRequest} message DeleteFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationNotMatch); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {google.storage.control.v2.IDeleteFolderRequest} message DeleteFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.DeleteFolderRequest} DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.DeleteFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 3: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 4: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.DeleteFolderRequest} DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFolderRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.DeleteFolderRequest} DeleteFolderRequest + */ + DeleteFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.DeleteFolderRequest) + return object; + var message = new $root.google.storage.control.v2.DeleteFolderRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {google.storage.control.v2.DeleteFolderRequest} message DeleteFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.name = ""; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.DeleteFolderRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.DeleteFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.DeleteFolderRequest"; + }; + + return DeleteFolderRequest; + })(); + + v2.ListFoldersRequest = (function() { + + /** + * Properties of a ListFoldersRequest. + * @memberof google.storage.control.v2 + * @interface IListFoldersRequest + * @property {string|null} [parent] ListFoldersRequest parent + * @property {number|null} [pageSize] ListFoldersRequest pageSize + * @property {string|null} [pageToken] ListFoldersRequest pageToken + * @property {string|null} [prefix] ListFoldersRequest prefix + * @property {string|null} [delimiter] ListFoldersRequest delimiter + * @property {string|null} [lexicographicStart] ListFoldersRequest lexicographicStart + * @property {string|null} [lexicographicEnd] ListFoldersRequest lexicographicEnd + * @property {string|null} [requestId] ListFoldersRequest requestId + */ + + /** + * Constructs a new ListFoldersRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a ListFoldersRequest. + * @implements IListFoldersRequest + * @constructor + * @param {google.storage.control.v2.IListFoldersRequest=} [properties] Properties to set + */ + function ListFoldersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFoldersRequest parent. + * @member {string} parent + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.parent = ""; + + /** + * ListFoldersRequest pageSize. + * @member {number} pageSize + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.pageSize = 0; + + /** + * ListFoldersRequest pageToken. + * @member {string} pageToken + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.pageToken = ""; + + /** + * ListFoldersRequest prefix. + * @member {string} prefix + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.prefix = ""; + + /** + * ListFoldersRequest delimiter. + * @member {string} delimiter + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.delimiter = ""; + + /** + * ListFoldersRequest lexicographicStart. + * @member {string} lexicographicStart + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.lexicographicStart = ""; + + /** + * ListFoldersRequest lexicographicEnd. + * @member {string} lexicographicEnd + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.lexicographicEnd = ""; + + /** + * ListFoldersRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.requestId = ""; + + /** + * Creates a new ListFoldersRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {google.storage.control.v2.IListFoldersRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.ListFoldersRequest} ListFoldersRequest instance + */ + ListFoldersRequest.create = function create(properties) { + return new ListFoldersRequest(properties); + }; + + /** + * Encodes the specified ListFoldersRequest message. Does not implicitly {@link google.storage.control.v2.ListFoldersRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {google.storage.control.v2.IListFoldersRequest} message ListFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersRequest.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.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prefix); + if (message.lexicographicStart != null && Object.hasOwnProperty.call(message, "lexicographicStart")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lexicographicStart); + if (message.lexicographicEnd != null && Object.hasOwnProperty.call(message, "lexicographicEnd")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.lexicographicEnd); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.delimiter); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ListFoldersRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ListFoldersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {google.storage.control.v2.IListFoldersRequest} message ListFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ListFoldersRequest} ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ListFoldersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.prefix = reader.string(); + break; + } + case 8: { + message.delimiter = reader.string(); + break; + } + case 6: { + message.lexicographicStart = reader.string(); + break; + } + case 7: { + message.lexicographicEnd = reader.string(); + break; + } + case 9: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ListFoldersRequest} ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFoldersRequest message. + * @function verify + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFoldersRequest.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.prefix != null && message.hasOwnProperty("prefix")) + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) + if (!$util.isString(message.lexicographicStart)) + return "lexicographicStart: string expected"; + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) + if (!$util.isString(message.lexicographicEnd)) + return "lexicographicEnd: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ListFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ListFoldersRequest} ListFoldersRequest + */ + ListFoldersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ListFoldersRequest) + return object; + var message = new $root.google.storage.control.v2.ListFoldersRequest(); + 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.prefix != null) + message.prefix = String(object.prefix); + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + if (object.lexicographicStart != null) + message.lexicographicStart = String(object.lexicographicStart); + if (object.lexicographicEnd != null) + message.lexicographicEnd = String(object.lexicographicEnd); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ListFoldersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {google.storage.control.v2.ListFoldersRequest} message ListFoldersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFoldersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.prefix = ""; + object.lexicographicStart = ""; + object.lexicographicEnd = ""; + object.delimiter = ""; + 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.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = message.prefix; + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) + object.lexicographicStart = message.lexicographicStart; + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) + object.lexicographicEnd = message.lexicographicEnd; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ListFoldersRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ListFoldersRequest + * @instance + * @returns {Object.} JSON object + */ + ListFoldersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFoldersRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.ListFoldersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFoldersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ListFoldersRequest"; + }; + + return ListFoldersRequest; + })(); + + v2.ListFoldersResponse = (function() { + + /** + * Properties of a ListFoldersResponse. + * @memberof google.storage.control.v2 + * @interface IListFoldersResponse + * @property {Array.|null} [folders] ListFoldersResponse folders + * @property {string|null} [nextPageToken] ListFoldersResponse nextPageToken + */ + + /** + * Constructs a new ListFoldersResponse. + * @memberof google.storage.control.v2 + * @classdesc Represents a ListFoldersResponse. + * @implements IListFoldersResponse + * @constructor + * @param {google.storage.control.v2.IListFoldersResponse=} [properties] Properties to set + */ + function ListFoldersResponse(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFoldersResponse folders. + * @member {Array.} folders + * @memberof google.storage.control.v2.ListFoldersResponse + * @instance + */ + ListFoldersResponse.prototype.folders = $util.emptyArray; + + /** + * ListFoldersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storage.control.v2.ListFoldersResponse + * @instance + */ + ListFoldersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFoldersResponse instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {google.storage.control.v2.IListFoldersResponse=} [properties] Properties to set + * @returns {google.storage.control.v2.ListFoldersResponse} ListFoldersResponse instance + */ + ListFoldersResponse.create = function create(properties) { + return new ListFoldersResponse(properties); + }; + + /** + * Encodes the specified ListFoldersResponse message. Does not implicitly {@link google.storage.control.v2.ListFoldersResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {google.storage.control.v2.IListFoldersResponse} message ListFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.storage.control.v2.Folder.encode(message.folders[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 ListFoldersResponse message, length delimited. Does not implicitly {@link google.storage.control.v2.ListFoldersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {google.storage.control.v2.IListFoldersResponse} message ListFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ListFoldersResponse} ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ListFoldersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.storage.control.v2.Folder.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ListFoldersResponse} ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFoldersResponse message. + * @function verify + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFoldersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.storage.control.v2.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ListFoldersResponse} ListFoldersResponse + */ + ListFoldersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ListFoldersResponse) + return object; + var message = new $root.google.storage.control.v2.ListFoldersResponse(); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.storage.control.v2.ListFoldersResponse.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.storage.control.v2.ListFoldersResponse.folders: object expected"); + message.folders[i] = $root.google.storage.control.v2.Folder.fromObject(object.folders[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFoldersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {google.storage.control.v2.ListFoldersResponse} message ListFoldersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFoldersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.storage.control.v2.Folder.toObject(message.folders[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFoldersResponse to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ListFoldersResponse + * @instance + * @returns {Object.} JSON object + */ + ListFoldersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFoldersResponse + * @function getTypeUrl + * @memberof google.storage.control.v2.ListFoldersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFoldersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ListFoldersResponse"; + }; + + return ListFoldersResponse; + })(); + + v2.RenameFolderRequest = (function() { + + /** + * Properties of a RenameFolderRequest. + * @memberof google.storage.control.v2 + * @interface IRenameFolderRequest + * @property {string|null} [name] RenameFolderRequest name + * @property {string|null} [destinationFolderId] RenameFolderRequest destinationFolderId + * @property {number|Long|null} [ifMetagenerationMatch] RenameFolderRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] RenameFolderRequest ifMetagenerationNotMatch + * @property {string|null} [requestId] RenameFolderRequest requestId + */ + + /** + * Constructs a new RenameFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a RenameFolderRequest. + * @implements IRenameFolderRequest + * @constructor + * @param {google.storage.control.v2.IRenameFolderRequest=} [properties] Properties to set + */ + function RenameFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RenameFolderRequest name. + * @member {string} name + * @memberof google.storage.control.v2.RenameFolderRequest + * @instance + */ + RenameFolderRequest.prototype.name = ""; + + /** + * RenameFolderRequest destinationFolderId. + * @member {string} destinationFolderId + * @memberof google.storage.control.v2.RenameFolderRequest + * @instance + */ + RenameFolderRequest.prototype.destinationFolderId = ""; + + /** + * RenameFolderRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.control.v2.RenameFolderRequest + * @instance + */ + RenameFolderRequest.prototype.ifMetagenerationMatch = null; + + /** + * RenameFolderRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.control.v2.RenameFolderRequest + * @instance + */ + RenameFolderRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * RenameFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.RenameFolderRequest + * @instance + */ + RenameFolderRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RenameFolderRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RenameFolderRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RenameFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {google.storage.control.v2.IRenameFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.RenameFolderRequest} RenameFolderRequest instance + */ + RenameFolderRequest.create = function create(properties) { + return new RenameFolderRequest(properties); + }; + + /** + * Encodes the specified RenameFolderRequest message. Does not implicitly {@link google.storage.control.v2.RenameFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {google.storage.control.v2.IRenameFolderRequest} message RenameFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifMetagenerationNotMatch); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + if (message.destinationFolderId != null && Object.hasOwnProperty.call(message, "destinationFolderId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.destinationFolderId); + return writer; + }; + + /** + * Encodes the specified RenameFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.RenameFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {google.storage.control.v2.IRenameFolderRequest} message RenameFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RenameFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.RenameFolderRequest} RenameFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.RenameFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.name = reader.string(); + break; + } + case 8: { + message.destinationFolderId = reader.string(); + break; + } + case 4: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 6: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RenameFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.RenameFolderRequest} RenameFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RenameFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RenameFolderRequest.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.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) + if (!$util.isString(message.destinationFolderId)) + return "destinationFolderId: string expected"; + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a RenameFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.RenameFolderRequest} RenameFolderRequest + */ + RenameFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.RenameFolderRequest) + return object; + var message = new $root.google.storage.control.v2.RenameFolderRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationFolderId != null) + message.destinationFolderId = String(object.destinationFolderId); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RenameFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {google.storage.control.v2.RenameFolderRequest} message RenameFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RenameFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.name = ""; + object.destinationFolderId = ""; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) + object.destinationFolderId = message.destinationFolderId; + return object; + }; + + /** + * Converts this RenameFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.RenameFolderRequest + * @instance + * @returns {Object.} JSON object + */ + RenameFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RenameFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.RenameFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RenameFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.RenameFolderRequest"; + }; + + return RenameFolderRequest; + })(); + + v2.DeleteFolderRecursiveRequest = (function() { + + /** + * Properties of a DeleteFolderRecursiveRequest. + * @memberof google.storage.control.v2 + * @interface IDeleteFolderRecursiveRequest + * @property {string|null} [name] DeleteFolderRecursiveRequest name + * @property {number|Long|null} [ifMetagenerationMatch] DeleteFolderRecursiveRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] DeleteFolderRecursiveRequest ifMetagenerationNotMatch + * @property {string|null} [requestId] DeleteFolderRecursiveRequest requestId + */ + + /** + * Constructs a new DeleteFolderRecursiveRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a DeleteFolderRecursiveRequest. + * @implements IDeleteFolderRecursiveRequest + * @constructor + * @param {google.storage.control.v2.IDeleteFolderRecursiveRequest=} [properties] Properties to set + */ + function DeleteFolderRecursiveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFolderRecursiveRequest name. + * @member {string} name + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @instance + */ + DeleteFolderRecursiveRequest.prototype.name = ""; + + /** + * DeleteFolderRecursiveRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @instance + */ + DeleteFolderRecursiveRequest.prototype.ifMetagenerationMatch = null; + + /** + * DeleteFolderRecursiveRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @instance + */ + DeleteFolderRecursiveRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * DeleteFolderRecursiveRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @instance + */ + DeleteFolderRecursiveRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteFolderRecursiveRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteFolderRecursiveRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteFolderRecursiveRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {google.storage.control.v2.IDeleteFolderRecursiveRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.DeleteFolderRecursiveRequest} DeleteFolderRecursiveRequest instance + */ + DeleteFolderRecursiveRequest.create = function create(properties) { + return new DeleteFolderRecursiveRequest(properties); + }; + + /** + * Encodes the specified DeleteFolderRecursiveRequest message. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {google.storage.control.v2.IDeleteFolderRecursiveRequest} message DeleteFolderRecursiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRecursiveRequest.encode = function encode(message, writer) { + 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.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationNotMatch); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteFolderRecursiveRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {google.storage.control.v2.IDeleteFolderRecursiveRequest} message DeleteFolderRecursiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRecursiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFolderRecursiveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.DeleteFolderRecursiveRequest} DeleteFolderRecursiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRecursiveRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.DeleteFolderRecursiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 3: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFolderRecursiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.DeleteFolderRecursiveRequest} DeleteFolderRecursiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRecursiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFolderRecursiveRequest message. + * @function verify + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFolderRecursiveRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteFolderRecursiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.DeleteFolderRecursiveRequest} DeleteFolderRecursiveRequest + */ + DeleteFolderRecursiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.DeleteFolderRecursiveRequest) + return object; + var message = new $root.google.storage.control.v2.DeleteFolderRecursiveRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteFolderRecursiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {google.storage.control.v2.DeleteFolderRecursiveRequest} message DeleteFolderRecursiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFolderRecursiveRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteFolderRecursiveRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFolderRecursiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFolderRecursiveRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.DeleteFolderRecursiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFolderRecursiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.DeleteFolderRecursiveRequest"; + }; + + return DeleteFolderRecursiveRequest; + })(); + + v2.CommonLongRunningOperationMetadata = (function() { + + /** + * Properties of a CommonLongRunningOperationMetadata. + * @memberof google.storage.control.v2 + * @interface ICommonLongRunningOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CommonLongRunningOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] CommonLongRunningOperationMetadata endTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CommonLongRunningOperationMetadata updateTime + * @property {string|null} [type] CommonLongRunningOperationMetadata type + * @property {boolean|null} [requestedCancellation] CommonLongRunningOperationMetadata requestedCancellation + * @property {number|null} [progressPercent] CommonLongRunningOperationMetadata progressPercent + */ + + /** + * Constructs a new CommonLongRunningOperationMetadata. + * @memberof google.storage.control.v2 + * @classdesc Represents a CommonLongRunningOperationMetadata. + * @implements ICommonLongRunningOperationMetadata + * @constructor + * @param {google.storage.control.v2.ICommonLongRunningOperationMetadata=} [properties] Properties to set + */ + function CommonLongRunningOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLongRunningOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + */ + CommonLongRunningOperationMetadata.prototype.createTime = null; + + /** + * CommonLongRunningOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + */ + CommonLongRunningOperationMetadata.prototype.endTime = null; + + /** + * CommonLongRunningOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + */ + CommonLongRunningOperationMetadata.prototype.updateTime = null; + + /** + * CommonLongRunningOperationMetadata type. + * @member {string} type + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + */ + CommonLongRunningOperationMetadata.prototype.type = ""; + + /** + * CommonLongRunningOperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + */ + CommonLongRunningOperationMetadata.prototype.requestedCancellation = false; + + /** + * CommonLongRunningOperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + */ + CommonLongRunningOperationMetadata.prototype.progressPercent = 0; + + /** + * Creates a new CommonLongRunningOperationMetadata instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {google.storage.control.v2.ICommonLongRunningOperationMetadata=} [properties] Properties to set + * @returns {google.storage.control.v2.CommonLongRunningOperationMetadata} CommonLongRunningOperationMetadata instance + */ + CommonLongRunningOperationMetadata.create = function create(properties) { + return new CommonLongRunningOperationMetadata(properties); + }; + + /** + * Encodes the specified CommonLongRunningOperationMetadata message. Does not implicitly {@link google.storage.control.v2.CommonLongRunningOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {google.storage.control.v2.ICommonLongRunningOperationMetadata} message CommonLongRunningOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLongRunningOperationMetadata.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.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.requestedCancellation); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.progressPercent); + return writer; + }; + + /** + * Encodes the specified CommonLongRunningOperationMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.CommonLongRunningOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {google.storage.control.v2.ICommonLongRunningOperationMetadata} message CommonLongRunningOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLongRunningOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLongRunningOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.CommonLongRunningOperationMetadata} CommonLongRunningOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLongRunningOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.CommonLongRunningOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 5: { + message.requestedCancellation = reader.bool(); + break; + } + case 6: { + message.progressPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLongRunningOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.CommonLongRunningOperationMetadata} CommonLongRunningOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLongRunningOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLongRunningOperationMetadata message. + * @function verify + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLongRunningOperationMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + return null; + }; + + /** + * Creates a CommonLongRunningOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.CommonLongRunningOperationMetadata} CommonLongRunningOperationMetadata + */ + CommonLongRunningOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.CommonLongRunningOperationMetadata) + return object; + var message = new $root.google.storage.control.v2.CommonLongRunningOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.type != null) + message.type = String(object.type); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + return message; + }; + + /** + * Creates a plain object from a CommonLongRunningOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {google.storage.control.v2.CommonLongRunningOperationMetadata} message CommonLongRunningOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLongRunningOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.updateTime = null; + object.type = ""; + object.requestedCancellation = false; + object.progressPercent = 0; + } + 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.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + return object; + }; + + /** + * Converts this CommonLongRunningOperationMetadata to JSON. + * @function toJSON + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CommonLongRunningOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLongRunningOperationMetadata + * @function getTypeUrl + * @memberof google.storage.control.v2.CommonLongRunningOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLongRunningOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.CommonLongRunningOperationMetadata"; + }; + + return CommonLongRunningOperationMetadata; + })(); + + v2.RenameFolderMetadata = (function() { + + /** + * Properties of a RenameFolderMetadata. + * @memberof google.storage.control.v2 + * @interface IRenameFolderMetadata + * @property {google.storage.control.v2.ICommonLongRunningOperationMetadata|null} [commonMetadata] RenameFolderMetadata commonMetadata + * @property {string|null} [sourceFolderId] RenameFolderMetadata sourceFolderId + * @property {string|null} [destinationFolderId] RenameFolderMetadata destinationFolderId + */ + + /** + * Constructs a new RenameFolderMetadata. + * @memberof google.storage.control.v2 + * @classdesc Represents a RenameFolderMetadata. + * @implements IRenameFolderMetadata + * @constructor + * @param {google.storage.control.v2.IRenameFolderMetadata=} [properties] Properties to set + */ + function RenameFolderMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RenameFolderMetadata commonMetadata. + * @member {google.storage.control.v2.ICommonLongRunningOperationMetadata|null|undefined} commonMetadata + * @memberof google.storage.control.v2.RenameFolderMetadata + * @instance + */ + RenameFolderMetadata.prototype.commonMetadata = null; + + /** + * RenameFolderMetadata sourceFolderId. + * @member {string} sourceFolderId + * @memberof google.storage.control.v2.RenameFolderMetadata + * @instance + */ + RenameFolderMetadata.prototype.sourceFolderId = ""; + + /** + * RenameFolderMetadata destinationFolderId. + * @member {string} destinationFolderId + * @memberof google.storage.control.v2.RenameFolderMetadata + * @instance + */ + RenameFolderMetadata.prototype.destinationFolderId = ""; + + /** + * Creates a new RenameFolderMetadata instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {google.storage.control.v2.IRenameFolderMetadata=} [properties] Properties to set + * @returns {google.storage.control.v2.RenameFolderMetadata} RenameFolderMetadata instance + */ + RenameFolderMetadata.create = function create(properties) { + return new RenameFolderMetadata(properties); + }; + + /** + * Encodes the specified RenameFolderMetadata message. Does not implicitly {@link google.storage.control.v2.RenameFolderMetadata.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {google.storage.control.v2.IRenameFolderMetadata} message RenameFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameFolderMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.storage.control.v2.CommonLongRunningOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sourceFolderId != null && Object.hasOwnProperty.call(message, "sourceFolderId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFolderId); + if (message.destinationFolderId != null && Object.hasOwnProperty.call(message, "destinationFolderId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationFolderId); + return writer; + }; + + /** + * Encodes the specified RenameFolderMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.RenameFolderMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {google.storage.control.v2.IRenameFolderMetadata} message RenameFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RenameFolderMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.RenameFolderMetadata} RenameFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameFolderMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.RenameFolderMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sourceFolderId = reader.string(); + break; + } + case 3: { + message.destinationFolderId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RenameFolderMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.RenameFolderMetadata} RenameFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameFolderMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RenameFolderMetadata message. + * @function verify + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RenameFolderMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.sourceFolderId != null && message.hasOwnProperty("sourceFolderId")) + if (!$util.isString(message.sourceFolderId)) + return "sourceFolderId: string expected"; + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) + if (!$util.isString(message.destinationFolderId)) + return "destinationFolderId: string expected"; + return null; + }; + + /** + * Creates a RenameFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.RenameFolderMetadata} RenameFolderMetadata + */ + RenameFolderMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.RenameFolderMetadata) + return object; + var message = new $root.google.storage.control.v2.RenameFolderMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.storage.control.v2.RenameFolderMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.fromObject(object.commonMetadata); + } + if (object.sourceFolderId != null) + message.sourceFolderId = String(object.sourceFolderId); + if (object.destinationFolderId != null) + message.destinationFolderId = String(object.destinationFolderId); + return message; + }; + + /** + * Creates a plain object from a RenameFolderMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {google.storage.control.v2.RenameFolderMetadata} message RenameFolderMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RenameFolderMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commonMetadata = null; + object.sourceFolderId = ""; + object.destinationFolderId = ""; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options); + if (message.sourceFolderId != null && message.hasOwnProperty("sourceFolderId")) + object.sourceFolderId = message.sourceFolderId; + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) + object.destinationFolderId = message.destinationFolderId; + return object; + }; + + /** + * Converts this RenameFolderMetadata to JSON. + * @function toJSON + * @memberof google.storage.control.v2.RenameFolderMetadata + * @instance + * @returns {Object.} JSON object + */ + RenameFolderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RenameFolderMetadata + * @function getTypeUrl + * @memberof google.storage.control.v2.RenameFolderMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RenameFolderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.RenameFolderMetadata"; + }; + + return RenameFolderMetadata; + })(); + + v2.DeleteFolderRecursiveMetadata = (function() { + + /** + * Properties of a DeleteFolderRecursiveMetadata. + * @memberof google.storage.control.v2 + * @interface IDeleteFolderRecursiveMetadata + * @property {google.storage.control.v2.ICommonLongRunningOperationMetadata|null} [commonMetadata] DeleteFolderRecursiveMetadata commonMetadata + * @property {string|null} [folderId] DeleteFolderRecursiveMetadata folderId + */ + + /** + * Constructs a new DeleteFolderRecursiveMetadata. + * @memberof google.storage.control.v2 + * @classdesc Represents a DeleteFolderRecursiveMetadata. + * @implements IDeleteFolderRecursiveMetadata + * @constructor + * @param {google.storage.control.v2.IDeleteFolderRecursiveMetadata=} [properties] Properties to set + */ + function DeleteFolderRecursiveMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFolderRecursiveMetadata commonMetadata. + * @member {google.storage.control.v2.ICommonLongRunningOperationMetadata|null|undefined} commonMetadata + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @instance + */ + DeleteFolderRecursiveMetadata.prototype.commonMetadata = null; + + /** + * DeleteFolderRecursiveMetadata folderId. + * @member {string} folderId + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @instance + */ + DeleteFolderRecursiveMetadata.prototype.folderId = ""; + + /** + * Creates a new DeleteFolderRecursiveMetadata instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {google.storage.control.v2.IDeleteFolderRecursiveMetadata=} [properties] Properties to set + * @returns {google.storage.control.v2.DeleteFolderRecursiveMetadata} DeleteFolderRecursiveMetadata instance + */ + DeleteFolderRecursiveMetadata.create = function create(properties) { + return new DeleteFolderRecursiveMetadata(properties); + }; + + /** + * Encodes the specified DeleteFolderRecursiveMetadata message. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveMetadata.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {google.storage.control.v2.IDeleteFolderRecursiveMetadata} message DeleteFolderRecursiveMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRecursiveMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.storage.control.v2.CommonLongRunningOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.folderId != null && Object.hasOwnProperty.call(message, "folderId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.folderId); + return writer; + }; + + /** + * Encodes the specified DeleteFolderRecursiveMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteFolderRecursiveMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {google.storage.control.v2.IDeleteFolderRecursiveMetadata} message DeleteFolderRecursiveMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRecursiveMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFolderRecursiveMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.DeleteFolderRecursiveMetadata} DeleteFolderRecursiveMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRecursiveMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.DeleteFolderRecursiveMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.folderId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFolderRecursiveMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.DeleteFolderRecursiveMetadata} DeleteFolderRecursiveMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRecursiveMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFolderRecursiveMetadata message. + * @function verify + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFolderRecursiveMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.folderId != null && message.hasOwnProperty("folderId")) + if (!$util.isString(message.folderId)) + return "folderId: string expected"; + return null; + }; + + /** + * Creates a DeleteFolderRecursiveMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.DeleteFolderRecursiveMetadata} DeleteFolderRecursiveMetadata + */ + DeleteFolderRecursiveMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.DeleteFolderRecursiveMetadata) + return object; + var message = new $root.google.storage.control.v2.DeleteFolderRecursiveMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.storage.control.v2.DeleteFolderRecursiveMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.fromObject(object.commonMetadata); + } + if (object.folderId != null) + message.folderId = String(object.folderId); + return message; + }; + + /** + * Creates a plain object from a DeleteFolderRecursiveMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {google.storage.control.v2.DeleteFolderRecursiveMetadata} message DeleteFolderRecursiveMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFolderRecursiveMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commonMetadata = null; + object.folderId = ""; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options); + if (message.folderId != null && message.hasOwnProperty("folderId")) + object.folderId = message.folderId; + return object; + }; + + /** + * Converts this DeleteFolderRecursiveMetadata to JSON. + * @function toJSON + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteFolderRecursiveMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFolderRecursiveMetadata + * @function getTypeUrl + * @memberof google.storage.control.v2.DeleteFolderRecursiveMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFolderRecursiveMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.DeleteFolderRecursiveMetadata"; + }; + + return DeleteFolderRecursiveMetadata; + })(); + + v2.StorageLayout = (function() { + + /** + * Properties of a StorageLayout. + * @memberof google.storage.control.v2 + * @interface IStorageLayout + * @property {string|null} [name] StorageLayout name + * @property {string|null} [location] StorageLayout location + * @property {string|null} [locationType] StorageLayout locationType + * @property {google.storage.control.v2.StorageLayout.ICustomPlacementConfig|null} [customPlacementConfig] StorageLayout customPlacementConfig + * @property {google.storage.control.v2.StorageLayout.IHierarchicalNamespace|null} [hierarchicalNamespace] StorageLayout hierarchicalNamespace + */ + + /** + * Constructs a new StorageLayout. + * @memberof google.storage.control.v2 + * @classdesc Represents a StorageLayout. + * @implements IStorageLayout + * @constructor + * @param {google.storage.control.v2.IStorageLayout=} [properties] Properties to set + */ + function StorageLayout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageLayout name. + * @member {string} name + * @memberof google.storage.control.v2.StorageLayout + * @instance + */ + StorageLayout.prototype.name = ""; + + /** + * StorageLayout location. + * @member {string} location + * @memberof google.storage.control.v2.StorageLayout + * @instance + */ + StorageLayout.prototype.location = ""; + + /** + * StorageLayout locationType. + * @member {string} locationType + * @memberof google.storage.control.v2.StorageLayout + * @instance + */ + StorageLayout.prototype.locationType = ""; + + /** + * StorageLayout customPlacementConfig. + * @member {google.storage.control.v2.StorageLayout.ICustomPlacementConfig|null|undefined} customPlacementConfig + * @memberof google.storage.control.v2.StorageLayout + * @instance + */ + StorageLayout.prototype.customPlacementConfig = null; + + /** + * StorageLayout hierarchicalNamespace. + * @member {google.storage.control.v2.StorageLayout.IHierarchicalNamespace|null|undefined} hierarchicalNamespace + * @memberof google.storage.control.v2.StorageLayout + * @instance + */ + StorageLayout.prototype.hierarchicalNamespace = null; + + /** + * Creates a new StorageLayout instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {google.storage.control.v2.IStorageLayout=} [properties] Properties to set + * @returns {google.storage.control.v2.StorageLayout} StorageLayout instance + */ + StorageLayout.create = function create(properties) { + return new StorageLayout(properties); + }; + + /** + * Encodes the specified StorageLayout message. Does not implicitly {@link google.storage.control.v2.StorageLayout.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {google.storage.control.v2.IStorageLayout} message StorageLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageLayout.encode = function encode(message, writer) { + 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.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.locationType); + if (message.customPlacementConfig != null && Object.hasOwnProperty.call(message, "customPlacementConfig")) + $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.encode(message.customPlacementConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hierarchicalNamespace != null && Object.hasOwnProperty.call(message, "hierarchicalNamespace")) + $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.encode(message.hierarchicalNamespace, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StorageLayout message, length delimited. Does not implicitly {@link google.storage.control.v2.StorageLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {google.storage.control.v2.IStorageLayout} message StorageLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageLayout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageLayout message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.StorageLayout} StorageLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageLayout.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.StorageLayout(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.locationType = reader.string(); + break; + } + case 4: { + message.customPlacementConfig = $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hierarchicalNamespace = $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageLayout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.StorageLayout} StorageLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageLayout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageLayout message. + * @function verify + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageLayout.verify = function verify(message) { + if (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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.locationType != null && message.hasOwnProperty("locationType")) + if (!$util.isString(message.locationType)) + return "locationType: string expected"; + if (message.customPlacementConfig != null && message.hasOwnProperty("customPlacementConfig")) { + var error = $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.verify(message.customPlacementConfig); + if (error) + return "customPlacementConfig." + error; + } + if (message.hierarchicalNamespace != null && message.hasOwnProperty("hierarchicalNamespace")) { + var error = $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.verify(message.hierarchicalNamespace); + if (error) + return "hierarchicalNamespace." + error; + } + return null; + }; + + /** + * Creates a StorageLayout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.StorageLayout} StorageLayout + */ + StorageLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.StorageLayout) + return object; + var message = new $root.google.storage.control.v2.StorageLayout(); + if (object.name != null) + message.name = String(object.name); + if (object.location != null) + message.location = String(object.location); + if (object.locationType != null) + message.locationType = String(object.locationType); + if (object.customPlacementConfig != null) { + if (typeof object.customPlacementConfig !== "object") + throw TypeError(".google.storage.control.v2.StorageLayout.customPlacementConfig: object expected"); + message.customPlacementConfig = $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.fromObject(object.customPlacementConfig); + } + if (object.hierarchicalNamespace != null) { + if (typeof object.hierarchicalNamespace !== "object") + throw TypeError(".google.storage.control.v2.StorageLayout.hierarchicalNamespace: object expected"); + message.hierarchicalNamespace = $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.fromObject(object.hierarchicalNamespace); + } + return message; + }; + + /** + * Creates a plain object from a StorageLayout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {google.storage.control.v2.StorageLayout} message StorageLayout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageLayout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.location = ""; + object.locationType = ""; + object.customPlacementConfig = null; + object.hierarchicalNamespace = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.locationType != null && message.hasOwnProperty("locationType")) + object.locationType = message.locationType; + if (message.customPlacementConfig != null && message.hasOwnProperty("customPlacementConfig")) + object.customPlacementConfig = $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.toObject(message.customPlacementConfig, options); + if (message.hierarchicalNamespace != null && message.hasOwnProperty("hierarchicalNamespace")) + object.hierarchicalNamespace = $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.toObject(message.hierarchicalNamespace, options); + return object; + }; + + /** + * Converts this StorageLayout to JSON. + * @function toJSON + * @memberof google.storage.control.v2.StorageLayout + * @instance + * @returns {Object.} JSON object + */ + StorageLayout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StorageLayout + * @function getTypeUrl + * @memberof google.storage.control.v2.StorageLayout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.StorageLayout"; + }; + + StorageLayout.CustomPlacementConfig = (function() { + + /** + * Properties of a CustomPlacementConfig. + * @memberof google.storage.control.v2.StorageLayout + * @interface ICustomPlacementConfig + * @property {Array.|null} [dataLocations] CustomPlacementConfig dataLocations + */ + + /** + * Constructs a new CustomPlacementConfig. + * @memberof google.storage.control.v2.StorageLayout + * @classdesc Represents a CustomPlacementConfig. + * @implements ICustomPlacementConfig + * @constructor + * @param {google.storage.control.v2.StorageLayout.ICustomPlacementConfig=} [properties] Properties to set + */ + function CustomPlacementConfig(properties) { + this.dataLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomPlacementConfig dataLocations. + * @member {Array.} dataLocations + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @instance + */ + CustomPlacementConfig.prototype.dataLocations = $util.emptyArray; + + /** + * Creates a new CustomPlacementConfig instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {google.storage.control.v2.StorageLayout.ICustomPlacementConfig=} [properties] Properties to set + * @returns {google.storage.control.v2.StorageLayout.CustomPlacementConfig} CustomPlacementConfig instance + */ + CustomPlacementConfig.create = function create(properties) { + return new CustomPlacementConfig(properties); + }; + + /** + * Encodes the specified CustomPlacementConfig message. Does not implicitly {@link google.storage.control.v2.StorageLayout.CustomPlacementConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {google.storage.control.v2.StorageLayout.ICustomPlacementConfig} message CustomPlacementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomPlacementConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataLocations != null && message.dataLocations.length) + for (var i = 0; i < message.dataLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataLocations[i]); + return writer; + }; + + /** + * Encodes the specified CustomPlacementConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.StorageLayout.CustomPlacementConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {google.storage.control.v2.StorageLayout.ICustomPlacementConfig} message CustomPlacementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomPlacementConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.StorageLayout.CustomPlacementConfig} CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomPlacementConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataLocations && message.dataLocations.length)) + message.dataLocations = []; + message.dataLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.StorageLayout.CustomPlacementConfig} CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomPlacementConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomPlacementConfig message. + * @function verify + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomPlacementConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataLocations != null && message.hasOwnProperty("dataLocations")) { + if (!Array.isArray(message.dataLocations)) + return "dataLocations: array expected"; + for (var i = 0; i < message.dataLocations.length; ++i) + if (!$util.isString(message.dataLocations[i])) + return "dataLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a CustomPlacementConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.StorageLayout.CustomPlacementConfig} CustomPlacementConfig + */ + CustomPlacementConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig) + return object; + var message = new $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig(); + if (object.dataLocations) { + if (!Array.isArray(object.dataLocations)) + throw TypeError(".google.storage.control.v2.StorageLayout.CustomPlacementConfig.dataLocations: array expected"); + message.dataLocations = []; + for (var i = 0; i < object.dataLocations.length; ++i) + message.dataLocations[i] = String(object.dataLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a CustomPlacementConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {google.storage.control.v2.StorageLayout.CustomPlacementConfig} message CustomPlacementConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomPlacementConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataLocations = []; + if (message.dataLocations && message.dataLocations.length) { + object.dataLocations = []; + for (var j = 0; j < message.dataLocations.length; ++j) + object.dataLocations[j] = message.dataLocations[j]; + } + return object; + }; + + /** + * Converts this CustomPlacementConfig to JSON. + * @function toJSON + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @instance + * @returns {Object.} JSON object + */ + CustomPlacementConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomPlacementConfig + * @function getTypeUrl + * @memberof google.storage.control.v2.StorageLayout.CustomPlacementConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomPlacementConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.StorageLayout.CustomPlacementConfig"; + }; + + return CustomPlacementConfig; + })(); + + StorageLayout.HierarchicalNamespace = (function() { + + /** + * Properties of a HierarchicalNamespace. + * @memberof google.storage.control.v2.StorageLayout + * @interface IHierarchicalNamespace + * @property {boolean|null} [enabled] HierarchicalNamespace enabled + */ + + /** + * Constructs a new HierarchicalNamespace. + * @memberof google.storage.control.v2.StorageLayout + * @classdesc Represents a HierarchicalNamespace. + * @implements IHierarchicalNamespace + * @constructor + * @param {google.storage.control.v2.StorageLayout.IHierarchicalNamespace=} [properties] Properties to set + */ + function HierarchicalNamespace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HierarchicalNamespace enabled. + * @member {boolean} enabled + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @instance + */ + HierarchicalNamespace.prototype.enabled = false; + + /** + * Creates a new HierarchicalNamespace instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {google.storage.control.v2.StorageLayout.IHierarchicalNamespace=} [properties] Properties to set + * @returns {google.storage.control.v2.StorageLayout.HierarchicalNamespace} HierarchicalNamespace instance + */ + HierarchicalNamespace.create = function create(properties) { + return new HierarchicalNamespace(properties); + }; + + /** + * Encodes the specified HierarchicalNamespace message. Does not implicitly {@link google.storage.control.v2.StorageLayout.HierarchicalNamespace.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {google.storage.control.v2.StorageLayout.IHierarchicalNamespace} message HierarchicalNamespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HierarchicalNamespace.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); + return writer; + }; + + /** + * Encodes the specified HierarchicalNamespace message, length delimited. Does not implicitly {@link google.storage.control.v2.StorageLayout.HierarchicalNamespace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {google.storage.control.v2.StorageLayout.IHierarchicalNamespace} message HierarchicalNamespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HierarchicalNamespace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.StorageLayout.HierarchicalNamespace} HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HierarchicalNamespace.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.StorageLayout.HierarchicalNamespace} HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HierarchicalNamespace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HierarchicalNamespace message. + * @function verify + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HierarchicalNamespace.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"; + return null; + }; + + /** + * Creates a HierarchicalNamespace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.StorageLayout.HierarchicalNamespace} HierarchicalNamespace + */ + HierarchicalNamespace.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace) + return object; + var message = new $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a HierarchicalNamespace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {google.storage.control.v2.StorageLayout.HierarchicalNamespace} message HierarchicalNamespace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HierarchicalNamespace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this HierarchicalNamespace to JSON. + * @function toJSON + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @instance + * @returns {Object.} JSON object + */ + HierarchicalNamespace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HierarchicalNamespace + * @function getTypeUrl + * @memberof google.storage.control.v2.StorageLayout.HierarchicalNamespace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HierarchicalNamespace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.StorageLayout.HierarchicalNamespace"; + }; + + return HierarchicalNamespace; + })(); + + return StorageLayout; + })(); + + v2.GetStorageLayoutRequest = (function() { + + /** + * Properties of a GetStorageLayoutRequest. + * @memberof google.storage.control.v2 + * @interface IGetStorageLayoutRequest + * @property {string|null} [name] GetStorageLayoutRequest name + * @property {string|null} [prefix] GetStorageLayoutRequest prefix + * @property {string|null} [requestId] GetStorageLayoutRequest requestId + */ + + /** + * Constructs a new GetStorageLayoutRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetStorageLayoutRequest. + * @implements IGetStorageLayoutRequest + * @constructor + * @param {google.storage.control.v2.IGetStorageLayoutRequest=} [properties] Properties to set + */ + function GetStorageLayoutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStorageLayoutRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @instance + */ + GetStorageLayoutRequest.prototype.name = ""; + + /** + * GetStorageLayoutRequest prefix. + * @member {string} prefix + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @instance + */ + GetStorageLayoutRequest.prototype.prefix = ""; + + /** + * GetStorageLayoutRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @instance + */ + GetStorageLayoutRequest.prototype.requestId = ""; + + /** + * Creates a new GetStorageLayoutRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {google.storage.control.v2.IGetStorageLayoutRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetStorageLayoutRequest} GetStorageLayoutRequest instance + */ + GetStorageLayoutRequest.create = function create(properties) { + return new GetStorageLayoutRequest(properties); + }; + + /** + * Encodes the specified GetStorageLayoutRequest message. Does not implicitly {@link google.storage.control.v2.GetStorageLayoutRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {google.storage.control.v2.IGetStorageLayoutRequest} message GetStorageLayoutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStorageLayoutRequest.encode = function encode(message, writer) { + 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.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prefix); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified GetStorageLayoutRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetStorageLayoutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {google.storage.control.v2.IGetStorageLayoutRequest} message GetStorageLayoutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStorageLayoutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStorageLayoutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetStorageLayoutRequest} GetStorageLayoutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStorageLayoutRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetStorageLayoutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.prefix = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStorageLayoutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetStorageLayoutRequest} GetStorageLayoutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStorageLayoutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStorageLayoutRequest message. + * @function verify + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStorageLayoutRequest.verify = function verify(message) { + if (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.prefix != null && message.hasOwnProperty("prefix")) + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetStorageLayoutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetStorageLayoutRequest} GetStorageLayoutRequest + */ + GetStorageLayoutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetStorageLayoutRequest) + return object; + var message = new $root.google.storage.control.v2.GetStorageLayoutRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.prefix != null) + message.prefix = String(object.prefix); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetStorageLayoutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {google.storage.control.v2.GetStorageLayoutRequest} message GetStorageLayoutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStorageLayoutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.prefix = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = message.prefix; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this GetStorageLayoutRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @instance + * @returns {Object.} JSON object + */ + GetStorageLayoutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStorageLayoutRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetStorageLayoutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStorageLayoutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetStorageLayoutRequest"; + }; + + return GetStorageLayoutRequest; + })(); + + v2.ManagedFolder = (function() { + + /** + * Properties of a ManagedFolder. + * @memberof google.storage.control.v2 + * @interface IManagedFolder + * @property {string|null} [name] ManagedFolder name + * @property {number|Long|null} [metageneration] ManagedFolder metageneration + * @property {google.protobuf.ITimestamp|null} [createTime] ManagedFolder createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ManagedFolder updateTime + */ + + /** + * Constructs a new ManagedFolder. + * @memberof google.storage.control.v2 + * @classdesc Represents a ManagedFolder. + * @implements IManagedFolder + * @constructor + * @param {google.storage.control.v2.IManagedFolder=} [properties] Properties to set + */ + function ManagedFolder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedFolder name. + * @member {string} name + * @memberof google.storage.control.v2.ManagedFolder + * @instance + */ + ManagedFolder.prototype.name = ""; + + /** + * ManagedFolder metageneration. + * @member {number|Long} metageneration + * @memberof google.storage.control.v2.ManagedFolder + * @instance + */ + ManagedFolder.prototype.metageneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ManagedFolder createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.control.v2.ManagedFolder + * @instance + */ + ManagedFolder.prototype.createTime = null; + + /** + * ManagedFolder updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.control.v2.ManagedFolder + * @instance + */ + ManagedFolder.prototype.updateTime = null; + + /** + * Creates a new ManagedFolder instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {google.storage.control.v2.IManagedFolder=} [properties] Properties to set + * @returns {google.storage.control.v2.ManagedFolder} ManagedFolder instance + */ + ManagedFolder.create = function create(properties) { + return new ManagedFolder(properties); + }; + + /** + * Encodes the specified ManagedFolder message. Does not implicitly {@link google.storage.control.v2.ManagedFolder.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {google.storage.control.v2.IManagedFolder} message ManagedFolder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedFolder.encode = function encode(message, writer) { + 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.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.metageneration); + 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(); + return writer; + }; + + /** + * Encodes the specified ManagedFolder message, length delimited. Does not implicitly {@link google.storage.control.v2.ManagedFolder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {google.storage.control.v2.IManagedFolder} message ManagedFolder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedFolder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedFolder message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ManagedFolder} ManagedFolder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedFolder.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ManagedFolder(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.metageneration = reader.int64(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedFolder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ManagedFolder} ManagedFolder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedFolder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedFolder message. + * @function verify + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedFolder.verify = function verify(message) { + if (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.metageneration != null && message.hasOwnProperty("metageneration")) + if (!$util.isInteger(message.metageneration) && !(message.metageneration && $util.isInteger(message.metageneration.low) && $util.isInteger(message.metageneration.high))) + return "metageneration: integer|Long 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 ManagedFolder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ManagedFolder} ManagedFolder + */ + ManagedFolder.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ManagedFolder) + return object; + var message = new $root.google.storage.control.v2.ManagedFolder(); + if (object.name != null) + message.name = String(object.name); + if (object.metageneration != null) + if ($util.Long) + (message.metageneration = $util.Long.fromValue(object.metageneration)).unsigned = false; + else if (typeof object.metageneration === "string") + message.metageneration = parseInt(object.metageneration, 10); + else if (typeof object.metageneration === "number") + message.metageneration = object.metageneration; + else if (typeof object.metageneration === "object") + message.metageneration = new $util.LongBits(object.metageneration.low >>> 0, object.metageneration.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.control.v2.ManagedFolder.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.control.v2.ManagedFolder.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a ManagedFolder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {google.storage.control.v2.ManagedFolder} message ManagedFolder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedFolder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.metageneration = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metageneration != null && message.hasOwnProperty("metageneration")) + if (typeof message.metageneration === "number") + object.metageneration = options.longs === String ? String(message.metageneration) : message.metageneration; + else + object.metageneration = options.longs === String ? $util.Long.prototype.toString.call(message.metageneration) : options.longs === Number ? new $util.LongBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0).toNumber() : message.metageneration; + 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 ManagedFolder to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ManagedFolder + * @instance + * @returns {Object.} JSON object + */ + ManagedFolder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagedFolder + * @function getTypeUrl + * @memberof google.storage.control.v2.ManagedFolder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagedFolder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ManagedFolder"; + }; + + return ManagedFolder; + })(); + + v2.GetManagedFolderRequest = (function() { + + /** + * Properties of a GetManagedFolderRequest. + * @memberof google.storage.control.v2 + * @interface IGetManagedFolderRequest + * @property {string|null} [name] GetManagedFolderRequest name + * @property {number|Long|null} [ifMetagenerationMatch] GetManagedFolderRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] GetManagedFolderRequest ifMetagenerationNotMatch + * @property {string|null} [requestId] GetManagedFolderRequest requestId + */ + + /** + * Constructs a new GetManagedFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetManagedFolderRequest. + * @implements IGetManagedFolderRequest + * @constructor + * @param {google.storage.control.v2.IGetManagedFolderRequest=} [properties] Properties to set + */ + function GetManagedFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetManagedFolderRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @instance + */ + GetManagedFolderRequest.prototype.name = ""; + + /** + * GetManagedFolderRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @instance + */ + GetManagedFolderRequest.prototype.ifMetagenerationMatch = null; + + /** + * GetManagedFolderRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @instance + */ + GetManagedFolderRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * GetManagedFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @instance + */ + GetManagedFolderRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetManagedFolderRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetManagedFolderRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetManagedFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {google.storage.control.v2.IGetManagedFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetManagedFolderRequest} GetManagedFolderRequest instance + */ + GetManagedFolderRequest.create = function create(properties) { + return new GetManagedFolderRequest(properties); + }; + + /** + * Encodes the specified GetManagedFolderRequest message. Does not implicitly {@link google.storage.control.v2.GetManagedFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {google.storage.control.v2.IGetManagedFolderRequest} message GetManagedFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetManagedFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationNotMatch); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetManagedFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetManagedFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {google.storage.control.v2.IGetManagedFolderRequest} message GetManagedFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetManagedFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetManagedFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetManagedFolderRequest} GetManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetManagedFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetManagedFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.name = reader.string(); + break; + } + case 3: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 4: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetManagedFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetManagedFolderRequest} GetManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetManagedFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetManagedFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetManagedFolderRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetManagedFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetManagedFolderRequest} GetManagedFolderRequest + */ + GetManagedFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetManagedFolderRequest) + return object; + var message = new $root.google.storage.control.v2.GetManagedFolderRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetManagedFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {google.storage.control.v2.GetManagedFolderRequest} message GetManagedFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetManagedFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.name = ""; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetManagedFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @instance + * @returns {Object.} JSON object + */ + GetManagedFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetManagedFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetManagedFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetManagedFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetManagedFolderRequest"; + }; + + return GetManagedFolderRequest; + })(); + + v2.CreateManagedFolderRequest = (function() { + + /** + * Properties of a CreateManagedFolderRequest. + * @memberof google.storage.control.v2 + * @interface ICreateManagedFolderRequest + * @property {string|null} [parent] CreateManagedFolderRequest parent + * @property {google.storage.control.v2.IManagedFolder|null} [managedFolder] CreateManagedFolderRequest managedFolder + * @property {string|null} [managedFolderId] CreateManagedFolderRequest managedFolderId + * @property {string|null} [requestId] CreateManagedFolderRequest requestId + */ + + /** + * Constructs a new CreateManagedFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a CreateManagedFolderRequest. + * @implements ICreateManagedFolderRequest + * @constructor + * @param {google.storage.control.v2.ICreateManagedFolderRequest=} [properties] Properties to set + */ + function CreateManagedFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateManagedFolderRequest parent. + * @member {string} parent + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @instance + */ + CreateManagedFolderRequest.prototype.parent = ""; + + /** + * CreateManagedFolderRequest managedFolder. + * @member {google.storage.control.v2.IManagedFolder|null|undefined} managedFolder + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @instance + */ + CreateManagedFolderRequest.prototype.managedFolder = null; + + /** + * CreateManagedFolderRequest managedFolderId. + * @member {string} managedFolderId + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @instance + */ + CreateManagedFolderRequest.prototype.managedFolderId = ""; + + /** + * CreateManagedFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @instance + */ + CreateManagedFolderRequest.prototype.requestId = ""; + + /** + * Creates a new CreateManagedFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {google.storage.control.v2.ICreateManagedFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.CreateManagedFolderRequest} CreateManagedFolderRequest instance + */ + CreateManagedFolderRequest.create = function create(properties) { + return new CreateManagedFolderRequest(properties); + }; + + /** + * Encodes the specified CreateManagedFolderRequest message. Does not implicitly {@link google.storage.control.v2.CreateManagedFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {google.storage.control.v2.ICreateManagedFolderRequest} message CreateManagedFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateManagedFolderRequest.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.managedFolder != null && Object.hasOwnProperty.call(message, "managedFolder")) + $root.google.storage.control.v2.ManagedFolder.encode(message.managedFolder, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.managedFolderId != null && Object.hasOwnProperty.call(message, "managedFolderId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.managedFolderId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateManagedFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateManagedFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {google.storage.control.v2.ICreateManagedFolderRequest} message CreateManagedFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateManagedFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateManagedFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.CreateManagedFolderRequest} CreateManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateManagedFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.CreateManagedFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.managedFolder = $root.google.storage.control.v2.ManagedFolder.decode(reader, reader.uint32()); + break; + } + case 3: { + message.managedFolderId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateManagedFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.CreateManagedFolderRequest} CreateManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateManagedFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateManagedFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateManagedFolderRequest.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.managedFolder != null && message.hasOwnProperty("managedFolder")) { + var error = $root.google.storage.control.v2.ManagedFolder.verify(message.managedFolder); + if (error) + return "managedFolder." + error; + } + if (message.managedFolderId != null && message.hasOwnProperty("managedFolderId")) + if (!$util.isString(message.managedFolderId)) + return "managedFolderId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateManagedFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.CreateManagedFolderRequest} CreateManagedFolderRequest + */ + CreateManagedFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.CreateManagedFolderRequest) + return object; + var message = new $root.google.storage.control.v2.CreateManagedFolderRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.managedFolder != null) { + if (typeof object.managedFolder !== "object") + throw TypeError(".google.storage.control.v2.CreateManagedFolderRequest.managedFolder: object expected"); + message.managedFolder = $root.google.storage.control.v2.ManagedFolder.fromObject(object.managedFolder); + } + if (object.managedFolderId != null) + message.managedFolderId = String(object.managedFolderId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateManagedFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {google.storage.control.v2.CreateManagedFolderRequest} message CreateManagedFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateManagedFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.managedFolder = null; + object.managedFolderId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.managedFolder != null && message.hasOwnProperty("managedFolder")) + object.managedFolder = $root.google.storage.control.v2.ManagedFolder.toObject(message.managedFolder, options); + if (message.managedFolderId != null && message.hasOwnProperty("managedFolderId")) + object.managedFolderId = message.managedFolderId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateManagedFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @instance + * @returns {Object.} JSON object + */ + CreateManagedFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateManagedFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.CreateManagedFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateManagedFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.CreateManagedFolderRequest"; + }; + + return CreateManagedFolderRequest; + })(); + + v2.DeleteManagedFolderRequest = (function() { + + /** + * Properties of a DeleteManagedFolderRequest. + * @memberof google.storage.control.v2 + * @interface IDeleteManagedFolderRequest + * @property {string|null} [name] DeleteManagedFolderRequest name + * @property {number|Long|null} [ifMetagenerationMatch] DeleteManagedFolderRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] DeleteManagedFolderRequest ifMetagenerationNotMatch + * @property {boolean|null} [allowNonEmpty] DeleteManagedFolderRequest allowNonEmpty + * @property {string|null} [requestId] DeleteManagedFolderRequest requestId + */ + + /** + * Constructs a new DeleteManagedFolderRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a DeleteManagedFolderRequest. + * @implements IDeleteManagedFolderRequest + * @constructor + * @param {google.storage.control.v2.IDeleteManagedFolderRequest=} [properties] Properties to set + */ + function DeleteManagedFolderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteManagedFolderRequest name. + * @member {string} name + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @instance + */ + DeleteManagedFolderRequest.prototype.name = ""; + + /** + * DeleteManagedFolderRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @instance + */ + DeleteManagedFolderRequest.prototype.ifMetagenerationMatch = null; + + /** + * DeleteManagedFolderRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @instance + */ + DeleteManagedFolderRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * DeleteManagedFolderRequest allowNonEmpty. + * @member {boolean} allowNonEmpty + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @instance + */ + DeleteManagedFolderRequest.prototype.allowNonEmpty = false; + + /** + * DeleteManagedFolderRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @instance + */ + DeleteManagedFolderRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteManagedFolderRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteManagedFolderRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteManagedFolderRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {google.storage.control.v2.IDeleteManagedFolderRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.DeleteManagedFolderRequest} DeleteManagedFolderRequest instance + */ + DeleteManagedFolderRequest.create = function create(properties) { + return new DeleteManagedFolderRequest(properties); + }; + + /** + * Encodes the specified DeleteManagedFolderRequest message. Does not implicitly {@link google.storage.control.v2.DeleteManagedFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {google.storage.control.v2.IDeleteManagedFolderRequest} message DeleteManagedFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteManagedFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationNotMatch); + if (message.allowNonEmpty != null && Object.hasOwnProperty.call(message, "allowNonEmpty")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowNonEmpty); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteManagedFolderRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DeleteManagedFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {google.storage.control.v2.IDeleteManagedFolderRequest} message DeleteManagedFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteManagedFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteManagedFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.DeleteManagedFolderRequest} DeleteManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteManagedFolderRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.DeleteManagedFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.name = reader.string(); + break; + } + case 3: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 4: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 5: { + message.allowNonEmpty = reader.bool(); + break; + } + case 6: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteManagedFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.DeleteManagedFolderRequest} DeleteManagedFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteManagedFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteManagedFolderRequest message. + * @function verify + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteManagedFolderRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.allowNonEmpty != null && message.hasOwnProperty("allowNonEmpty")) + if (typeof message.allowNonEmpty !== "boolean") + return "allowNonEmpty: boolean expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteManagedFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.DeleteManagedFolderRequest} DeleteManagedFolderRequest + */ + DeleteManagedFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.DeleteManagedFolderRequest) + return object; + var message = new $root.google.storage.control.v2.DeleteManagedFolderRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.allowNonEmpty != null) + message.allowNonEmpty = Boolean(object.allowNonEmpty); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteManagedFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {google.storage.control.v2.DeleteManagedFolderRequest} message DeleteManagedFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteManagedFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.allowNonEmpty = false; + object.requestId = ""; + object.name = ""; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.allowNonEmpty != null && message.hasOwnProperty("allowNonEmpty")) + object.allowNonEmpty = message.allowNonEmpty; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteManagedFolderRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteManagedFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteManagedFolderRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.DeleteManagedFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteManagedFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.DeleteManagedFolderRequest"; + }; + + return DeleteManagedFolderRequest; + })(); + + v2.ListManagedFoldersRequest = (function() { + + /** + * Properties of a ListManagedFoldersRequest. + * @memberof google.storage.control.v2 + * @interface IListManagedFoldersRequest + * @property {string|null} [parent] ListManagedFoldersRequest parent + * @property {number|null} [pageSize] ListManagedFoldersRequest pageSize + * @property {string|null} [pageToken] ListManagedFoldersRequest pageToken + * @property {string|null} [prefix] ListManagedFoldersRequest prefix + * @property {string|null} [requestId] ListManagedFoldersRequest requestId + */ + + /** + * Constructs a new ListManagedFoldersRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a ListManagedFoldersRequest. + * @implements IListManagedFoldersRequest + * @constructor + * @param {google.storage.control.v2.IListManagedFoldersRequest=} [properties] Properties to set + */ + function ListManagedFoldersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListManagedFoldersRequest parent. + * @member {string} parent + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @instance + */ + ListManagedFoldersRequest.prototype.parent = ""; + + /** + * ListManagedFoldersRequest pageSize. + * @member {number} pageSize + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @instance + */ + ListManagedFoldersRequest.prototype.pageSize = 0; + + /** + * ListManagedFoldersRequest pageToken. + * @member {string} pageToken + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @instance + */ + ListManagedFoldersRequest.prototype.pageToken = ""; + + /** + * ListManagedFoldersRequest prefix. + * @member {string} prefix + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @instance + */ + ListManagedFoldersRequest.prototype.prefix = ""; + + /** + * ListManagedFoldersRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @instance + */ + ListManagedFoldersRequest.prototype.requestId = ""; + + /** + * Creates a new ListManagedFoldersRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {google.storage.control.v2.IListManagedFoldersRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.ListManagedFoldersRequest} ListManagedFoldersRequest instance + */ + ListManagedFoldersRequest.create = function create(properties) { + return new ListManagedFoldersRequest(properties); + }; + + /** + * Encodes the specified ListManagedFoldersRequest message. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {google.storage.control.v2.IListManagedFoldersRequest} message ListManagedFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedFoldersRequest.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.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prefix); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ListManagedFoldersRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {google.storage.control.v2.IListManagedFoldersRequest} message ListManagedFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedFoldersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListManagedFoldersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ListManagedFoldersRequest} ListManagedFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedFoldersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ListManagedFoldersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.prefix = reader.string(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListManagedFoldersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ListManagedFoldersRequest} ListManagedFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedFoldersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListManagedFoldersRequest message. + * @function verify + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListManagedFoldersRequest.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.prefix != null && message.hasOwnProperty("prefix")) + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ListManagedFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ListManagedFoldersRequest} ListManagedFoldersRequest + */ + ListManagedFoldersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ListManagedFoldersRequest) + return object; + var message = new $root.google.storage.control.v2.ListManagedFoldersRequest(); + 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.prefix != null) + message.prefix = String(object.prefix); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ListManagedFoldersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {google.storage.control.v2.ListManagedFoldersRequest} message ListManagedFoldersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListManagedFoldersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.prefix = ""; + 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.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = message.prefix; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ListManagedFoldersRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @instance + * @returns {Object.} JSON object + */ + ListManagedFoldersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListManagedFoldersRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.ListManagedFoldersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListManagedFoldersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ListManagedFoldersRequest"; + }; + + return ListManagedFoldersRequest; + })(); + + v2.ListManagedFoldersResponse = (function() { + + /** + * Properties of a ListManagedFoldersResponse. + * @memberof google.storage.control.v2 + * @interface IListManagedFoldersResponse + * @property {Array.|null} [managedFolders] ListManagedFoldersResponse managedFolders + * @property {string|null} [nextPageToken] ListManagedFoldersResponse nextPageToken + */ + + /** + * Constructs a new ListManagedFoldersResponse. + * @memberof google.storage.control.v2 + * @classdesc Represents a ListManagedFoldersResponse. + * @implements IListManagedFoldersResponse + * @constructor + * @param {google.storage.control.v2.IListManagedFoldersResponse=} [properties] Properties to set + */ + function ListManagedFoldersResponse(properties) { + this.managedFolders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListManagedFoldersResponse managedFolders. + * @member {Array.} managedFolders + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @instance + */ + ListManagedFoldersResponse.prototype.managedFolders = $util.emptyArray; + + /** + * ListManagedFoldersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @instance + */ + ListManagedFoldersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListManagedFoldersResponse instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {google.storage.control.v2.IListManagedFoldersResponse=} [properties] Properties to set + * @returns {google.storage.control.v2.ListManagedFoldersResponse} ListManagedFoldersResponse instance + */ + ListManagedFoldersResponse.create = function create(properties) { + return new ListManagedFoldersResponse(properties); + }; + + /** + * Encodes the specified ListManagedFoldersResponse message. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {google.storage.control.v2.IListManagedFoldersResponse} message ListManagedFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedFoldersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managedFolders != null && message.managedFolders.length) + for (var i = 0; i < message.managedFolders.length; ++i) + $root.google.storage.control.v2.ManagedFolder.encode(message.managedFolders[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 ListManagedFoldersResponse message, length delimited. Does not implicitly {@link google.storage.control.v2.ListManagedFoldersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {google.storage.control.v2.IListManagedFoldersResponse} message ListManagedFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedFoldersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListManagedFoldersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ListManagedFoldersResponse} ListManagedFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedFoldersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ListManagedFoldersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.managedFolders && message.managedFolders.length)) + message.managedFolders = []; + message.managedFolders.push($root.google.storage.control.v2.ManagedFolder.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListManagedFoldersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ListManagedFoldersResponse} ListManagedFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedFoldersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListManagedFoldersResponse message. + * @function verify + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListManagedFoldersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.managedFolders != null && message.hasOwnProperty("managedFolders")) { + if (!Array.isArray(message.managedFolders)) + return "managedFolders: array expected"; + for (var i = 0; i < message.managedFolders.length; ++i) { + var error = $root.google.storage.control.v2.ManagedFolder.verify(message.managedFolders[i]); + if (error) + return "managedFolders." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListManagedFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ListManagedFoldersResponse} ListManagedFoldersResponse + */ + ListManagedFoldersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ListManagedFoldersResponse) + return object; + var message = new $root.google.storage.control.v2.ListManagedFoldersResponse(); + if (object.managedFolders) { + if (!Array.isArray(object.managedFolders)) + throw TypeError(".google.storage.control.v2.ListManagedFoldersResponse.managedFolders: array expected"); + message.managedFolders = []; + for (var i = 0; i < object.managedFolders.length; ++i) { + if (typeof object.managedFolders[i] !== "object") + throw TypeError(".google.storage.control.v2.ListManagedFoldersResponse.managedFolders: object expected"); + message.managedFolders[i] = $root.google.storage.control.v2.ManagedFolder.fromObject(object.managedFolders[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListManagedFoldersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {google.storage.control.v2.ListManagedFoldersResponse} message ListManagedFoldersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListManagedFoldersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.managedFolders = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.managedFolders && message.managedFolders.length) { + object.managedFolders = []; + for (var j = 0; j < message.managedFolders.length; ++j) + object.managedFolders[j] = $root.google.storage.control.v2.ManagedFolder.toObject(message.managedFolders[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListManagedFoldersResponse to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @instance + * @returns {Object.} JSON object + */ + ListManagedFoldersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListManagedFoldersResponse + * @function getTypeUrl + * @memberof google.storage.control.v2.ListManagedFoldersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListManagedFoldersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ListManagedFoldersResponse"; + }; + + return ListManagedFoldersResponse; + })(); + + v2.CreateAnywhereCacheMetadata = (function() { + + /** + * Properties of a CreateAnywhereCacheMetadata. + * @memberof google.storage.control.v2 + * @interface ICreateAnywhereCacheMetadata + * @property {google.storage.control.v2.ICommonLongRunningOperationMetadata|null} [commonMetadata] CreateAnywhereCacheMetadata commonMetadata + * @property {string|null} [anywhereCacheId] CreateAnywhereCacheMetadata anywhereCacheId + * @property {string|null} [zone] CreateAnywhereCacheMetadata zone + * @property {google.protobuf.IDuration|null} [ttl] CreateAnywhereCacheMetadata ttl + * @property {string|null} [admissionPolicy] CreateAnywhereCacheMetadata admissionPolicy + */ + + /** + * Constructs a new CreateAnywhereCacheMetadata. + * @memberof google.storage.control.v2 + * @classdesc Represents a CreateAnywhereCacheMetadata. + * @implements ICreateAnywhereCacheMetadata + * @constructor + * @param {google.storage.control.v2.ICreateAnywhereCacheMetadata=} [properties] Properties to set + */ + function CreateAnywhereCacheMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnywhereCacheMetadata commonMetadata. + * @member {google.storage.control.v2.ICommonLongRunningOperationMetadata|null|undefined} commonMetadata + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @instance + */ + CreateAnywhereCacheMetadata.prototype.commonMetadata = null; + + /** + * CreateAnywhereCacheMetadata anywhereCacheId. + * @member {string|null|undefined} anywhereCacheId + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @instance + */ + CreateAnywhereCacheMetadata.prototype.anywhereCacheId = null; + + /** + * CreateAnywhereCacheMetadata zone. + * @member {string|null|undefined} zone + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @instance + */ + CreateAnywhereCacheMetadata.prototype.zone = null; + + /** + * CreateAnywhereCacheMetadata ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @instance + */ + CreateAnywhereCacheMetadata.prototype.ttl = null; + + /** + * CreateAnywhereCacheMetadata admissionPolicy. + * @member {string|null|undefined} admissionPolicy + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @instance + */ + CreateAnywhereCacheMetadata.prototype.admissionPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateAnywhereCacheMetadata.prototype, "_anywhereCacheId", { + get: $util.oneOfGetter($oneOfFields = ["anywhereCacheId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateAnywhereCacheMetadata.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateAnywhereCacheMetadata.prototype, "_ttl", { + get: $util.oneOfGetter($oneOfFields = ["ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateAnywhereCacheMetadata.prototype, "_admissionPolicy", { + get: $util.oneOfGetter($oneOfFields = ["admissionPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateAnywhereCacheMetadata instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.ICreateAnywhereCacheMetadata=} [properties] Properties to set + * @returns {google.storage.control.v2.CreateAnywhereCacheMetadata} CreateAnywhereCacheMetadata instance + */ + CreateAnywhereCacheMetadata.create = function create(properties) { + return new CreateAnywhereCacheMetadata(properties); + }; + + /** + * Encodes the specified CreateAnywhereCacheMetadata message. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheMetadata.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.ICreateAnywhereCacheMetadata} message CreateAnywhereCacheMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnywhereCacheMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.storage.control.v2.CommonLongRunningOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.anywhereCacheId != null && Object.hasOwnProperty.call(message, "anywhereCacheId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.anywhereCacheId); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.admissionPolicy != null && Object.hasOwnProperty.call(message, "admissionPolicy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.admissionPolicy); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.zone); + return writer; + }; + + /** + * Encodes the specified CreateAnywhereCacheMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.ICreateAnywhereCacheMetadata} message CreateAnywhereCacheMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnywhereCacheMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnywhereCacheMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.CreateAnywhereCacheMetadata} CreateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnywhereCacheMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.CreateAnywhereCacheMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.anywhereCacheId = reader.string(); + break; + } + case 6: { + message.zone = reader.string(); + break; + } + case 3: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.admissionPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnywhereCacheMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.CreateAnywhereCacheMetadata} CreateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnywhereCacheMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnywhereCacheMetadata message. + * @function verify + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnywhereCacheMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.anywhereCacheId != null && message.hasOwnProperty("anywhereCacheId")) { + properties._anywhereCacheId = 1; + if (!$util.isString(message.anywhereCacheId)) + return "anywhereCacheId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + properties._ttl = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { + properties._admissionPolicy = 1; + if (!$util.isString(message.admissionPolicy)) + return "admissionPolicy: string expected"; + } + return null; + }; + + /** + * Creates a CreateAnywhereCacheMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.CreateAnywhereCacheMetadata} CreateAnywhereCacheMetadata + */ + CreateAnywhereCacheMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.CreateAnywhereCacheMetadata) + return object; + var message = new $root.google.storage.control.v2.CreateAnywhereCacheMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.storage.control.v2.CreateAnywhereCacheMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.fromObject(object.commonMetadata); + } + if (object.anywhereCacheId != null) + message.anywhereCacheId = String(object.anywhereCacheId); + if (object.zone != null) + message.zone = String(object.zone); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.storage.control.v2.CreateAnywhereCacheMetadata.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.admissionPolicy != null) + message.admissionPolicy = String(object.admissionPolicy); + return message; + }; + + /** + * Creates a plain object from a CreateAnywhereCacheMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.CreateAnywhereCacheMetadata} message CreateAnywhereCacheMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnywhereCacheMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options); + if (message.anywhereCacheId != null && message.hasOwnProperty("anywhereCacheId")) { + object.anywhereCacheId = message.anywhereCacheId; + if (options.oneofs) + object._anywhereCacheId = "anywhereCacheId"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object._ttl = "ttl"; + } + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { + object.admissionPolicy = message.admissionPolicy; + if (options.oneofs) + object._admissionPolicy = "admissionPolicy"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + return object; + }; + + /** + * Converts this CreateAnywhereCacheMetadata to JSON. + * @function toJSON + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateAnywhereCacheMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnywhereCacheMetadata + * @function getTypeUrl + * @memberof google.storage.control.v2.CreateAnywhereCacheMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnywhereCacheMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.CreateAnywhereCacheMetadata"; + }; + + return CreateAnywhereCacheMetadata; + })(); + + v2.UpdateAnywhereCacheMetadata = (function() { + + /** + * Properties of an UpdateAnywhereCacheMetadata. + * @memberof google.storage.control.v2 + * @interface IUpdateAnywhereCacheMetadata + * @property {google.storage.control.v2.ICommonLongRunningOperationMetadata|null} [commonMetadata] UpdateAnywhereCacheMetadata commonMetadata + * @property {string|null} [anywhereCacheId] UpdateAnywhereCacheMetadata anywhereCacheId + * @property {string|null} [zone] UpdateAnywhereCacheMetadata zone + * @property {google.protobuf.IDuration|null} [ttl] UpdateAnywhereCacheMetadata ttl + * @property {string|null} [admissionPolicy] UpdateAnywhereCacheMetadata admissionPolicy + */ + + /** + * Constructs a new UpdateAnywhereCacheMetadata. + * @memberof google.storage.control.v2 + * @classdesc Represents an UpdateAnywhereCacheMetadata. + * @implements IUpdateAnywhereCacheMetadata + * @constructor + * @param {google.storage.control.v2.IUpdateAnywhereCacheMetadata=} [properties] Properties to set + */ + function UpdateAnywhereCacheMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAnywhereCacheMetadata commonMetadata. + * @member {google.storage.control.v2.ICommonLongRunningOperationMetadata|null|undefined} commonMetadata + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @instance + */ + UpdateAnywhereCacheMetadata.prototype.commonMetadata = null; + + /** + * UpdateAnywhereCacheMetadata anywhereCacheId. + * @member {string|null|undefined} anywhereCacheId + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @instance + */ + UpdateAnywhereCacheMetadata.prototype.anywhereCacheId = null; + + /** + * UpdateAnywhereCacheMetadata zone. + * @member {string|null|undefined} zone + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @instance + */ + UpdateAnywhereCacheMetadata.prototype.zone = null; + + /** + * UpdateAnywhereCacheMetadata ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @instance + */ + UpdateAnywhereCacheMetadata.prototype.ttl = null; + + /** + * UpdateAnywhereCacheMetadata admissionPolicy. + * @member {string|null|undefined} admissionPolicy + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @instance + */ + UpdateAnywhereCacheMetadata.prototype.admissionPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateAnywhereCacheMetadata.prototype, "_anywhereCacheId", { + get: $util.oneOfGetter($oneOfFields = ["anywhereCacheId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateAnywhereCacheMetadata.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateAnywhereCacheMetadata.prototype, "_ttl", { + get: $util.oneOfGetter($oneOfFields = ["ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateAnywhereCacheMetadata.prototype, "_admissionPolicy", { + get: $util.oneOfGetter($oneOfFields = ["admissionPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateAnywhereCacheMetadata instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.IUpdateAnywhereCacheMetadata=} [properties] Properties to set + * @returns {google.storage.control.v2.UpdateAnywhereCacheMetadata} UpdateAnywhereCacheMetadata instance + */ + UpdateAnywhereCacheMetadata.create = function create(properties) { + return new UpdateAnywhereCacheMetadata(properties); + }; + + /** + * Encodes the specified UpdateAnywhereCacheMetadata message. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheMetadata.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.IUpdateAnywhereCacheMetadata} message UpdateAnywhereCacheMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnywhereCacheMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.storage.control.v2.CommonLongRunningOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.anywhereCacheId != null && Object.hasOwnProperty.call(message, "anywhereCacheId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.anywhereCacheId); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.admissionPolicy != null && Object.hasOwnProperty.call(message, "admissionPolicy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.admissionPolicy); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.zone); + return writer; + }; + + /** + * Encodes the specified UpdateAnywhereCacheMetadata message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.IUpdateAnywhereCacheMetadata} message UpdateAnywhereCacheMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnywhereCacheMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAnywhereCacheMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.UpdateAnywhereCacheMetadata} UpdateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnywhereCacheMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.UpdateAnywhereCacheMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.anywhereCacheId = reader.string(); + break; + } + case 5: { + message.zone = reader.string(); + break; + } + case 3: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.admissionPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAnywhereCacheMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.UpdateAnywhereCacheMetadata} UpdateAnywhereCacheMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnywhereCacheMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAnywhereCacheMetadata message. + * @function verify + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAnywhereCacheMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.anywhereCacheId != null && message.hasOwnProperty("anywhereCacheId")) { + properties._anywhereCacheId = 1; + if (!$util.isString(message.anywhereCacheId)) + return "anywhereCacheId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + properties._ttl = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { + properties._admissionPolicy = 1; + if (!$util.isString(message.admissionPolicy)) + return "admissionPolicy: string expected"; + } + return null; + }; + + /** + * Creates an UpdateAnywhereCacheMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.UpdateAnywhereCacheMetadata} UpdateAnywhereCacheMetadata + */ + UpdateAnywhereCacheMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.UpdateAnywhereCacheMetadata) + return object; + var message = new $root.google.storage.control.v2.UpdateAnywhereCacheMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.fromObject(object.commonMetadata); + } + if (object.anywhereCacheId != null) + message.anywhereCacheId = String(object.anywhereCacheId); + if (object.zone != null) + message.zone = String(object.zone); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheMetadata.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.admissionPolicy != null) + message.admissionPolicy = String(object.admissionPolicy); + return message; + }; + + /** + * Creates a plain object from an UpdateAnywhereCacheMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {google.storage.control.v2.UpdateAnywhereCacheMetadata} message UpdateAnywhereCacheMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAnywhereCacheMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options); + if (message.anywhereCacheId != null && message.hasOwnProperty("anywhereCacheId")) { + object.anywhereCacheId = message.anywhereCacheId; + if (options.oneofs) + object._anywhereCacheId = "anywhereCacheId"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object._ttl = "ttl"; + } + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { + object.admissionPolicy = message.admissionPolicy; + if (options.oneofs) + object._admissionPolicy = "admissionPolicy"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + return object; + }; + + /** + * Converts this UpdateAnywhereCacheMetadata to JSON. + * @function toJSON + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateAnywhereCacheMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAnywhereCacheMetadata + * @function getTypeUrl + * @memberof google.storage.control.v2.UpdateAnywhereCacheMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAnywhereCacheMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.UpdateAnywhereCacheMetadata"; + }; + + return UpdateAnywhereCacheMetadata; + })(); + + v2.AnywhereCache = (function() { + + /** + * Properties of an AnywhereCache. + * @memberof google.storage.control.v2 + * @interface IAnywhereCache + * @property {string|null} [name] AnywhereCache name + * @property {string|null} [zone] AnywhereCache zone + * @property {google.protobuf.IDuration|null} [ttl] AnywhereCache ttl + * @property {string|null} [admissionPolicy] AnywhereCache admissionPolicy + * @property {string|null} [state] AnywhereCache state + * @property {google.protobuf.ITimestamp|null} [createTime] AnywhereCache createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AnywhereCache updateTime + * @property {boolean|null} [pendingUpdate] AnywhereCache pendingUpdate + */ + + /** + * Constructs a new AnywhereCache. + * @memberof google.storage.control.v2 + * @classdesc Represents an AnywhereCache. + * @implements IAnywhereCache + * @constructor + * @param {google.storage.control.v2.IAnywhereCache=} [properties] Properties to set + */ + function AnywhereCache(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnywhereCache name. + * @member {string} name + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.name = ""; + + /** + * AnywhereCache zone. + * @member {string} zone + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.zone = ""; + + /** + * AnywhereCache ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.ttl = null; + + /** + * AnywhereCache admissionPolicy. + * @member {string} admissionPolicy + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.admissionPolicy = ""; + + /** + * AnywhereCache state. + * @member {string} state + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.state = ""; + + /** + * AnywhereCache createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.createTime = null; + + /** + * AnywhereCache updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.updateTime = null; + + /** + * AnywhereCache pendingUpdate. + * @member {boolean} pendingUpdate + * @memberof google.storage.control.v2.AnywhereCache + * @instance + */ + AnywhereCache.prototype.pendingUpdate = false; + + /** + * Creates a new AnywhereCache instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {google.storage.control.v2.IAnywhereCache=} [properties] Properties to set + * @returns {google.storage.control.v2.AnywhereCache} AnywhereCache instance + */ + AnywhereCache.create = function create(properties) { + return new AnywhereCache(properties); + }; + + /** + * Encodes the specified AnywhereCache message. Does not implicitly {@link google.storage.control.v2.AnywhereCache.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {google.storage.control.v2.IAnywhereCache} message AnywhereCache message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnywhereCache.encode = function encode(message, writer) { + 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.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pendingUpdate != null && Object.hasOwnProperty.call(message, "pendingUpdate")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.pendingUpdate); + if (message.admissionPolicy != null && Object.hasOwnProperty.call(message, "admissionPolicy")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.admissionPolicy); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.zone); + return writer; + }; + + /** + * Encodes the specified AnywhereCache message, length delimited. Does not implicitly {@link google.storage.control.v2.AnywhereCache.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {google.storage.control.v2.IAnywhereCache} message AnywhereCache message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnywhereCache.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnywhereCache message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.AnywhereCache} AnywhereCache + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnywhereCache.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.AnywhereCache(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 10: { + message.zone = reader.string(); + break; + } + case 3: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.admissionPolicy = reader.string(); + break; + } + case 5: { + message.state = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.pendingUpdate = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnywhereCache message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.AnywhereCache} AnywhereCache + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnywhereCache.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnywhereCache message. + * @function verify + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnywhereCache.verify = function verify(message) { + if (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.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) + if (!$util.isString(message.admissionPolicy)) + return "admissionPolicy: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: 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.pendingUpdate != null && message.hasOwnProperty("pendingUpdate")) + if (typeof message.pendingUpdate !== "boolean") + return "pendingUpdate: boolean expected"; + return null; + }; + + /** + * Creates an AnywhereCache message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.AnywhereCache} AnywhereCache + */ + AnywhereCache.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.AnywhereCache) + return object; + var message = new $root.google.storage.control.v2.AnywhereCache(); + if (object.name != null) + message.name = String(object.name); + if (object.zone != null) + message.zone = String(object.zone); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.storage.control.v2.AnywhereCache.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.admissionPolicy != null) + message.admissionPolicy = String(object.admissionPolicy); + if (object.state != null) + message.state = String(object.state); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.control.v2.AnywhereCache.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.control.v2.AnywhereCache.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.pendingUpdate != null) + message.pendingUpdate = Boolean(object.pendingUpdate); + return message; + }; + + /** + * Creates a plain object from an AnywhereCache message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {google.storage.control.v2.AnywhereCache} message AnywhereCache + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnywhereCache.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ttl = null; + object.state = ""; + object.createTime = null; + object.updateTime = null; + object.pendingUpdate = false; + object.admissionPolicy = ""; + object.zone = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.state != null && message.hasOwnProperty("state")) + object.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.pendingUpdate != null && message.hasOwnProperty("pendingUpdate")) + object.pendingUpdate = message.pendingUpdate; + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) + object.admissionPolicy = message.admissionPolicy; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + return object; + }; + + /** + * Converts this AnywhereCache to JSON. + * @function toJSON + * @memberof google.storage.control.v2.AnywhereCache + * @instance + * @returns {Object.} JSON object + */ + AnywhereCache.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnywhereCache + * @function getTypeUrl + * @memberof google.storage.control.v2.AnywhereCache + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnywhereCache.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.AnywhereCache"; + }; + + return AnywhereCache; + })(); + + v2.CreateAnywhereCacheRequest = (function() { + + /** + * Properties of a CreateAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @interface ICreateAnywhereCacheRequest + * @property {string|null} [parent] CreateAnywhereCacheRequest parent + * @property {google.storage.control.v2.IAnywhereCache|null} [anywhereCache] CreateAnywhereCacheRequest anywhereCache + * @property {string|null} [requestId] CreateAnywhereCacheRequest requestId + */ + + /** + * Constructs a new CreateAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a CreateAnywhereCacheRequest. + * @implements ICreateAnywhereCacheRequest + * @constructor + * @param {google.storage.control.v2.ICreateAnywhereCacheRequest=} [properties] Properties to set + */ + function CreateAnywhereCacheRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnywhereCacheRequest parent. + * @member {string} parent + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @instance + */ + CreateAnywhereCacheRequest.prototype.parent = ""; + + /** + * CreateAnywhereCacheRequest anywhereCache. + * @member {google.storage.control.v2.IAnywhereCache|null|undefined} anywhereCache + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @instance + */ + CreateAnywhereCacheRequest.prototype.anywhereCache = null; + + /** + * CreateAnywhereCacheRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @instance + */ + CreateAnywhereCacheRequest.prototype.requestId = ""; + + /** + * Creates a new CreateAnywhereCacheRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.ICreateAnywhereCacheRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.CreateAnywhereCacheRequest} CreateAnywhereCacheRequest instance + */ + CreateAnywhereCacheRequest.create = function create(properties) { + return new CreateAnywhereCacheRequest(properties); + }; + + /** + * Encodes the specified CreateAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.ICreateAnywhereCacheRequest} message CreateAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnywhereCacheRequest.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.anywhereCache != null && Object.hasOwnProperty.call(message, "anywhereCache")) + $root.google.storage.control.v2.AnywhereCache.encode(message.anywhereCache, 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 CreateAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.CreateAnywhereCacheRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.ICreateAnywhereCacheRequest} message CreateAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnywhereCacheRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.CreateAnywhereCacheRequest} CreateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnywhereCacheRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.CreateAnywhereCacheRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.anywhereCache = $root.google.storage.control.v2.AnywhereCache.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.CreateAnywhereCacheRequest} CreateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnywhereCacheRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnywhereCacheRequest message. + * @function verify + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnywhereCacheRequest.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.anywhereCache != null && message.hasOwnProperty("anywhereCache")) { + var error = $root.google.storage.control.v2.AnywhereCache.verify(message.anywhereCache); + if (error) + return "anywhereCache." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.CreateAnywhereCacheRequest} CreateAnywhereCacheRequest + */ + CreateAnywhereCacheRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.CreateAnywhereCacheRequest) + return object; + var message = new $root.google.storage.control.v2.CreateAnywhereCacheRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.anywhereCache != null) { + if (typeof object.anywhereCache !== "object") + throw TypeError(".google.storage.control.v2.CreateAnywhereCacheRequest.anywhereCache: object expected"); + message.anywhereCache = $root.google.storage.control.v2.AnywhereCache.fromObject(object.anywhereCache); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateAnywhereCacheRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.CreateAnywhereCacheRequest} message CreateAnywhereCacheRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnywhereCacheRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.anywhereCache = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.anywhereCache != null && message.hasOwnProperty("anywhereCache")) + object.anywhereCache = $root.google.storage.control.v2.AnywhereCache.toObject(message.anywhereCache, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateAnywhereCacheRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAnywhereCacheRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnywhereCacheRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.CreateAnywhereCacheRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnywhereCacheRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.CreateAnywhereCacheRequest"; + }; + + return CreateAnywhereCacheRequest; + })(); + + v2.UpdateAnywhereCacheRequest = (function() { + + /** + * Properties of an UpdateAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @interface IUpdateAnywhereCacheRequest + * @property {google.storage.control.v2.IAnywhereCache|null} [anywhereCache] UpdateAnywhereCacheRequest anywhereCache + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAnywhereCacheRequest updateMask + * @property {string|null} [requestId] UpdateAnywhereCacheRequest requestId + */ + + /** + * Constructs a new UpdateAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents an UpdateAnywhereCacheRequest. + * @implements IUpdateAnywhereCacheRequest + * @constructor + * @param {google.storage.control.v2.IUpdateAnywhereCacheRequest=} [properties] Properties to set + */ + function UpdateAnywhereCacheRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAnywhereCacheRequest anywhereCache. + * @member {google.storage.control.v2.IAnywhereCache|null|undefined} anywhereCache + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @instance + */ + UpdateAnywhereCacheRequest.prototype.anywhereCache = null; + + /** + * UpdateAnywhereCacheRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @instance + */ + UpdateAnywhereCacheRequest.prototype.updateMask = null; + + /** + * UpdateAnywhereCacheRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @instance + */ + UpdateAnywhereCacheRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateAnywhereCacheRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IUpdateAnywhereCacheRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.UpdateAnywhereCacheRequest} UpdateAnywhereCacheRequest instance + */ + UpdateAnywhereCacheRequest.create = function create(properties) { + return new UpdateAnywhereCacheRequest(properties); + }; + + /** + * Encodes the specified UpdateAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IUpdateAnywhereCacheRequest} message UpdateAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnywhereCacheRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.anywhereCache != null && Object.hasOwnProperty.call(message, "anywhereCache")) + $root.google.storage.control.v2.AnywhereCache.encode(message.anywhereCache, 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 UpdateAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateAnywhereCacheRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IUpdateAnywhereCacheRequest} message UpdateAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAnywhereCacheRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.UpdateAnywhereCacheRequest} UpdateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnywhereCacheRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.UpdateAnywhereCacheRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.anywhereCache = $root.google.storage.control.v2.AnywhereCache.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 UpdateAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.UpdateAnywhereCacheRequest} UpdateAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnywhereCacheRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAnywhereCacheRequest message. + * @function verify + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAnywhereCacheRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.anywhereCache != null && message.hasOwnProperty("anywhereCache")) { + var error = $root.google.storage.control.v2.AnywhereCache.verify(message.anywhereCache); + if (error) + return "anywhereCache." + 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 UpdateAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.UpdateAnywhereCacheRequest} UpdateAnywhereCacheRequest + */ + UpdateAnywhereCacheRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.UpdateAnywhereCacheRequest) + return object; + var message = new $root.google.storage.control.v2.UpdateAnywhereCacheRequest(); + if (object.anywhereCache != null) { + if (typeof object.anywhereCache !== "object") + throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheRequest.anywhereCache: object expected"); + message.anywhereCache = $root.google.storage.control.v2.AnywhereCache.fromObject(object.anywhereCache); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheRequest.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 UpdateAnywhereCacheRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.UpdateAnywhereCacheRequest} message UpdateAnywhereCacheRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAnywhereCacheRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.anywhereCache = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.anywhereCache != null && message.hasOwnProperty("anywhereCache")) + object.anywhereCache = $root.google.storage.control.v2.AnywhereCache.toObject(message.anywhereCache, 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 UpdateAnywhereCacheRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAnywhereCacheRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAnywhereCacheRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.UpdateAnywhereCacheRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAnywhereCacheRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.UpdateAnywhereCacheRequest"; + }; + + return UpdateAnywhereCacheRequest; + })(); + + v2.DisableAnywhereCacheRequest = (function() { + + /** + * Properties of a DisableAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @interface IDisableAnywhereCacheRequest + * @property {string|null} [name] DisableAnywhereCacheRequest name + * @property {string|null} [requestId] DisableAnywhereCacheRequest requestId + */ + + /** + * Constructs a new DisableAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a DisableAnywhereCacheRequest. + * @implements IDisableAnywhereCacheRequest + * @constructor + * @param {google.storage.control.v2.IDisableAnywhereCacheRequest=} [properties] Properties to set + */ + function DisableAnywhereCacheRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableAnywhereCacheRequest name. + * @member {string} name + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @instance + */ + DisableAnywhereCacheRequest.prototype.name = ""; + + /** + * DisableAnywhereCacheRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @instance + */ + DisableAnywhereCacheRequest.prototype.requestId = ""; + + /** + * Creates a new DisableAnywhereCacheRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IDisableAnywhereCacheRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.DisableAnywhereCacheRequest} DisableAnywhereCacheRequest instance + */ + DisableAnywhereCacheRequest.create = function create(properties) { + return new DisableAnywhereCacheRequest(properties); + }; + + /** + * Encodes the specified DisableAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.DisableAnywhereCacheRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IDisableAnywhereCacheRequest} message DisableAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableAnywhereCacheRequest.encode = function encode(message, writer) { + 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 DisableAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.DisableAnywhereCacheRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IDisableAnywhereCacheRequest} message DisableAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableAnywhereCacheRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.DisableAnywhereCacheRequest} DisableAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableAnywhereCacheRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.DisableAnywhereCacheRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 DisableAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.DisableAnywhereCacheRequest} DisableAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableAnywhereCacheRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableAnywhereCacheRequest message. + * @function verify + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableAnywhereCacheRequest.verify = function verify(message) { + if (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 DisableAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.DisableAnywhereCacheRequest} DisableAnywhereCacheRequest + */ + DisableAnywhereCacheRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.DisableAnywhereCacheRequest) + return object; + var message = new $root.google.storage.control.v2.DisableAnywhereCacheRequest(); + 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 DisableAnywhereCacheRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.DisableAnywhereCacheRequest} message DisableAnywhereCacheRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableAnywhereCacheRequest.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 DisableAnywhereCacheRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @instance + * @returns {Object.} JSON object + */ + DisableAnywhereCacheRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableAnywhereCacheRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.DisableAnywhereCacheRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableAnywhereCacheRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.DisableAnywhereCacheRequest"; + }; + + return DisableAnywhereCacheRequest; + })(); + + v2.PauseAnywhereCacheRequest = (function() { + + /** + * Properties of a PauseAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @interface IPauseAnywhereCacheRequest + * @property {string|null} [name] PauseAnywhereCacheRequest name + * @property {string|null} [requestId] PauseAnywhereCacheRequest requestId + */ + + /** + * Constructs a new PauseAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a PauseAnywhereCacheRequest. + * @implements IPauseAnywhereCacheRequest + * @constructor + * @param {google.storage.control.v2.IPauseAnywhereCacheRequest=} [properties] Properties to set + */ + function PauseAnywhereCacheRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PauseAnywhereCacheRequest name. + * @member {string} name + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @instance + */ + PauseAnywhereCacheRequest.prototype.name = ""; + + /** + * PauseAnywhereCacheRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @instance + */ + PauseAnywhereCacheRequest.prototype.requestId = ""; + + /** + * Creates a new PauseAnywhereCacheRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IPauseAnywhereCacheRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.PauseAnywhereCacheRequest} PauseAnywhereCacheRequest instance + */ + PauseAnywhereCacheRequest.create = function create(properties) { + return new PauseAnywhereCacheRequest(properties); + }; + + /** + * Encodes the specified PauseAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.PauseAnywhereCacheRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IPauseAnywhereCacheRequest} message PauseAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseAnywhereCacheRequest.encode = function encode(message, writer) { + 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 PauseAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.PauseAnywhereCacheRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IPauseAnywhereCacheRequest} message PauseAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseAnywhereCacheRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.PauseAnywhereCacheRequest} PauseAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseAnywhereCacheRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.PauseAnywhereCacheRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 PauseAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.PauseAnywhereCacheRequest} PauseAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseAnywhereCacheRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseAnywhereCacheRequest message. + * @function verify + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseAnywhereCacheRequest.verify = function verify(message) { + if (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 PauseAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.PauseAnywhereCacheRequest} PauseAnywhereCacheRequest + */ + PauseAnywhereCacheRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.PauseAnywhereCacheRequest) + return object; + var message = new $root.google.storage.control.v2.PauseAnywhereCacheRequest(); + 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 PauseAnywhereCacheRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.PauseAnywhereCacheRequest} message PauseAnywhereCacheRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseAnywhereCacheRequest.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 PauseAnywhereCacheRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @instance + * @returns {Object.} JSON object + */ + PauseAnywhereCacheRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseAnywhereCacheRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.PauseAnywhereCacheRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseAnywhereCacheRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.PauseAnywhereCacheRequest"; + }; + + return PauseAnywhereCacheRequest; + })(); + + v2.ResumeAnywhereCacheRequest = (function() { + + /** + * Properties of a ResumeAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @interface IResumeAnywhereCacheRequest + * @property {string|null} [name] ResumeAnywhereCacheRequest name + * @property {string|null} [requestId] ResumeAnywhereCacheRequest requestId + */ + + /** + * Constructs a new ResumeAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a ResumeAnywhereCacheRequest. + * @implements IResumeAnywhereCacheRequest + * @constructor + * @param {google.storage.control.v2.IResumeAnywhereCacheRequest=} [properties] Properties to set + */ + function ResumeAnywhereCacheRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeAnywhereCacheRequest name. + * @member {string} name + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @instance + */ + ResumeAnywhereCacheRequest.prototype.name = ""; + + /** + * ResumeAnywhereCacheRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @instance + */ + ResumeAnywhereCacheRequest.prototype.requestId = ""; + + /** + * Creates a new ResumeAnywhereCacheRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IResumeAnywhereCacheRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.ResumeAnywhereCacheRequest} ResumeAnywhereCacheRequest instance + */ + ResumeAnywhereCacheRequest.create = function create(properties) { + return new ResumeAnywhereCacheRequest(properties); + }; + + /** + * Encodes the specified ResumeAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.ResumeAnywhereCacheRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IResumeAnywhereCacheRequest} message ResumeAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeAnywhereCacheRequest.encode = function encode(message, writer) { + 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 ResumeAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ResumeAnywhereCacheRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IResumeAnywhereCacheRequest} message ResumeAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeAnywhereCacheRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ResumeAnywhereCacheRequest} ResumeAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeAnywhereCacheRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ResumeAnywhereCacheRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 ResumeAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ResumeAnywhereCacheRequest} ResumeAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeAnywhereCacheRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeAnywhereCacheRequest message. + * @function verify + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeAnywhereCacheRequest.verify = function verify(message) { + if (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 ResumeAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ResumeAnywhereCacheRequest} ResumeAnywhereCacheRequest + */ + ResumeAnywhereCacheRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ResumeAnywhereCacheRequest) + return object; + var message = new $root.google.storage.control.v2.ResumeAnywhereCacheRequest(); + 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 ResumeAnywhereCacheRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.ResumeAnywhereCacheRequest} message ResumeAnywhereCacheRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeAnywhereCacheRequest.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 ResumeAnywhereCacheRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeAnywhereCacheRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeAnywhereCacheRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.ResumeAnywhereCacheRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeAnywhereCacheRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ResumeAnywhereCacheRequest"; + }; + + return ResumeAnywhereCacheRequest; + })(); + + v2.GetAnywhereCacheRequest = (function() { + + /** + * Properties of a GetAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @interface IGetAnywhereCacheRequest + * @property {string|null} [name] GetAnywhereCacheRequest name + * @property {string|null} [requestId] GetAnywhereCacheRequest requestId + */ + + /** + * Constructs a new GetAnywhereCacheRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetAnywhereCacheRequest. + * @implements IGetAnywhereCacheRequest + * @constructor + * @param {google.storage.control.v2.IGetAnywhereCacheRequest=} [properties] Properties to set + */ + function GetAnywhereCacheRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnywhereCacheRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @instance + */ + GetAnywhereCacheRequest.prototype.name = ""; + + /** + * GetAnywhereCacheRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @instance + */ + GetAnywhereCacheRequest.prototype.requestId = ""; + + /** + * Creates a new GetAnywhereCacheRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IGetAnywhereCacheRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetAnywhereCacheRequest} GetAnywhereCacheRequest instance + */ + GetAnywhereCacheRequest.create = function create(properties) { + return new GetAnywhereCacheRequest(properties); + }; + + /** + * Encodes the specified GetAnywhereCacheRequest message. Does not implicitly {@link google.storage.control.v2.GetAnywhereCacheRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IGetAnywhereCacheRequest} message GetAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnywhereCacheRequest.encode = function encode(message, writer) { + 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 GetAnywhereCacheRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetAnywhereCacheRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.IGetAnywhereCacheRequest} message GetAnywhereCacheRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnywhereCacheRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetAnywhereCacheRequest} GetAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnywhereCacheRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetAnywhereCacheRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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 GetAnywhereCacheRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetAnywhereCacheRequest} GetAnywhereCacheRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnywhereCacheRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnywhereCacheRequest message. + * @function verify + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnywhereCacheRequest.verify = function verify(message) { + if (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 GetAnywhereCacheRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetAnywhereCacheRequest} GetAnywhereCacheRequest + */ + GetAnywhereCacheRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetAnywhereCacheRequest) + return object; + var message = new $root.google.storage.control.v2.GetAnywhereCacheRequest(); + 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 GetAnywhereCacheRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {google.storage.control.v2.GetAnywhereCacheRequest} message GetAnywhereCacheRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnywhereCacheRequest.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 GetAnywhereCacheRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnywhereCacheRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnywhereCacheRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetAnywhereCacheRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnywhereCacheRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetAnywhereCacheRequest"; + }; + + return GetAnywhereCacheRequest; + })(); + + v2.ListAnywhereCachesRequest = (function() { + + /** + * Properties of a ListAnywhereCachesRequest. + * @memberof google.storage.control.v2 + * @interface IListAnywhereCachesRequest + * @property {string|null} [parent] ListAnywhereCachesRequest parent + * @property {number|null} [pageSize] ListAnywhereCachesRequest pageSize + * @property {string|null} [pageToken] ListAnywhereCachesRequest pageToken + * @property {string|null} [requestId] ListAnywhereCachesRequest requestId + */ + + /** + * Constructs a new ListAnywhereCachesRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a ListAnywhereCachesRequest. + * @implements IListAnywhereCachesRequest + * @constructor + * @param {google.storage.control.v2.IListAnywhereCachesRequest=} [properties] Properties to set + */ + function ListAnywhereCachesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnywhereCachesRequest parent. + * @member {string} parent + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @instance + */ + ListAnywhereCachesRequest.prototype.parent = ""; + + /** + * ListAnywhereCachesRequest pageSize. + * @member {number} pageSize + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @instance + */ + ListAnywhereCachesRequest.prototype.pageSize = 0; + + /** + * ListAnywhereCachesRequest pageToken. + * @member {string} pageToken + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @instance + */ + ListAnywhereCachesRequest.prototype.pageToken = ""; + + /** + * ListAnywhereCachesRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @instance + */ + ListAnywhereCachesRequest.prototype.requestId = ""; + + /** + * Creates a new ListAnywhereCachesRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {google.storage.control.v2.IListAnywhereCachesRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.ListAnywhereCachesRequest} ListAnywhereCachesRequest instance + */ + ListAnywhereCachesRequest.create = function create(properties) { + return new ListAnywhereCachesRequest(properties); + }; + + /** + * Encodes the specified ListAnywhereCachesRequest message. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {google.storage.control.v2.IListAnywhereCachesRequest} message ListAnywhereCachesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnywhereCachesRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ListAnywhereCachesRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {google.storage.control.v2.IListAnywhereCachesRequest} message ListAnywhereCachesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnywhereCachesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnywhereCachesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ListAnywhereCachesRequest} ListAnywhereCachesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnywhereCachesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ListAnywhereCachesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnywhereCachesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ListAnywhereCachesRequest} ListAnywhereCachesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnywhereCachesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnywhereCachesRequest message. + * @function verify + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnywhereCachesRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ListAnywhereCachesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ListAnywhereCachesRequest} ListAnywhereCachesRequest + */ + ListAnywhereCachesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ListAnywhereCachesRequest) + return object; + var message = new $root.google.storage.control.v2.ListAnywhereCachesRequest(); + 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.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ListAnywhereCachesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {google.storage.control.v2.ListAnywhereCachesRequest} message ListAnywhereCachesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnywhereCachesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + 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.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ListAnywhereCachesRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnywhereCachesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnywhereCachesRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.ListAnywhereCachesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnywhereCachesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ListAnywhereCachesRequest"; + }; + + return ListAnywhereCachesRequest; + })(); + + v2.ListAnywhereCachesResponse = (function() { + + /** + * Properties of a ListAnywhereCachesResponse. + * @memberof google.storage.control.v2 + * @interface IListAnywhereCachesResponse + * @property {Array.|null} [anywhereCaches] ListAnywhereCachesResponse anywhereCaches + * @property {string|null} [nextPageToken] ListAnywhereCachesResponse nextPageToken + */ + + /** + * Constructs a new ListAnywhereCachesResponse. + * @memberof google.storage.control.v2 + * @classdesc Represents a ListAnywhereCachesResponse. + * @implements IListAnywhereCachesResponse + * @constructor + * @param {google.storage.control.v2.IListAnywhereCachesResponse=} [properties] Properties to set + */ + function ListAnywhereCachesResponse(properties) { + this.anywhereCaches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnywhereCachesResponse anywhereCaches. + * @member {Array.} anywhereCaches + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @instance + */ + ListAnywhereCachesResponse.prototype.anywhereCaches = $util.emptyArray; + + /** + * ListAnywhereCachesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @instance + */ + ListAnywhereCachesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAnywhereCachesResponse instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {google.storage.control.v2.IListAnywhereCachesResponse=} [properties] Properties to set + * @returns {google.storage.control.v2.ListAnywhereCachesResponse} ListAnywhereCachesResponse instance + */ + ListAnywhereCachesResponse.create = function create(properties) { + return new ListAnywhereCachesResponse(properties); + }; + + /** + * Encodes the specified ListAnywhereCachesResponse message. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {google.storage.control.v2.IListAnywhereCachesResponse} message ListAnywhereCachesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnywhereCachesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.anywhereCaches != null && message.anywhereCaches.length) + for (var i = 0; i < message.anywhereCaches.length; ++i) + $root.google.storage.control.v2.AnywhereCache.encode(message.anywhereCaches[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 ListAnywhereCachesResponse message, length delimited. Does not implicitly {@link google.storage.control.v2.ListAnywhereCachesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {google.storage.control.v2.IListAnywhereCachesResponse} message ListAnywhereCachesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnywhereCachesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnywhereCachesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.ListAnywhereCachesResponse} ListAnywhereCachesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnywhereCachesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.ListAnywhereCachesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.anywhereCaches && message.anywhereCaches.length)) + message.anywhereCaches = []; + message.anywhereCaches.push($root.google.storage.control.v2.AnywhereCache.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnywhereCachesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.ListAnywhereCachesResponse} ListAnywhereCachesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnywhereCachesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnywhereCachesResponse message. + * @function verify + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnywhereCachesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.anywhereCaches != null && message.hasOwnProperty("anywhereCaches")) { + if (!Array.isArray(message.anywhereCaches)) + return "anywhereCaches: array expected"; + for (var i = 0; i < message.anywhereCaches.length; ++i) { + var error = $root.google.storage.control.v2.AnywhereCache.verify(message.anywhereCaches[i]); + if (error) + return "anywhereCaches." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnywhereCachesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.ListAnywhereCachesResponse} ListAnywhereCachesResponse + */ + ListAnywhereCachesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.ListAnywhereCachesResponse) + return object; + var message = new $root.google.storage.control.v2.ListAnywhereCachesResponse(); + if (object.anywhereCaches) { + if (!Array.isArray(object.anywhereCaches)) + throw TypeError(".google.storage.control.v2.ListAnywhereCachesResponse.anywhereCaches: array expected"); + message.anywhereCaches = []; + for (var i = 0; i < object.anywhereCaches.length; ++i) { + if (typeof object.anywhereCaches[i] !== "object") + throw TypeError(".google.storage.control.v2.ListAnywhereCachesResponse.anywhereCaches: object expected"); + message.anywhereCaches[i] = $root.google.storage.control.v2.AnywhereCache.fromObject(object.anywhereCaches[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnywhereCachesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {google.storage.control.v2.ListAnywhereCachesResponse} message ListAnywhereCachesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnywhereCachesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.anywhereCaches = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.anywhereCaches && message.anywhereCaches.length) { + object.anywhereCaches = []; + for (var j = 0; j < message.anywhereCaches.length; ++j) + object.anywhereCaches[j] = $root.google.storage.control.v2.AnywhereCache.toObject(message.anywhereCaches[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnywhereCachesResponse to JSON. + * @function toJSON + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnywhereCachesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnywhereCachesResponse + * @function getTypeUrl + * @memberof google.storage.control.v2.ListAnywhereCachesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnywhereCachesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.ListAnywhereCachesResponse"; + }; + + return ListAnywhereCachesResponse; + })(); + + v2.IntelligenceConfig = (function() { + + /** + * Properties of an IntelligenceConfig. + * @memberof google.storage.control.v2 + * @interface IIntelligenceConfig + * @property {string|null} [name] IntelligenceConfig name + * @property {google.storage.control.v2.IntelligenceConfig.EditionConfig|null} [editionConfig] IntelligenceConfig editionConfig + * @property {google.protobuf.ITimestamp|null} [updateTime] IntelligenceConfig updateTime + * @property {google.storage.control.v2.IntelligenceConfig.IFilter|null} [filter] IntelligenceConfig filter + * @property {google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig|null} [effectiveIntelligenceConfig] IntelligenceConfig effectiveIntelligenceConfig + * @property {google.storage.control.v2.IntelligenceConfig.ITrialConfig|null} [trialConfig] IntelligenceConfig trialConfig + */ + + /** + * Constructs a new IntelligenceConfig. + * @memberof google.storage.control.v2 + * @classdesc Represents an IntelligenceConfig. + * @implements IIntelligenceConfig + * @constructor + * @param {google.storage.control.v2.IIntelligenceConfig=} [properties] Properties to set + */ + function IntelligenceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntelligenceConfig name. + * @member {string} name + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + */ + IntelligenceConfig.prototype.name = ""; + + /** + * IntelligenceConfig editionConfig. + * @member {google.storage.control.v2.IntelligenceConfig.EditionConfig} editionConfig + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + */ + IntelligenceConfig.prototype.editionConfig = 0; + + /** + * IntelligenceConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + */ + IntelligenceConfig.prototype.updateTime = null; + + /** + * IntelligenceConfig filter. + * @member {google.storage.control.v2.IntelligenceConfig.IFilter|null|undefined} filter + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + */ + IntelligenceConfig.prototype.filter = null; + + /** + * IntelligenceConfig effectiveIntelligenceConfig. + * @member {google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig|null|undefined} effectiveIntelligenceConfig + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + */ + IntelligenceConfig.prototype.effectiveIntelligenceConfig = null; + + /** + * IntelligenceConfig trialConfig. + * @member {google.storage.control.v2.IntelligenceConfig.ITrialConfig|null|undefined} trialConfig + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + */ + IntelligenceConfig.prototype.trialConfig = null; + + /** + * Creates a new IntelligenceConfig instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {google.storage.control.v2.IIntelligenceConfig=} [properties] Properties to set + * @returns {google.storage.control.v2.IntelligenceConfig} IntelligenceConfig instance + */ + IntelligenceConfig.create = function create(properties) { + return new IntelligenceConfig(properties); + }; + + /** + * Encodes the specified IntelligenceConfig message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {google.storage.control.v2.IIntelligenceConfig} message IntelligenceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntelligenceConfig.encode = function encode(message, writer) { + 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.editionConfig != null && Object.hasOwnProperty.call(message, "editionConfig")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionConfig); + 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.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.storage.control.v2.IntelligenceConfig.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.effectiveIntelligenceConfig != null && Object.hasOwnProperty.call(message, "effectiveIntelligenceConfig")) + $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.encode(message.effectiveIntelligenceConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.trialConfig != null && Object.hasOwnProperty.call(message, "trialConfig")) + $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.encode(message.trialConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntelligenceConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {google.storage.control.v2.IIntelligenceConfig} message IntelligenceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntelligenceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntelligenceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.IntelligenceConfig} IntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntelligenceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.IntelligenceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.editionConfig = reader.int32(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filter = $root.google.storage.control.v2.IntelligenceConfig.Filter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.effectiveIntelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.trialConfig = $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntelligenceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.IntelligenceConfig} IntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntelligenceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntelligenceConfig message. + * @function verify + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntelligenceConfig.verify = function verify(message) { + if (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.editionConfig != null && message.hasOwnProperty("editionConfig")) + switch (message.editionConfig) { + default: + return "editionConfig: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.verify(message.filter); + if (error) + return "filter." + error; + } + if (message.effectiveIntelligenceConfig != null && message.hasOwnProperty("effectiveIntelligenceConfig")) { + var error = $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.verify(message.effectiveIntelligenceConfig); + if (error) + return "effectiveIntelligenceConfig." + error; + } + if (message.trialConfig != null && message.hasOwnProperty("trialConfig")) { + var error = $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.verify(message.trialConfig); + if (error) + return "trialConfig." + error; + } + return null; + }; + + /** + * Creates an IntelligenceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.IntelligenceConfig} IntelligenceConfig + */ + IntelligenceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.IntelligenceConfig) + return object; + var message = new $root.google.storage.control.v2.IntelligenceConfig(); + if (object.name != null) + message.name = String(object.name); + switch (object.editionConfig) { + default: + if (typeof object.editionConfig === "number") { + message.editionConfig = object.editionConfig; + break; + } + break; + case "EDITION_CONFIG_UNSPECIFIED": + case 0: + message.editionConfig = 0; + break; + case "INHERIT": + case 1: + message.editionConfig = 1; + break; + case "DISABLED": + case 2: + message.editionConfig = 2; + break; + case "STANDARD": + case 3: + message.editionConfig = 3; + break; + case "TRIAL": + case 5: + message.editionConfig = 5; + break; + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.filter: object expected"); + message.filter = $root.google.storage.control.v2.IntelligenceConfig.Filter.fromObject(object.filter); + } + if (object.effectiveIntelligenceConfig != null) { + if (typeof object.effectiveIntelligenceConfig !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.effectiveIntelligenceConfig: object expected"); + message.effectiveIntelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.fromObject(object.effectiveIntelligenceConfig); + } + if (object.trialConfig != null) { + if (typeof object.trialConfig !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.trialConfig: object expected"); + message.trialConfig = $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.fromObject(object.trialConfig); + } + return message; + }; + + /** + * Creates a plain object from an IntelligenceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig} message IntelligenceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntelligenceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.editionConfig = options.enums === String ? "EDITION_CONFIG_UNSPECIFIED" : 0; + object.updateTime = null; + object.filter = null; + object.effectiveIntelligenceConfig = null; + object.trialConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.editionConfig != null && message.hasOwnProperty("editionConfig")) + object.editionConfig = options.enums === String ? $root.google.storage.control.v2.IntelligenceConfig.EditionConfig[message.editionConfig] === undefined ? message.editionConfig : $root.google.storage.control.v2.IntelligenceConfig.EditionConfig[message.editionConfig] : message.editionConfig; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.storage.control.v2.IntelligenceConfig.Filter.toObject(message.filter, options); + if (message.effectiveIntelligenceConfig != null && message.hasOwnProperty("effectiveIntelligenceConfig")) + object.effectiveIntelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.toObject(message.effectiveIntelligenceConfig, options); + if (message.trialConfig != null && message.hasOwnProperty("trialConfig")) + object.trialConfig = $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.toObject(message.trialConfig, options); + return object; + }; + + /** + * Converts this IntelligenceConfig to JSON. + * @function toJSON + * @memberof google.storage.control.v2.IntelligenceConfig + * @instance + * @returns {Object.} JSON object + */ + IntelligenceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntelligenceConfig + * @function getTypeUrl + * @memberof google.storage.control.v2.IntelligenceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntelligenceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.IntelligenceConfig"; + }; + + /** + * EditionConfig enum. + * @name google.storage.control.v2.IntelligenceConfig.EditionConfig + * @enum {number} + * @property {number} EDITION_CONFIG_UNSPECIFIED=0 EDITION_CONFIG_UNSPECIFIED value + * @property {number} INHERIT=1 INHERIT value + * @property {number} DISABLED=2 DISABLED value + * @property {number} STANDARD=3 STANDARD value + * @property {number} TRIAL=5 TRIAL value + */ + IntelligenceConfig.EditionConfig = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_CONFIG_UNSPECIFIED"] = 0; + values[valuesById[1] = "INHERIT"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "STANDARD"] = 3; + values[valuesById[5] = "TRIAL"] = 5; + return values; + })(); + + IntelligenceConfig.Filter = (function() { + + /** + * Properties of a Filter. + * @memberof google.storage.control.v2.IntelligenceConfig + * @interface IFilter + * @property {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null} [includedCloudStorageLocations] Filter includedCloudStorageLocations + * @property {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null} [excludedCloudStorageLocations] Filter excludedCloudStorageLocations + * @property {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null} [includedCloudStorageBuckets] Filter includedCloudStorageBuckets + * @property {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null} [excludedCloudStorageBuckets] Filter excludedCloudStorageBuckets + */ + + /** + * Constructs a new Filter. + * @memberof google.storage.control.v2.IntelligenceConfig + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.storage.control.v2.IntelligenceConfig.IFilter=} [properties] Properties to set + */ + function Filter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Filter includedCloudStorageLocations. + * @member {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null|undefined} includedCloudStorageLocations + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + */ + Filter.prototype.includedCloudStorageLocations = null; + + /** + * Filter excludedCloudStorageLocations. + * @member {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations|null|undefined} excludedCloudStorageLocations + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + */ + Filter.prototype.excludedCloudStorageLocations = null; + + /** + * Filter includedCloudStorageBuckets. + * @member {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null|undefined} includedCloudStorageBuckets + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + */ + Filter.prototype.includedCloudStorageBuckets = null; + + /** + * Filter excludedCloudStorageBuckets. + * @member {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets|null|undefined} excludedCloudStorageBuckets + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + */ + Filter.prototype.excludedCloudStorageBuckets = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Filter cloudStorageLocations. + * @member {"includedCloudStorageLocations"|"excludedCloudStorageLocations"|undefined} cloudStorageLocations + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + */ + Object.defineProperty(Filter.prototype, "cloudStorageLocations", { + get: $util.oneOfGetter($oneOfFields = ["includedCloudStorageLocations", "excludedCloudStorageLocations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Filter cloudStorageBuckets. + * @member {"includedCloudStorageBuckets"|"excludedCloudStorageBuckets"|undefined} cloudStorageBuckets + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + */ + Object.defineProperty(Filter.prototype, "cloudStorageBuckets", { + get: $util.oneOfGetter($oneOfFields = ["includedCloudStorageBuckets", "excludedCloudStorageBuckets"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {google.storage.control.v2.IntelligenceConfig.IFilter=} [properties] Properties to set + * @returns {google.storage.control.v2.IntelligenceConfig.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {google.storage.control.v2.IntelligenceConfig.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includedCloudStorageLocations != null && Object.hasOwnProperty.call(message, "includedCloudStorageLocations")) + $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.encode(message.includedCloudStorageLocations, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.excludedCloudStorageLocations != null && Object.hasOwnProperty.call(message, "excludedCloudStorageLocations")) + $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.encode(message.excludedCloudStorageLocations, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.includedCloudStorageBuckets != null && Object.hasOwnProperty.call(message, "includedCloudStorageBuckets")) + $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.encode(message.includedCloudStorageBuckets, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.excludedCloudStorageBuckets != null && Object.hasOwnProperty.call(message, "excludedCloudStorageBuckets")) + $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.encode(message.excludedCloudStorageBuckets, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {google.storage.control.v2.IntelligenceConfig.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.IntelligenceConfig.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.IntelligenceConfig.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.includedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.decode(reader, reader.uint32()); + break; + } + case 2: { + message.excludedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.decode(reader, reader.uint32()); + break; + } + case 3: { + message.includedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.decode(reader, reader.uint32()); + break; + } + case 4: { + message.excludedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.IntelligenceConfig.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.includedCloudStorageLocations != null && message.hasOwnProperty("includedCloudStorageLocations")) { + properties.cloudStorageLocations = 1; + { + var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify(message.includedCloudStorageLocations); + if (error) + return "includedCloudStorageLocations." + error; + } + } + if (message.excludedCloudStorageLocations != null && message.hasOwnProperty("excludedCloudStorageLocations")) { + if (properties.cloudStorageLocations === 1) + return "cloudStorageLocations: multiple values"; + properties.cloudStorageLocations = 1; + { + var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify(message.excludedCloudStorageLocations); + if (error) + return "excludedCloudStorageLocations." + error; + } + } + if (message.includedCloudStorageBuckets != null && message.hasOwnProperty("includedCloudStorageBuckets")) { + properties.cloudStorageBuckets = 1; + { + var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify(message.includedCloudStorageBuckets); + if (error) + return "includedCloudStorageBuckets." + error; + } + } + if (message.excludedCloudStorageBuckets != null && message.hasOwnProperty("excludedCloudStorageBuckets")) { + if (properties.cloudStorageBuckets === 1) + return "cloudStorageBuckets: multiple values"; + properties.cloudStorageBuckets = 1; + { + var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify(message.excludedCloudStorageBuckets); + if (error) + return "excludedCloudStorageBuckets." + error; + } + } + return null; + }; + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.IntelligenceConfig.Filter} Filter + */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.Filter) + return object; + var message = new $root.google.storage.control.v2.IntelligenceConfig.Filter(); + if (object.includedCloudStorageLocations != null) { + if (typeof object.includedCloudStorageLocations !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.includedCloudStorageLocations: object expected"); + message.includedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.fromObject(object.includedCloudStorageLocations); + } + if (object.excludedCloudStorageLocations != null) { + if (typeof object.excludedCloudStorageLocations !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.excludedCloudStorageLocations: object expected"); + message.excludedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.fromObject(object.excludedCloudStorageLocations); + } + if (object.includedCloudStorageBuckets != null) { + if (typeof object.includedCloudStorageBuckets !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.includedCloudStorageBuckets: object expected"); + message.includedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.fromObject(object.includedCloudStorageBuckets); + } + if (object.excludedCloudStorageBuckets != null) { + if (typeof object.excludedCloudStorageBuckets !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.excludedCloudStorageBuckets: object expected"); + message.excludedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.fromObject(object.excludedCloudStorageBuckets); + } + return message; + }; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Filter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.includedCloudStorageLocations != null && message.hasOwnProperty("includedCloudStorageLocations")) { + object.includedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.toObject(message.includedCloudStorageLocations, options); + if (options.oneofs) + object.cloudStorageLocations = "includedCloudStorageLocations"; + } + if (message.excludedCloudStorageLocations != null && message.hasOwnProperty("excludedCloudStorageLocations")) { + object.excludedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.toObject(message.excludedCloudStorageLocations, options); + if (options.oneofs) + object.cloudStorageLocations = "excludedCloudStorageLocations"; + } + if (message.includedCloudStorageBuckets != null && message.hasOwnProperty("includedCloudStorageBuckets")) { + object.includedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.toObject(message.includedCloudStorageBuckets, options); + if (options.oneofs) + object.cloudStorageBuckets = "includedCloudStorageBuckets"; + } + if (message.excludedCloudStorageBuckets != null && message.hasOwnProperty("excludedCloudStorageBuckets")) { + object.excludedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.toObject(message.excludedCloudStorageBuckets, options); + if (options.oneofs) + object.cloudStorageBuckets = "excludedCloudStorageBuckets"; + } + return object; + }; + + /** + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @instance + * @returns {Object.} JSON object + */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Filter + * @function getTypeUrl + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.IntelligenceConfig.Filter"; + }; + + Filter.CloudStorageLocations = (function() { + + /** + * Properties of a CloudStorageLocations. + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @interface ICloudStorageLocations + * @property {Array.|null} [locations] CloudStorageLocations locations + */ + + /** + * Constructs a new CloudStorageLocations. + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @classdesc Represents a CloudStorageLocations. + * @implements ICloudStorageLocations + * @constructor + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations=} [properties] Properties to set + */ + function CloudStorageLocations(properties) { + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageLocations locations. + * @member {Array.} locations + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @instance + */ + CloudStorageLocations.prototype.locations = $util.emptyArray; + + /** + * Creates a new CloudStorageLocations instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations=} [properties] Properties to set + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations} CloudStorageLocations instance + */ + CloudStorageLocations.create = function create(properties) { + return new CloudStorageLocations(properties); + }; + + /** + * Encodes the specified CloudStorageLocations message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations} message CloudStorageLocations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageLocations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locations[i]); + return writer; + }; + + /** + * Encodes the specified CloudStorageLocations message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageLocations} message CloudStorageLocations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageLocations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageLocations message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations} CloudStorageLocations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageLocations.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageLocations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations} CloudStorageLocations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageLocations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageLocations message. + * @function verify + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageLocations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) + if (!$util.isString(message.locations[i])) + return "locations: string[] expected"; + } + return null; + }; + + /** + * Creates a CloudStorageLocations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations} CloudStorageLocations + */ + CloudStorageLocations.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations) + return object; + var message = new $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations(); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) + message.locations[i] = String(object.locations[i]); + } + return message; + }; + + /** + * Creates a plain object from a CloudStorageLocations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations} message CloudStorageLocations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageLocations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.locations = []; + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = message.locations[j]; + } + return object; + }; + + /** + * Converts this CloudStorageLocations to JSON. + * @function toJSON + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @instance + * @returns {Object.} JSON object + */ + CloudStorageLocations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageLocations + * @function getTypeUrl + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageLocations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"; + }; + + return CloudStorageLocations; + })(); + + Filter.CloudStorageBuckets = (function() { + + /** + * Properties of a CloudStorageBuckets. + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @interface ICloudStorageBuckets + * @property {Array.|null} [bucketIdRegexes] CloudStorageBuckets bucketIdRegexes + */ + + /** + * Constructs a new CloudStorageBuckets. + * @memberof google.storage.control.v2.IntelligenceConfig.Filter + * @classdesc Represents a CloudStorageBuckets. + * @implements ICloudStorageBuckets + * @constructor + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets=} [properties] Properties to set + */ + function CloudStorageBuckets(properties) { + this.bucketIdRegexes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageBuckets bucketIdRegexes. + * @member {Array.} bucketIdRegexes + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @instance + */ + CloudStorageBuckets.prototype.bucketIdRegexes = $util.emptyArray; + + /** + * Creates a new CloudStorageBuckets instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets=} [properties] Properties to set + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets} CloudStorageBuckets instance + */ + CloudStorageBuckets.create = function create(properties) { + return new CloudStorageBuckets(properties); + }; + + /** + * Encodes the specified CloudStorageBuckets message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets} message CloudStorageBuckets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageBuckets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketIdRegexes != null && message.bucketIdRegexes.length) + for (var i = 0; i < message.bucketIdRegexes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketIdRegexes[i]); + return writer; + }; + + /** + * Encodes the specified CloudStorageBuckets message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.ICloudStorageBuckets} message CloudStorageBuckets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageBuckets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageBuckets message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets} CloudStorageBuckets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageBuckets.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bucketIdRegexes && message.bucketIdRegexes.length)) + message.bucketIdRegexes = []; + message.bucketIdRegexes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageBuckets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets} CloudStorageBuckets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageBuckets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageBuckets message. + * @function verify + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageBuckets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucketIdRegexes != null && message.hasOwnProperty("bucketIdRegexes")) { + if (!Array.isArray(message.bucketIdRegexes)) + return "bucketIdRegexes: array expected"; + for (var i = 0; i < message.bucketIdRegexes.length; ++i) + if (!$util.isString(message.bucketIdRegexes[i])) + return "bucketIdRegexes: string[] expected"; + } + return null; + }; + + /** + * Creates a CloudStorageBuckets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets} CloudStorageBuckets + */ + CloudStorageBuckets.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets) + return object; + var message = new $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets(); + if (object.bucketIdRegexes) { + if (!Array.isArray(object.bucketIdRegexes)) + throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.bucketIdRegexes: array expected"); + message.bucketIdRegexes = []; + for (var i = 0; i < object.bucketIdRegexes.length; ++i) + message.bucketIdRegexes[i] = String(object.bucketIdRegexes[i]); + } + return message; + }; + + /** + * Creates a plain object from a CloudStorageBuckets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets} message CloudStorageBuckets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageBuckets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bucketIdRegexes = []; + if (message.bucketIdRegexes && message.bucketIdRegexes.length) { + object.bucketIdRegexes = []; + for (var j = 0; j < message.bucketIdRegexes.length; ++j) + object.bucketIdRegexes[j] = message.bucketIdRegexes[j]; + } + return object; + }; + + /** + * Converts this CloudStorageBuckets to JSON. + * @function toJSON + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @instance + * @returns {Object.} JSON object + */ + CloudStorageBuckets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageBuckets + * @function getTypeUrl + * @memberof google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageBuckets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"; + }; + + return CloudStorageBuckets; + })(); + + return Filter; + })(); + + IntelligenceConfig.EffectiveIntelligenceConfig = (function() { + + /** + * Properties of an EffectiveIntelligenceConfig. + * @memberof google.storage.control.v2.IntelligenceConfig + * @interface IEffectiveIntelligenceConfig + * @property {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition|null} [effectiveEdition] EffectiveIntelligenceConfig effectiveEdition + * @property {string|null} [intelligenceConfig] EffectiveIntelligenceConfig intelligenceConfig + */ + + /** + * Constructs a new EffectiveIntelligenceConfig. + * @memberof google.storage.control.v2.IntelligenceConfig + * @classdesc Represents an EffectiveIntelligenceConfig. + * @implements IEffectiveIntelligenceConfig + * @constructor + * @param {google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig=} [properties] Properties to set + */ + function EffectiveIntelligenceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EffectiveIntelligenceConfig effectiveEdition. + * @member {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition} effectiveEdition + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @instance + */ + EffectiveIntelligenceConfig.prototype.effectiveEdition = 0; + + /** + * EffectiveIntelligenceConfig intelligenceConfig. + * @member {string} intelligenceConfig + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @instance + */ + EffectiveIntelligenceConfig.prototype.intelligenceConfig = ""; + + /** + * Creates a new EffectiveIntelligenceConfig instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig=} [properties] Properties to set + * @returns {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig} EffectiveIntelligenceConfig instance + */ + EffectiveIntelligenceConfig.create = function create(properties) { + return new EffectiveIntelligenceConfig(properties); + }; + + /** + * Encodes the specified EffectiveIntelligenceConfig message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig} message EffectiveIntelligenceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIntelligenceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveEdition != null && Object.hasOwnProperty.call(message, "effectiveEdition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.effectiveEdition); + if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intelligenceConfig); + return writer; + }; + + /** + * Encodes the specified EffectiveIntelligenceConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.IEffectiveIntelligenceConfig} message EffectiveIntelligenceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIntelligenceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveIntelligenceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig} EffectiveIntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIntelligenceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.effectiveEdition = reader.int32(); + break; + } + case 2: { + message.intelligenceConfig = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveIntelligenceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig} EffectiveIntelligenceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIntelligenceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveIntelligenceConfig message. + * @function verify + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveIntelligenceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.effectiveEdition != null && message.hasOwnProperty("effectiveEdition")) + switch (message.effectiveEdition) { + default: + return "effectiveEdition: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) + if (!$util.isString(message.intelligenceConfig)) + return "intelligenceConfig: string expected"; + return null; + }; + + /** + * Creates an EffectiveIntelligenceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig} EffectiveIntelligenceConfig + */ + EffectiveIntelligenceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig) + return object; + var message = new $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig(); + switch (object.effectiveEdition) { + default: + if (typeof object.effectiveEdition === "number") { + message.effectiveEdition = object.effectiveEdition; + break; + } + break; + case "EFFECTIVE_EDITION_UNSPECIFIED": + case 0: + message.effectiveEdition = 0; + break; + case "NONE": + case 1: + message.effectiveEdition = 1; + break; + case "STANDARD": + case 2: + message.effectiveEdition = 2; + break; + } + if (object.intelligenceConfig != null) + message.intelligenceConfig = String(object.intelligenceConfig); + return message; + }; + + /** + * Creates a plain object from an EffectiveIntelligenceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig} message EffectiveIntelligenceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveIntelligenceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.effectiveEdition = options.enums === String ? "EFFECTIVE_EDITION_UNSPECIFIED" : 0; + object.intelligenceConfig = ""; + } + if (message.effectiveEdition != null && message.hasOwnProperty("effectiveEdition")) + object.effectiveEdition = options.enums === String ? $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition[message.effectiveEdition] === undefined ? message.effectiveEdition : $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition[message.effectiveEdition] : message.effectiveEdition; + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) + object.intelligenceConfig = message.intelligenceConfig; + return object; + }; + + /** + * Converts this EffectiveIntelligenceConfig to JSON. + * @function toJSON + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @instance + * @returns {Object.} JSON object + */ + EffectiveIntelligenceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EffectiveIntelligenceConfig + * @function getTypeUrl + * @memberof google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EffectiveIntelligenceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"; + }; + + /** + * EffectiveEdition enum. + * @name google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition + * @enum {number} + * @property {number} EFFECTIVE_EDITION_UNSPECIFIED=0 EFFECTIVE_EDITION_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} STANDARD=2 STANDARD value + */ + EffectiveIntelligenceConfig.EffectiveEdition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EFFECTIVE_EDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "STANDARD"] = 2; + return values; + })(); + + return EffectiveIntelligenceConfig; + })(); + + IntelligenceConfig.TrialConfig = (function() { + + /** + * Properties of a TrialConfig. + * @memberof google.storage.control.v2.IntelligenceConfig + * @interface ITrialConfig + * @property {google.protobuf.ITimestamp|null} [expireTime] TrialConfig expireTime + */ + + /** + * Constructs a new TrialConfig. + * @memberof google.storage.control.v2.IntelligenceConfig + * @classdesc Represents a TrialConfig. + * @implements ITrialConfig + * @constructor + * @param {google.storage.control.v2.IntelligenceConfig.ITrialConfig=} [properties] Properties to set + */ + function TrialConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialConfig expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @instance + */ + TrialConfig.prototype.expireTime = null; + + /** + * Creates a new TrialConfig instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.ITrialConfig=} [properties] Properties to set + * @returns {google.storage.control.v2.IntelligenceConfig.TrialConfig} TrialConfig instance + */ + TrialConfig.create = function create(properties) { + return new TrialConfig(properties); + }; + + /** + * Encodes the specified TrialConfig message. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.TrialConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.ITrialConfig} message TrialConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrialConfig message, length delimited. Does not implicitly {@link google.storage.control.v2.IntelligenceConfig.TrialConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.ITrialConfig} message TrialConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.IntelligenceConfig.TrialConfig} TrialConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.IntelligenceConfig.TrialConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.IntelligenceConfig.TrialConfig} TrialConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialConfig message. + * @function verify + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a TrialConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.IntelligenceConfig.TrialConfig} TrialConfig + */ + TrialConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.TrialConfig) + return object; + var message = new $root.google.storage.control.v2.IntelligenceConfig.TrialConfig(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.storage.control.v2.IntelligenceConfig.TrialConfig.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a TrialConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {google.storage.control.v2.IntelligenceConfig.TrialConfig} message TrialConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expireTime = null; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this TrialConfig to JSON. + * @function toJSON + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @instance + * @returns {Object.} JSON object + */ + TrialConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialConfig + * @function getTypeUrl + * @memberof google.storage.control.v2.IntelligenceConfig.TrialConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.IntelligenceConfig.TrialConfig"; + }; + + return TrialConfig; + })(); + + return IntelligenceConfig; + })(); + + v2.UpdateOrganizationIntelligenceConfigRequest = (function() { + + /** + * Properties of an UpdateOrganizationIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @interface IUpdateOrganizationIntelligenceConfigRequest + * @property {google.storage.control.v2.IIntelligenceConfig|null} [intelligenceConfig] UpdateOrganizationIntelligenceConfigRequest intelligenceConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateOrganizationIntelligenceConfigRequest updateMask + * @property {string|null} [requestId] UpdateOrganizationIntelligenceConfigRequest requestId + */ + + /** + * Constructs a new UpdateOrganizationIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents an UpdateOrganizationIntelligenceConfigRequest. + * @implements IUpdateOrganizationIntelligenceConfigRequest + * @constructor + * @param {google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest=} [properties] Properties to set + */ + function UpdateOrganizationIntelligenceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOrganizationIntelligenceConfigRequest intelligenceConfig. + * @member {google.storage.control.v2.IIntelligenceConfig|null|undefined} intelligenceConfig + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @instance + */ + UpdateOrganizationIntelligenceConfigRequest.prototype.intelligenceConfig = null; + + /** + * UpdateOrganizationIntelligenceConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @instance + */ + UpdateOrganizationIntelligenceConfigRequest.prototype.updateMask = null; + + /** + * UpdateOrganizationIntelligenceConfigRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @instance + */ + UpdateOrganizationIntelligenceConfigRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateOrganizationIntelligenceConfigRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest} UpdateOrganizationIntelligenceConfigRequest instance + */ + UpdateOrganizationIntelligenceConfigRequest.create = function create(properties) { + return new UpdateOrganizationIntelligenceConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateOrganizationIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest} message UpdateOrganizationIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationIntelligenceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) + $root.google.storage.control.v2.IntelligenceConfig.encode(message.intelligenceConfig, 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 UpdateOrganizationIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest} message UpdateOrganizationIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrganizationIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateOrganizationIntelligenceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest} UpdateOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationIntelligenceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.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 UpdateOrganizationIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest} UpdateOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrganizationIntelligenceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrganizationIntelligenceConfigRequest message. + * @function verify + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrganizationIntelligenceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) { + var error = $root.google.storage.control.v2.IntelligenceConfig.verify(message.intelligenceConfig); + if (error) + return "intelligenceConfig." + 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 UpdateOrganizationIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest} UpdateOrganizationIntelligenceConfigRequest + */ + UpdateOrganizationIntelligenceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest) + return object; + var message = new $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest(); + if (object.intelligenceConfig != null) { + if (typeof object.intelligenceConfig !== "object") + throw TypeError(".google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.intelligenceConfig: object expected"); + message.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.fromObject(object.intelligenceConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.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 UpdateOrganizationIntelligenceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest} message UpdateOrganizationIntelligenceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrganizationIntelligenceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intelligenceConfig = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) + object.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.toObject(message.intelligenceConfig, 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 UpdateOrganizationIntelligenceConfigRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrganizationIntelligenceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOrganizationIntelligenceConfigRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrganizationIntelligenceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"; + }; + + return UpdateOrganizationIntelligenceConfigRequest; + })(); + + v2.UpdateFolderIntelligenceConfigRequest = (function() { + + /** + * Properties of an UpdateFolderIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @interface IUpdateFolderIntelligenceConfigRequest + * @property {google.storage.control.v2.IIntelligenceConfig|null} [intelligenceConfig] UpdateFolderIntelligenceConfigRequest intelligenceConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFolderIntelligenceConfigRequest updateMask + * @property {string|null} [requestId] UpdateFolderIntelligenceConfigRequest requestId + */ + + /** + * Constructs a new UpdateFolderIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents an UpdateFolderIntelligenceConfigRequest. + * @implements IUpdateFolderIntelligenceConfigRequest + * @constructor + * @param {google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest=} [properties] Properties to set + */ + function UpdateFolderIntelligenceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFolderIntelligenceConfigRequest intelligenceConfig. + * @member {google.storage.control.v2.IIntelligenceConfig|null|undefined} intelligenceConfig + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @instance + */ + UpdateFolderIntelligenceConfigRequest.prototype.intelligenceConfig = null; + + /** + * UpdateFolderIntelligenceConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @instance + */ + UpdateFolderIntelligenceConfigRequest.prototype.updateMask = null; + + /** + * UpdateFolderIntelligenceConfigRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @instance + */ + UpdateFolderIntelligenceConfigRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateFolderIntelligenceConfigRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.UpdateFolderIntelligenceConfigRequest} UpdateFolderIntelligenceConfigRequest instance + */ + UpdateFolderIntelligenceConfigRequest.create = function create(properties) { + return new UpdateFolderIntelligenceConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateFolderIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest} message UpdateFolderIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFolderIntelligenceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) + $root.google.storage.control.v2.IntelligenceConfig.encode(message.intelligenceConfig, 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 UpdateFolderIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest} message UpdateFolderIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFolderIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFolderIntelligenceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.UpdateFolderIntelligenceConfigRequest} UpdateFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFolderIntelligenceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.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 UpdateFolderIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.UpdateFolderIntelligenceConfigRequest} UpdateFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFolderIntelligenceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFolderIntelligenceConfigRequest message. + * @function verify + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFolderIntelligenceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) { + var error = $root.google.storage.control.v2.IntelligenceConfig.verify(message.intelligenceConfig); + if (error) + return "intelligenceConfig." + 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 UpdateFolderIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.UpdateFolderIntelligenceConfigRequest} UpdateFolderIntelligenceConfigRequest + */ + UpdateFolderIntelligenceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest) + return object; + var message = new $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest(); + if (object.intelligenceConfig != null) { + if (typeof object.intelligenceConfig !== "object") + throw TypeError(".google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.intelligenceConfig: object expected"); + message.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.fromObject(object.intelligenceConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.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 UpdateFolderIntelligenceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.UpdateFolderIntelligenceConfigRequest} message UpdateFolderIntelligenceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFolderIntelligenceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intelligenceConfig = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) + object.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.toObject(message.intelligenceConfig, 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 UpdateFolderIntelligenceConfigRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFolderIntelligenceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFolderIntelligenceConfigRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.UpdateFolderIntelligenceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFolderIntelligenceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"; + }; + + return UpdateFolderIntelligenceConfigRequest; + })(); + + v2.UpdateProjectIntelligenceConfigRequest = (function() { + + /** + * Properties of an UpdateProjectIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @interface IUpdateProjectIntelligenceConfigRequest + * @property {google.storage.control.v2.IIntelligenceConfig|null} [intelligenceConfig] UpdateProjectIntelligenceConfigRequest intelligenceConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProjectIntelligenceConfigRequest updateMask + * @property {string|null} [requestId] UpdateProjectIntelligenceConfigRequest requestId + */ + + /** + * Constructs a new UpdateProjectIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents an UpdateProjectIntelligenceConfigRequest. + * @implements IUpdateProjectIntelligenceConfigRequest + * @constructor + * @param {google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest=} [properties] Properties to set + */ + function UpdateProjectIntelligenceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateProjectIntelligenceConfigRequest intelligenceConfig. + * @member {google.storage.control.v2.IIntelligenceConfig|null|undefined} intelligenceConfig + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @instance + */ + UpdateProjectIntelligenceConfigRequest.prototype.intelligenceConfig = null; + + /** + * UpdateProjectIntelligenceConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @instance + */ + UpdateProjectIntelligenceConfigRequest.prototype.updateMask = null; + + /** + * UpdateProjectIntelligenceConfigRequest requestId. + * @member {string} requestId + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @instance + */ + UpdateProjectIntelligenceConfigRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateProjectIntelligenceConfigRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.UpdateProjectIntelligenceConfigRequest} UpdateProjectIntelligenceConfigRequest instance + */ + UpdateProjectIntelligenceConfigRequest.create = function create(properties) { + return new UpdateProjectIntelligenceConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateProjectIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest} message UpdateProjectIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProjectIntelligenceConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) + $root.google.storage.control.v2.IntelligenceConfig.encode(message.intelligenceConfig, 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 UpdateProjectIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest} message UpdateProjectIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProjectIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProjectIntelligenceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.UpdateProjectIntelligenceConfigRequest} UpdateProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProjectIntelligenceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.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 UpdateProjectIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.UpdateProjectIntelligenceConfigRequest} UpdateProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProjectIntelligenceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProjectIntelligenceConfigRequest message. + * @function verify + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProjectIntelligenceConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) { + var error = $root.google.storage.control.v2.IntelligenceConfig.verify(message.intelligenceConfig); + if (error) + return "intelligenceConfig." + 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 UpdateProjectIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.UpdateProjectIntelligenceConfigRequest} UpdateProjectIntelligenceConfigRequest + */ + UpdateProjectIntelligenceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest) + return object; + var message = new $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest(); + if (object.intelligenceConfig != null) { + if (typeof object.intelligenceConfig !== "object") + throw TypeError(".google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.intelligenceConfig: object expected"); + message.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.fromObject(object.intelligenceConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.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 UpdateProjectIntelligenceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.UpdateProjectIntelligenceConfigRequest} message UpdateProjectIntelligenceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProjectIntelligenceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intelligenceConfig = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) + object.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.toObject(message.intelligenceConfig, 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 UpdateProjectIntelligenceConfigRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProjectIntelligenceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProjectIntelligenceConfigRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.UpdateProjectIntelligenceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProjectIntelligenceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"; + }; + + return UpdateProjectIntelligenceConfigRequest; + })(); + + v2.GetOrganizationIntelligenceConfigRequest = (function() { + + /** + * Properties of a GetOrganizationIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @interface IGetOrganizationIntelligenceConfigRequest + * @property {string|null} [name] GetOrganizationIntelligenceConfigRequest name + */ + + /** + * Constructs a new GetOrganizationIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetOrganizationIntelligenceConfigRequest. + * @implements IGetOrganizationIntelligenceConfigRequest + * @constructor + * @param {google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest=} [properties] Properties to set + */ + function GetOrganizationIntelligenceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOrganizationIntelligenceConfigRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @instance + */ + GetOrganizationIntelligenceConfigRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationIntelligenceConfigRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetOrganizationIntelligenceConfigRequest} GetOrganizationIntelligenceConfigRequest instance + */ + GetOrganizationIntelligenceConfigRequest.create = function create(properties) { + return new GetOrganizationIntelligenceConfigRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.GetOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest} message GetOrganizationIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationIntelligenceConfigRequest.encode = function encode(message, writer) { + 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 GetOrganizationIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetOrganizationIntelligenceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest} message GetOrganizationIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationIntelligenceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetOrganizationIntelligenceConfigRequest} GetOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationIntelligenceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOrganizationIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetOrganizationIntelligenceConfigRequest} GetOrganizationIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationIntelligenceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationIntelligenceConfigRequest message. + * @function verify + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationIntelligenceConfigRequest.verify = function verify(message) { + if (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 GetOrganizationIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetOrganizationIntelligenceConfigRequest} GetOrganizationIntelligenceConfigRequest + */ + GetOrganizationIntelligenceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest) + return object; + var message = new $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationIntelligenceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.GetOrganizationIntelligenceConfigRequest} message GetOrganizationIntelligenceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationIntelligenceConfigRequest.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 GetOrganizationIntelligenceConfigRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationIntelligenceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOrganizationIntelligenceConfigRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetOrganizationIntelligenceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationIntelligenceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"; + }; + + return GetOrganizationIntelligenceConfigRequest; + })(); + + v2.GetFolderIntelligenceConfigRequest = (function() { + + /** + * Properties of a GetFolderIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @interface IGetFolderIntelligenceConfigRequest + * @property {string|null} [name] GetFolderIntelligenceConfigRequest name + */ + + /** + * Constructs a new GetFolderIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetFolderIntelligenceConfigRequest. + * @implements IGetFolderIntelligenceConfigRequest + * @constructor + * @param {google.storage.control.v2.IGetFolderIntelligenceConfigRequest=} [properties] Properties to set + */ + function GetFolderIntelligenceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFolderIntelligenceConfigRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @instance + */ + GetFolderIntelligenceConfigRequest.prototype.name = ""; + + /** + * Creates a new GetFolderIntelligenceConfigRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetFolderIntelligenceConfigRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetFolderIntelligenceConfigRequest} GetFolderIntelligenceConfigRequest instance + */ + GetFolderIntelligenceConfigRequest.create = function create(properties) { + return new GetFolderIntelligenceConfigRequest(properties); + }; + + /** + * Encodes the specified GetFolderIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.GetFolderIntelligenceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetFolderIntelligenceConfigRequest} message GetFolderIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFolderIntelligenceConfigRequest.encode = function encode(message, writer) { + 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 GetFolderIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetFolderIntelligenceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetFolderIntelligenceConfigRequest} message GetFolderIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFolderIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFolderIntelligenceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetFolderIntelligenceConfigRequest} GetFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFolderIntelligenceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFolderIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetFolderIntelligenceConfigRequest} GetFolderIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFolderIntelligenceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFolderIntelligenceConfigRequest message. + * @function verify + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFolderIntelligenceConfigRequest.verify = function verify(message) { + if (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 GetFolderIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetFolderIntelligenceConfigRequest} GetFolderIntelligenceConfigRequest + */ + GetFolderIntelligenceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest) + return object; + var message = new $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFolderIntelligenceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.GetFolderIntelligenceConfigRequest} message GetFolderIntelligenceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFolderIntelligenceConfigRequest.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 GetFolderIntelligenceConfigRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetFolderIntelligenceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFolderIntelligenceConfigRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetFolderIntelligenceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFolderIntelligenceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetFolderIntelligenceConfigRequest"; + }; + + return GetFolderIntelligenceConfigRequest; + })(); + + v2.GetProjectIntelligenceConfigRequest = (function() { + + /** + * Properties of a GetProjectIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @interface IGetProjectIntelligenceConfigRequest + * @property {string|null} [name] GetProjectIntelligenceConfigRequest name + */ + + /** + * Constructs a new GetProjectIntelligenceConfigRequest. + * @memberof google.storage.control.v2 + * @classdesc Represents a GetProjectIntelligenceConfigRequest. + * @implements IGetProjectIntelligenceConfigRequest + * @constructor + * @param {google.storage.control.v2.IGetProjectIntelligenceConfigRequest=} [properties] Properties to set + */ + function GetProjectIntelligenceConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProjectIntelligenceConfigRequest name. + * @member {string} name + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @instance + */ + GetProjectIntelligenceConfigRequest.prototype.name = ""; + + /** + * Creates a new GetProjectIntelligenceConfigRequest instance using the specified properties. + * @function create + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetProjectIntelligenceConfigRequest=} [properties] Properties to set + * @returns {google.storage.control.v2.GetProjectIntelligenceConfigRequest} GetProjectIntelligenceConfigRequest instance + */ + GetProjectIntelligenceConfigRequest.create = function create(properties) { + return new GetProjectIntelligenceConfigRequest(properties); + }; + + /** + * Encodes the specified GetProjectIntelligenceConfigRequest message. Does not implicitly {@link google.storage.control.v2.GetProjectIntelligenceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetProjectIntelligenceConfigRequest} message GetProjectIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProjectIntelligenceConfigRequest.encode = function encode(message, writer) { + 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 GetProjectIntelligenceConfigRequest message, length delimited. Does not implicitly {@link google.storage.control.v2.GetProjectIntelligenceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.IGetProjectIntelligenceConfigRequest} message GetProjectIntelligenceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProjectIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProjectIntelligenceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.control.v2.GetProjectIntelligenceConfigRequest} GetProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProjectIntelligenceConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProjectIntelligenceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.control.v2.GetProjectIntelligenceConfigRequest} GetProjectIntelligenceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProjectIntelligenceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProjectIntelligenceConfigRequest message. + * @function verify + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProjectIntelligenceConfigRequest.verify = function verify(message) { + if (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 GetProjectIntelligenceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.control.v2.GetProjectIntelligenceConfigRequest} GetProjectIntelligenceConfigRequest + */ + GetProjectIntelligenceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest) + return object; + var message = new $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProjectIntelligenceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {google.storage.control.v2.GetProjectIntelligenceConfigRequest} message GetProjectIntelligenceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProjectIntelligenceConfigRequest.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 GetProjectIntelligenceConfigRequest to JSON. + * @function toJSON + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetProjectIntelligenceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProjectIntelligenceConfigRequest + * @function getTypeUrl + * @memberof google.storage.control.v2.GetProjectIntelligenceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProjectIntelligenceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.control.v2.GetProjectIntelligenceConfigRequest"; + }; + + return GetProjectIntelligenceConfigRequest; + })(); + + return v2; + })(); + + return control; + })(); + + storage.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.storage + * @namespace + */ + var v2 = {}; + + v2.Storage = (function() { + + /** + * Constructs a new Storage service. + * @memberof google.storage.v2 + * @classdesc Represents a Storage + * @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 Storage(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Storage.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Storage; + + /** + * Creates new Storage service using the specified rpc implementation. + * @function create + * @memberof google.storage.v2.Storage + * @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 {Storage} RPC service. Useful where requests and/or responses are streamed. + */ + Storage.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.storage.v2.Storage|deleteBucket}. + * @memberof google.storage.v2.Storage + * @typedef DeleteBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBucket. + * @function deleteBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IDeleteBucketRequest} request DeleteBucketRequest message or plain object + * @param {google.storage.v2.Storage.DeleteBucketCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.deleteBucket = function deleteBucket(request, callback) { + return this.rpcCall(deleteBucket, $root.google.storage.v2.DeleteBucketRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBucket" }); + + /** + * Calls DeleteBucket. + * @function deleteBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IDeleteBucketRequest} request DeleteBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|getBucket}. + * @memberof google.storage.v2.Storage + * @typedef GetBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Bucket} [response] Bucket + */ + + /** + * Calls GetBucket. + * @function getBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IGetBucketRequest} request GetBucketRequest message or plain object + * @param {google.storage.v2.Storage.GetBucketCallback} callback Node-style callback called with the error, if any, and Bucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.getBucket = function getBucket(request, callback) { + return this.rpcCall(getBucket, $root.google.storage.v2.GetBucketRequest, $root.google.storage.v2.Bucket, request, callback); + }, "name", { value: "GetBucket" }); + + /** + * Calls GetBucket. + * @function getBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IGetBucketRequest} request GetBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|createBucket}. + * @memberof google.storage.v2.Storage + * @typedef CreateBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Bucket} [response] Bucket + */ + + /** + * Calls CreateBucket. + * @function createBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object + * @param {google.storage.v2.Storage.CreateBucketCallback} callback Node-style callback called with the error, if any, and Bucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.createBucket = function createBucket(request, callback) { + return this.rpcCall(createBucket, $root.google.storage.v2.CreateBucketRequest, $root.google.storage.v2.Bucket, request, callback); + }, "name", { value: "CreateBucket" }); + + /** + * Calls CreateBucket. + * @function createBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|listBuckets}. + * @memberof google.storage.v2.Storage + * @typedef ListBucketsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.ListBucketsResponse} [response] ListBucketsResponse + */ + + /** + * Calls ListBuckets. + * @function listBuckets + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IListBucketsRequest} request ListBucketsRequest message or plain object + * @param {google.storage.v2.Storage.ListBucketsCallback} callback Node-style callback called with the error, if any, and ListBucketsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.listBuckets = function listBuckets(request, callback) { + return this.rpcCall(listBuckets, $root.google.storage.v2.ListBucketsRequest, $root.google.storage.v2.ListBucketsResponse, request, callback); + }, "name", { value: "ListBuckets" }); + + /** + * Calls ListBuckets. + * @function listBuckets + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IListBucketsRequest} request ListBucketsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|lockBucketRetentionPolicy}. + * @memberof google.storage.v2.Storage + * @typedef LockBucketRetentionPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Bucket} [response] Bucket + */ + + /** + * Calls LockBucketRetentionPolicy. + * @function lockBucketRetentionPolicy + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.ILockBucketRetentionPolicyRequest} request LockBucketRetentionPolicyRequest message or plain object + * @param {google.storage.v2.Storage.LockBucketRetentionPolicyCallback} callback Node-style callback called with the error, if any, and Bucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.lockBucketRetentionPolicy = function lockBucketRetentionPolicy(request, callback) { + return this.rpcCall(lockBucketRetentionPolicy, $root.google.storage.v2.LockBucketRetentionPolicyRequest, $root.google.storage.v2.Bucket, request, callback); + }, "name", { value: "LockBucketRetentionPolicy" }); + + /** + * Calls LockBucketRetentionPolicy. + * @function lockBucketRetentionPolicy + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.ILockBucketRetentionPolicyRequest} request LockBucketRetentionPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|getIamPolicy}. + * @memberof google.storage.v2.Storage + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.storage.v2.Storage + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.storage.v2.Storage.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.storage.v2.Storage + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|setIamPolicy}. + * @memberof google.storage.v2.Storage + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.storage.v2.Storage + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.storage.v2.Storage.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.storage.v2.Storage + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|testIamPermissions}. + * @memberof google.storage.v2.Storage + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.storage.v2.Storage + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.storage.v2.Storage.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.storage.v2.Storage + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|updateBucket}. + * @memberof google.storage.v2.Storage + * @typedef UpdateBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Bucket} [response] Bucket + */ + + /** + * Calls UpdateBucket. + * @function updateBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object + * @param {google.storage.v2.Storage.UpdateBucketCallback} callback Node-style callback called with the error, if any, and Bucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.updateBucket = function updateBucket(request, callback) { + return this.rpcCall(updateBucket, $root.google.storage.v2.UpdateBucketRequest, $root.google.storage.v2.Bucket, request, callback); + }, "name", { value: "UpdateBucket" }); + + /** + * Calls UpdateBucket. + * @function updateBucket + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|composeObject}. + * @memberof google.storage.v2.Storage + * @typedef ComposeObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Object} [response] Object + */ + + /** + * Calls ComposeObject. + * @function composeObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IComposeObjectRequest} request ComposeObjectRequest message or plain object + * @param {google.storage.v2.Storage.ComposeObjectCallback} callback Node-style callback called with the error, if any, and Object + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.composeObject = function composeObject(request, callback) { + return this.rpcCall(composeObject, $root.google.storage.v2.ComposeObjectRequest, $root.google.storage.v2.Object, request, callback); + }, "name", { value: "ComposeObject" }); + + /** + * Calls ComposeObject. + * @function composeObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IComposeObjectRequest} request ComposeObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|deleteObject}. + * @memberof google.storage.v2.Storage + * @typedef DeleteObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteObject. + * @function deleteObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IDeleteObjectRequest} request DeleteObjectRequest message or plain object + * @param {google.storage.v2.Storage.DeleteObjectCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.deleteObject = function deleteObject(request, callback) { + return this.rpcCall(deleteObject, $root.google.storage.v2.DeleteObjectRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteObject" }); + + /** + * Calls DeleteObject. + * @function deleteObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IDeleteObjectRequest} request DeleteObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|restoreObject}. + * @memberof google.storage.v2.Storage + * @typedef RestoreObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Object} [response] Object + */ + + /** + * Calls RestoreObject. + * @function restoreObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IRestoreObjectRequest} request RestoreObjectRequest message or plain object + * @param {google.storage.v2.Storage.RestoreObjectCallback} callback Node-style callback called with the error, if any, and Object + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.restoreObject = function restoreObject(request, callback) { + return this.rpcCall(restoreObject, $root.google.storage.v2.RestoreObjectRequest, $root.google.storage.v2.Object, request, callback); + }, "name", { value: "RestoreObject" }); + + /** + * Calls RestoreObject. + * @function restoreObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IRestoreObjectRequest} request RestoreObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|cancelResumableWrite}. + * @memberof google.storage.v2.Storage + * @typedef CancelResumableWriteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.CancelResumableWriteResponse} [response] CancelResumableWriteResponse + */ + + /** + * Calls CancelResumableWrite. + * @function cancelResumableWrite + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.ICancelResumableWriteRequest} request CancelResumableWriteRequest message or plain object + * @param {google.storage.v2.Storage.CancelResumableWriteCallback} callback Node-style callback called with the error, if any, and CancelResumableWriteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.cancelResumableWrite = function cancelResumableWrite(request, callback) { + return this.rpcCall(cancelResumableWrite, $root.google.storage.v2.CancelResumableWriteRequest, $root.google.storage.v2.CancelResumableWriteResponse, request, callback); + }, "name", { value: "CancelResumableWrite" }); + + /** + * Calls CancelResumableWrite. + * @function cancelResumableWrite + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.ICancelResumableWriteRequest} request CancelResumableWriteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|getObject}. + * @memberof google.storage.v2.Storage + * @typedef GetObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Object} [response] Object + */ + + /** + * Calls GetObject. + * @function getObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IGetObjectRequest} request GetObjectRequest message or plain object + * @param {google.storage.v2.Storage.GetObjectCallback} callback Node-style callback called with the error, if any, and Object + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.getObject = function getObject(request, callback) { + return this.rpcCall(getObject, $root.google.storage.v2.GetObjectRequest, $root.google.storage.v2.Object, request, callback); + }, "name", { value: "GetObject" }); + + /** + * Calls GetObject. + * @function getObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IGetObjectRequest} request GetObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|readObject}. + * @memberof google.storage.v2.Storage + * @typedef ReadObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.ReadObjectResponse} [response] ReadObjectResponse + */ + + /** + * Calls ReadObject. + * @function readObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IReadObjectRequest} request ReadObjectRequest message or plain object + * @param {google.storage.v2.Storage.ReadObjectCallback} callback Node-style callback called with the error, if any, and ReadObjectResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.readObject = function readObject(request, callback) { + return this.rpcCall(readObject, $root.google.storage.v2.ReadObjectRequest, $root.google.storage.v2.ReadObjectResponse, request, callback); + }, "name", { value: "ReadObject" }); + + /** + * Calls ReadObject. + * @function readObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IReadObjectRequest} request ReadObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|bidiReadObject}. + * @memberof google.storage.v2.Storage + * @typedef BidiReadObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.BidiReadObjectResponse} [response] BidiReadObjectResponse + */ + + /** + * Calls BidiReadObject. + * @function bidiReadObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IBidiReadObjectRequest} request BidiReadObjectRequest message or plain object + * @param {google.storage.v2.Storage.BidiReadObjectCallback} callback Node-style callback called with the error, if any, and BidiReadObjectResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.bidiReadObject = function bidiReadObject(request, callback) { + return this.rpcCall(bidiReadObject, $root.google.storage.v2.BidiReadObjectRequest, $root.google.storage.v2.BidiReadObjectResponse, request, callback); + }, "name", { value: "BidiReadObject" }); + + /** + * Calls BidiReadObject. + * @function bidiReadObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IBidiReadObjectRequest} request BidiReadObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|updateObject}. + * @memberof google.storage.v2.Storage + * @typedef UpdateObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Object} [response] Object + */ + + /** + * Calls UpdateObject. + * @function updateObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IUpdateObjectRequest} request UpdateObjectRequest message or plain object + * @param {google.storage.v2.Storage.UpdateObjectCallback} callback Node-style callback called with the error, if any, and Object + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.updateObject = function updateObject(request, callback) { + return this.rpcCall(updateObject, $root.google.storage.v2.UpdateObjectRequest, $root.google.storage.v2.Object, request, callback); + }, "name", { value: "UpdateObject" }); + + /** + * Calls UpdateObject. + * @function updateObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IUpdateObjectRequest} request UpdateObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|writeObject}. + * @memberof google.storage.v2.Storage + * @typedef WriteObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.WriteObjectResponse} [response] WriteObjectResponse + */ + + /** + * Calls WriteObject. + * @function writeObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IWriteObjectRequest} request WriteObjectRequest message or plain object + * @param {google.storage.v2.Storage.WriteObjectCallback} callback Node-style callback called with the error, if any, and WriteObjectResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.writeObject = function writeObject(request, callback) { + return this.rpcCall(writeObject, $root.google.storage.v2.WriteObjectRequest, $root.google.storage.v2.WriteObjectResponse, request, callback); + }, "name", { value: "WriteObject" }); + + /** + * Calls WriteObject. + * @function writeObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IWriteObjectRequest} request WriteObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|bidiWriteObject}. + * @memberof google.storage.v2.Storage + * @typedef BidiWriteObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.BidiWriteObjectResponse} [response] BidiWriteObjectResponse + */ + + /** + * Calls BidiWriteObject. + * @function bidiWriteObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IBidiWriteObjectRequest} request BidiWriteObjectRequest message or plain object + * @param {google.storage.v2.Storage.BidiWriteObjectCallback} callback Node-style callback called with the error, if any, and BidiWriteObjectResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.bidiWriteObject = function bidiWriteObject(request, callback) { + return this.rpcCall(bidiWriteObject, $root.google.storage.v2.BidiWriteObjectRequest, $root.google.storage.v2.BidiWriteObjectResponse, request, callback); + }, "name", { value: "BidiWriteObject" }); + + /** + * Calls BidiWriteObject. + * @function bidiWriteObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IBidiWriteObjectRequest} request BidiWriteObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|listObjects}. + * @memberof google.storage.v2.Storage + * @typedef ListObjectsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.ListObjectsResponse} [response] ListObjectsResponse + */ + + /** + * Calls ListObjects. + * @function listObjects + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IListObjectsRequest} request ListObjectsRequest message or plain object + * @param {google.storage.v2.Storage.ListObjectsCallback} callback Node-style callback called with the error, if any, and ListObjectsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.listObjects = function listObjects(request, callback) { + return this.rpcCall(listObjects, $root.google.storage.v2.ListObjectsRequest, $root.google.storage.v2.ListObjectsResponse, request, callback); + }, "name", { value: "ListObjects" }); + + /** + * Calls ListObjects. + * @function listObjects + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IListObjectsRequest} request ListObjectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|rewriteObject}. + * @memberof google.storage.v2.Storage + * @typedef RewriteObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.RewriteResponse} [response] RewriteResponse + */ + + /** + * Calls RewriteObject. + * @function rewriteObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IRewriteObjectRequest} request RewriteObjectRequest message or plain object + * @param {google.storage.v2.Storage.RewriteObjectCallback} callback Node-style callback called with the error, if any, and RewriteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.rewriteObject = function rewriteObject(request, callback) { + return this.rpcCall(rewriteObject, $root.google.storage.v2.RewriteObjectRequest, $root.google.storage.v2.RewriteResponse, request, callback); + }, "name", { value: "RewriteObject" }); + + /** + * Calls RewriteObject. + * @function rewriteObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IRewriteObjectRequest} request RewriteObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|startResumableWrite}. + * @memberof google.storage.v2.Storage + * @typedef StartResumableWriteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.StartResumableWriteResponse} [response] StartResumableWriteResponse + */ + + /** + * Calls StartResumableWrite. + * @function startResumableWrite + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IStartResumableWriteRequest} request StartResumableWriteRequest message or plain object + * @param {google.storage.v2.Storage.StartResumableWriteCallback} callback Node-style callback called with the error, if any, and StartResumableWriteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.startResumableWrite = function startResumableWrite(request, callback) { + return this.rpcCall(startResumableWrite, $root.google.storage.v2.StartResumableWriteRequest, $root.google.storage.v2.StartResumableWriteResponse, request, callback); + }, "name", { value: "StartResumableWrite" }); + + /** + * Calls StartResumableWrite. + * @function startResumableWrite + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IStartResumableWriteRequest} request StartResumableWriteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|queryWriteStatus}. + * @memberof google.storage.v2.Storage + * @typedef QueryWriteStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.QueryWriteStatusResponse} [response] QueryWriteStatusResponse + */ + + /** + * Calls QueryWriteStatus. + * @function queryWriteStatus + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IQueryWriteStatusRequest} request QueryWriteStatusRequest message or plain object + * @param {google.storage.v2.Storage.QueryWriteStatusCallback} callback Node-style callback called with the error, if any, and QueryWriteStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.queryWriteStatus = function queryWriteStatus(request, callback) { + return this.rpcCall(queryWriteStatus, $root.google.storage.v2.QueryWriteStatusRequest, $root.google.storage.v2.QueryWriteStatusResponse, request, callback); + }, "name", { value: "QueryWriteStatus" }); + + /** + * Calls QueryWriteStatus. + * @function queryWriteStatus + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IQueryWriteStatusRequest} request QueryWriteStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storage.v2.Storage|moveObject}. + * @memberof google.storage.v2.Storage + * @typedef MoveObjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storage.v2.Object} [response] Object + */ + + /** + * Calls MoveObject. + * @function moveObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IMoveObjectRequest} request MoveObjectRequest message or plain object + * @param {google.storage.v2.Storage.MoveObjectCallback} callback Node-style callback called with the error, if any, and Object + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Storage.prototype.moveObject = function moveObject(request, callback) { + return this.rpcCall(moveObject, $root.google.storage.v2.MoveObjectRequest, $root.google.storage.v2.Object, request, callback); + }, "name", { value: "MoveObject" }); + + /** + * Calls MoveObject. + * @function moveObject + * @memberof google.storage.v2.Storage + * @instance + * @param {google.storage.v2.IMoveObjectRequest} request MoveObjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Storage; + })(); + + v2.DeleteBucketRequest = (function() { + + /** + * Properties of a DeleteBucketRequest. + * @memberof google.storage.v2 + * @interface IDeleteBucketRequest + * @property {string|null} [name] DeleteBucketRequest name + * @property {number|Long|null} [ifMetagenerationMatch] DeleteBucketRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] DeleteBucketRequest ifMetagenerationNotMatch + */ + + /** + * Constructs a new DeleteBucketRequest. + * @memberof google.storage.v2 + * @classdesc Represents a DeleteBucketRequest. + * @implements IDeleteBucketRequest + * @constructor + * @param {google.storage.v2.IDeleteBucketRequest=} [properties] Properties to set + */ + function DeleteBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBucketRequest name. + * @member {string} name + * @memberof google.storage.v2.DeleteBucketRequest + * @instance + */ + DeleteBucketRequest.prototype.name = ""; + + /** + * DeleteBucketRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.DeleteBucketRequest + * @instance + */ + DeleteBucketRequest.prototype.ifMetagenerationMatch = null; + + /** + * DeleteBucketRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.DeleteBucketRequest + * @instance + */ + DeleteBucketRequest.prototype.ifMetagenerationNotMatch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteBucketRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteBucketRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteBucketRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {google.storage.v2.IDeleteBucketRequest=} [properties] Properties to set + * @returns {google.storage.v2.DeleteBucketRequest} DeleteBucketRequest instance + */ + DeleteBucketRequest.create = function create(properties) { + return new DeleteBucketRequest(properties); + }; + + /** + * Encodes the specified DeleteBucketRequest message. Does not implicitly {@link google.storage.v2.DeleteBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {google.storage.v2.IDeleteBucketRequest} message DeleteBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBucketRequest.encode = function encode(message, writer) { + 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.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationNotMatch); + return writer; + }; + + /** + * Encodes the specified DeleteBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.DeleteBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {google.storage.v2.IDeleteBucketRequest} message DeleteBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.DeleteBucketRequest} DeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBucketRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.DeleteBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 3: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.DeleteBucketRequest} DeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBucketRequest message. + * @function verify + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBucketRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + return null; + }; + + /** + * Creates a DeleteBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.DeleteBucketRequest} DeleteBucketRequest + */ + DeleteBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.DeleteBucketRequest) + return object; + var message = new $root.google.storage.v2.DeleteBucketRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DeleteBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {google.storage.v2.DeleteBucketRequest} message DeleteBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBucketRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + return object; + }; + + /** + * Converts this DeleteBucketRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.DeleteBucketRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBucketRequest + * @function getTypeUrl + * @memberof google.storage.v2.DeleteBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.DeleteBucketRequest"; + }; + + return DeleteBucketRequest; + })(); + + v2.GetBucketRequest = (function() { + + /** + * Properties of a GetBucketRequest. + * @memberof google.storage.v2 + * @interface IGetBucketRequest + * @property {string|null} [name] GetBucketRequest name + * @property {number|Long|null} [ifMetagenerationMatch] GetBucketRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] GetBucketRequest ifMetagenerationNotMatch + * @property {google.protobuf.IFieldMask|null} [readMask] GetBucketRequest readMask + */ + + /** + * Constructs a new GetBucketRequest. + * @memberof google.storage.v2 + * @classdesc Represents a GetBucketRequest. + * @implements IGetBucketRequest + * @constructor + * @param {google.storage.v2.IGetBucketRequest=} [properties] Properties to set + */ + function GetBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBucketRequest name. + * @member {string} name + * @memberof google.storage.v2.GetBucketRequest + * @instance + */ + GetBucketRequest.prototype.name = ""; + + /** + * GetBucketRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.GetBucketRequest + * @instance + */ + GetBucketRequest.prototype.ifMetagenerationMatch = null; + + /** + * GetBucketRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.GetBucketRequest + * @instance + */ + GetBucketRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * GetBucketRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.storage.v2.GetBucketRequest + * @instance + */ + GetBucketRequest.prototype.readMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetBucketRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetBucketRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetBucketRequest.prototype, "_readMask", { + get: $util.oneOfGetter($oneOfFields = ["readMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetBucketRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {google.storage.v2.IGetBucketRequest=} [properties] Properties to set + * @returns {google.storage.v2.GetBucketRequest} GetBucketRequest instance + */ + GetBucketRequest.create = function create(properties) { + return new GetBucketRequest(properties); + }; + + /** + * Encodes the specified GetBucketRequest message. Does not implicitly {@link google.storage.v2.GetBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {google.storage.v2.IGetBucketRequest} message GetBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBucketRequest.encode = function encode(message, writer) { + 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.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationNotMatch); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.GetBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {google.storage.v2.IGetBucketRequest} message GetBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.GetBucketRequest} GetBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBucketRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.GetBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 3: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 5: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.GetBucketRequest} GetBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBucketRequest message. + * @function verify + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBucketRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.readMask != null && message.hasOwnProperty("readMask")) { + properties._readMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + } + return null; + }; + + /** + * Creates a GetBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.GetBucketRequest} GetBucketRequest + */ + GetBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.GetBucketRequest) + return object; + var message = new $root.google.storage.v2.GetBucketRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.storage.v2.GetBucketRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + return message; + }; + + /** + * Creates a plain object from a GetBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {google.storage.v2.GetBucketRequest} message GetBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBucketRequest.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.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.oneofs) + object._readMask = "readMask"; + } + return object; + }; + + /** + * Converts this GetBucketRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.GetBucketRequest + * @instance + * @returns {Object.} JSON object + */ + GetBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBucketRequest + * @function getTypeUrl + * @memberof google.storage.v2.GetBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.GetBucketRequest"; + }; + + return GetBucketRequest; + })(); + + v2.CreateBucketRequest = (function() { + + /** + * Properties of a CreateBucketRequest. + * @memberof google.storage.v2 + * @interface ICreateBucketRequest + * @property {string|null} [parent] CreateBucketRequest parent + * @property {google.storage.v2.IBucket|null} [bucket] CreateBucketRequest bucket + * @property {string|null} [bucketId] CreateBucketRequest bucketId + * @property {string|null} [predefinedAcl] CreateBucketRequest predefinedAcl + * @property {string|null} [predefinedDefaultObjectAcl] CreateBucketRequest predefinedDefaultObjectAcl + * @property {boolean|null} [enableObjectRetention] CreateBucketRequest enableObjectRetention + */ + + /** + * Constructs a new CreateBucketRequest. + * @memberof google.storage.v2 + * @classdesc Represents a CreateBucketRequest. + * @implements ICreateBucketRequest + * @constructor + * @param {google.storage.v2.ICreateBucketRequest=} [properties] Properties to set + */ + function CreateBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBucketRequest parent. + * @member {string} parent + * @memberof google.storage.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.parent = ""; + + /** + * CreateBucketRequest bucket. + * @member {google.storage.v2.IBucket|null|undefined} bucket + * @memberof google.storage.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.bucket = null; + + /** + * CreateBucketRequest bucketId. + * @member {string} bucketId + * @memberof google.storage.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.bucketId = ""; + + /** + * CreateBucketRequest predefinedAcl. + * @member {string} predefinedAcl + * @memberof google.storage.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.predefinedAcl = ""; + + /** + * CreateBucketRequest predefinedDefaultObjectAcl. + * @member {string} predefinedDefaultObjectAcl + * @memberof google.storage.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.predefinedDefaultObjectAcl = ""; + + /** + * CreateBucketRequest enableObjectRetention. + * @member {boolean} enableObjectRetention + * @memberof google.storage.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.enableObjectRetention = false; + + /** + * Creates a new CreateBucketRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {google.storage.v2.ICreateBucketRequest=} [properties] Properties to set + * @returns {google.storage.v2.CreateBucketRequest} CreateBucketRequest instance + */ + CreateBucketRequest.create = function create(properties) { + return new CreateBucketRequest(properties); + }; + + /** + * Encodes the specified CreateBucketRequest message. Does not implicitly {@link google.storage.v2.CreateBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {google.storage.v2.ICreateBucketRequest} message CreateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBucketRequest.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.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + $root.google.storage.v2.Bucket.encode(message.bucket, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bucketId); + if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.predefinedAcl); + if (message.predefinedDefaultObjectAcl != null && Object.hasOwnProperty.call(message, "predefinedDefaultObjectAcl")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.predefinedDefaultObjectAcl); + if (message.enableObjectRetention != null && Object.hasOwnProperty.call(message, "enableObjectRetention")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableObjectRetention); + return writer; + }; + + /** + * Encodes the specified CreateBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.CreateBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {google.storage.v2.ICreateBucketRequest} message CreateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.CreateBucketRequest} CreateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBucketRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.CreateBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.bucket = $root.google.storage.v2.Bucket.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bucketId = reader.string(); + break; + } + case 6: { + message.predefinedAcl = reader.string(); + break; + } + case 7: { + message.predefinedDefaultObjectAcl = reader.string(); + break; + } + case 9: { + message.enableObjectRetention = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.CreateBucketRequest} CreateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBucketRequest message. + * @function verify + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBucketRequest.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.bucket != null && message.hasOwnProperty("bucket")) { + var error = $root.google.storage.v2.Bucket.verify(message.bucket); + if (error) + return "bucket." + error; + } + if (message.bucketId != null && message.hasOwnProperty("bucketId")) + if (!$util.isString(message.bucketId)) + return "bucketId: string expected"; + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + if (!$util.isString(message.predefinedAcl)) + return "predefinedAcl: string expected"; + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) + if (!$util.isString(message.predefinedDefaultObjectAcl)) + return "predefinedDefaultObjectAcl: string expected"; + if (message.enableObjectRetention != null && message.hasOwnProperty("enableObjectRetention")) + if (typeof message.enableObjectRetention !== "boolean") + return "enableObjectRetention: boolean expected"; + return null; + }; + + /** + * Creates a CreateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.CreateBucketRequest} CreateBucketRequest + */ + CreateBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.CreateBucketRequest) + return object; + var message = new $root.google.storage.v2.CreateBucketRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.bucket != null) { + if (typeof object.bucket !== "object") + throw TypeError(".google.storage.v2.CreateBucketRequest.bucket: object expected"); + message.bucket = $root.google.storage.v2.Bucket.fromObject(object.bucket); + } + if (object.bucketId != null) + message.bucketId = String(object.bucketId); + if (object.predefinedAcl != null) + message.predefinedAcl = String(object.predefinedAcl); + if (object.predefinedDefaultObjectAcl != null) + message.predefinedDefaultObjectAcl = String(object.predefinedDefaultObjectAcl); + if (object.enableObjectRetention != null) + message.enableObjectRetention = Boolean(object.enableObjectRetention); + return message; + }; + + /** + * Creates a plain object from a CreateBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {google.storage.v2.CreateBucketRequest} message CreateBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.bucket = null; + object.bucketId = ""; + object.predefinedAcl = ""; + object.predefinedDefaultObjectAcl = ""; + object.enableObjectRetention = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = $root.google.storage.v2.Bucket.toObject(message.bucket, options); + if (message.bucketId != null && message.hasOwnProperty("bucketId")) + object.bucketId = message.bucketId; + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + object.predefinedAcl = message.predefinedAcl; + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) + object.predefinedDefaultObjectAcl = message.predefinedDefaultObjectAcl; + if (message.enableObjectRetention != null && message.hasOwnProperty("enableObjectRetention")) + object.enableObjectRetention = message.enableObjectRetention; + return object; + }; + + /** + * Converts this CreateBucketRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.CreateBucketRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBucketRequest + * @function getTypeUrl + * @memberof google.storage.v2.CreateBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.CreateBucketRequest"; + }; + + return CreateBucketRequest; + })(); + + v2.ListBucketsRequest = (function() { + + /** + * Properties of a ListBucketsRequest. + * @memberof google.storage.v2 + * @interface IListBucketsRequest + * @property {string|null} [parent] ListBucketsRequest parent + * @property {number|null} [pageSize] ListBucketsRequest pageSize + * @property {string|null} [pageToken] ListBucketsRequest pageToken + * @property {string|null} [prefix] ListBucketsRequest prefix + * @property {google.protobuf.IFieldMask|null} [readMask] ListBucketsRequest readMask + * @property {boolean|null} [returnPartialSuccess] ListBucketsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListBucketsRequest. + * @memberof google.storage.v2 + * @classdesc Represents a ListBucketsRequest. + * @implements IListBucketsRequest + * @constructor + * @param {google.storage.v2.IListBucketsRequest=} [properties] Properties to set + */ + function ListBucketsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBucketsRequest parent. + * @member {string} parent + * @memberof google.storage.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.parent = ""; + + /** + * ListBucketsRequest pageSize. + * @member {number} pageSize + * @memberof google.storage.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.pageSize = 0; + + /** + * ListBucketsRequest pageToken. + * @member {string} pageToken + * @memberof google.storage.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.pageToken = ""; + + /** + * ListBucketsRequest prefix. + * @member {string} prefix + * @memberof google.storage.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.prefix = ""; + + /** + * ListBucketsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.storage.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.readMask = null; + + /** + * ListBucketsRequest returnPartialSuccess. + * @member {boolean} returnPartialSuccess + * @memberof google.storage.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.returnPartialSuccess = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListBucketsRequest.prototype, "_readMask", { + get: $util.oneOfGetter($oneOfFields = ["readMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListBucketsRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {google.storage.v2.IListBucketsRequest=} [properties] Properties to set + * @returns {google.storage.v2.ListBucketsRequest} ListBucketsRequest instance + */ + ListBucketsRequest.create = function create(properties) { + return new ListBucketsRequest(properties); + }; + + /** + * Encodes the specified ListBucketsRequest message. Does not implicitly {@link google.storage.v2.ListBucketsRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {google.storage.v2.IListBucketsRequest} message ListBucketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsRequest.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.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prefix); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListBucketsRequest message, length delimited. Does not implicitly {@link google.storage.v2.ListBucketsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {google.storage.v2.IListBucketsRequest} message ListBucketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ListBucketsRequest} ListBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ListBucketsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.prefix = reader.string(); + break; + } + case 5: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 9: { + message.returnPartialSuccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ListBucketsRequest} ListBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBucketsRequest message. + * @function verify + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBucketsRequest.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.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.prefix != null && message.hasOwnProperty("prefix")) + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + properties._readMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + return null; + }; + + /** + * Creates a ListBucketsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ListBucketsRequest} ListBucketsRequest + */ + ListBucketsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ListBucketsRequest) + return object; + var message = new $root.google.storage.v2.ListBucketsRequest(); + 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.prefix != null) + message.prefix = String(object.prefix); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.storage.v2.ListBucketsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListBucketsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {google.storage.v2.ListBucketsRequest} message ListBucketsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBucketsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.prefix = ""; + object.returnPartialSuccess = 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.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = message.prefix; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.oneofs) + object._readMask = "readMask"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) + object.returnPartialSuccess = message.returnPartialSuccess; + return object; + }; + + /** + * Converts this ListBucketsRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.ListBucketsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBucketsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBucketsRequest + * @function getTypeUrl + * @memberof google.storage.v2.ListBucketsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBucketsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ListBucketsRequest"; + }; + + return ListBucketsRequest; + })(); + + v2.ListBucketsResponse = (function() { + + /** + * Properties of a ListBucketsResponse. + * @memberof google.storage.v2 + * @interface IListBucketsResponse + * @property {Array.|null} [buckets] ListBucketsResponse buckets + * @property {string|null} [nextPageToken] ListBucketsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBucketsResponse unreachable + */ + + /** + * Constructs a new ListBucketsResponse. + * @memberof google.storage.v2 + * @classdesc Represents a ListBucketsResponse. + * @implements IListBucketsResponse + * @constructor + * @param {google.storage.v2.IListBucketsResponse=} [properties] Properties to set + */ + function ListBucketsResponse(properties) { + this.buckets = []; + 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]]; + } + + /** + * ListBucketsResponse buckets. + * @member {Array.} buckets + * @memberof google.storage.v2.ListBucketsResponse + * @instance + */ + ListBucketsResponse.prototype.buckets = $util.emptyArray; + + /** + * ListBucketsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storage.v2.ListBucketsResponse + * @instance + */ + ListBucketsResponse.prototype.nextPageToken = ""; + + /** + * ListBucketsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.storage.v2.ListBucketsResponse + * @instance + */ + ListBucketsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBucketsResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {google.storage.v2.IListBucketsResponse=} [properties] Properties to set + * @returns {google.storage.v2.ListBucketsResponse} ListBucketsResponse instance + */ + ListBucketsResponse.create = function create(properties) { + return new ListBucketsResponse(properties); + }; + + /** + * Encodes the specified ListBucketsResponse message. Does not implicitly {@link google.storage.v2.ListBucketsResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {google.storage.v2.IListBucketsResponse} message ListBucketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.storage.v2.Bucket.encode(message.buckets[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 ListBucketsResponse message, length delimited. Does not implicitly {@link google.storage.v2.ListBucketsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {google.storage.v2.IListBucketsResponse} message ListBucketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ListBucketsResponse} ListBucketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ListBucketsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.storage.v2.Bucket.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 ListBucketsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ListBucketsResponse} ListBucketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBucketsResponse message. + * @function verify + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBucketsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.storage.v2.Bucket.verify(message.buckets[i]); + if (error) + return "buckets." + 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 ListBucketsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ListBucketsResponse} ListBucketsResponse + */ + ListBucketsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ListBucketsResponse) + return object; + var message = new $root.google.storage.v2.ListBucketsResponse(); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.storage.v2.ListBucketsResponse.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (typeof object.buckets[i] !== "object") + throw TypeError(".google.storage.v2.ListBucketsResponse.buckets: object expected"); + message.buckets[i] = $root.google.storage.v2.Bucket.fromObject(object.buckets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.storage.v2.ListBucketsResponse.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 ListBucketsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {google.storage.v2.ListBucketsResponse} message ListBucketsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBucketsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.buckets = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.storage.v2.Bucket.toObject(message.buckets[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 ListBucketsResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.ListBucketsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBucketsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBucketsResponse + * @function getTypeUrl + * @memberof google.storage.v2.ListBucketsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBucketsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ListBucketsResponse"; + }; + + return ListBucketsResponse; + })(); + + v2.LockBucketRetentionPolicyRequest = (function() { + + /** + * Properties of a LockBucketRetentionPolicyRequest. + * @memberof google.storage.v2 + * @interface ILockBucketRetentionPolicyRequest + * @property {string|null} [bucket] LockBucketRetentionPolicyRequest bucket + * @property {number|Long|null} [ifMetagenerationMatch] LockBucketRetentionPolicyRequest ifMetagenerationMatch + */ + + /** + * Constructs a new LockBucketRetentionPolicyRequest. + * @memberof google.storage.v2 + * @classdesc Represents a LockBucketRetentionPolicyRequest. + * @implements ILockBucketRetentionPolicyRequest + * @constructor + * @param {google.storage.v2.ILockBucketRetentionPolicyRequest=} [properties] Properties to set + */ + function LockBucketRetentionPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LockBucketRetentionPolicyRequest bucket. + * @member {string} bucket + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @instance + */ + LockBucketRetentionPolicyRequest.prototype.bucket = ""; + + /** + * LockBucketRetentionPolicyRequest ifMetagenerationMatch. + * @member {number|Long} ifMetagenerationMatch + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @instance + */ + LockBucketRetentionPolicyRequest.prototype.ifMetagenerationMatch = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new LockBucketRetentionPolicyRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {google.storage.v2.ILockBucketRetentionPolicyRequest=} [properties] Properties to set + * @returns {google.storage.v2.LockBucketRetentionPolicyRequest} LockBucketRetentionPolicyRequest instance + */ + LockBucketRetentionPolicyRequest.create = function create(properties) { + return new LockBucketRetentionPolicyRequest(properties); + }; + + /** + * Encodes the specified LockBucketRetentionPolicyRequest message. Does not implicitly {@link google.storage.v2.LockBucketRetentionPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {google.storage.v2.ILockBucketRetentionPolicyRequest} message LockBucketRetentionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockBucketRetentionPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ifMetagenerationMatch); + return writer; + }; + + /** + * Encodes the specified LockBucketRetentionPolicyRequest message, length delimited. Does not implicitly {@link google.storage.v2.LockBucketRetentionPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {google.storage.v2.ILockBucketRetentionPolicyRequest} message LockBucketRetentionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockBucketRetentionPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LockBucketRetentionPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.LockBucketRetentionPolicyRequest} LockBucketRetentionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockBucketRetentionPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.LockBucketRetentionPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LockBucketRetentionPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.LockBucketRetentionPolicyRequest} LockBucketRetentionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockBucketRetentionPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LockBucketRetentionPolicyRequest message. + * @function verify + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LockBucketRetentionPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + return null; + }; + + /** + * Creates a LockBucketRetentionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.LockBucketRetentionPolicyRequest} LockBucketRetentionPolicyRequest + */ + LockBucketRetentionPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.LockBucketRetentionPolicyRequest) + return object; + var message = new $root.google.storage.v2.LockBucketRetentionPolicyRequest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LockBucketRetentionPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {google.storage.v2.LockBucketRetentionPolicyRequest} message LockBucketRetentionPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LockBucketRetentionPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ifMetagenerationMatch = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ifMetagenerationMatch = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + return object; + }; + + /** + * Converts this LockBucketRetentionPolicyRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + LockBucketRetentionPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LockBucketRetentionPolicyRequest + * @function getTypeUrl + * @memberof google.storage.v2.LockBucketRetentionPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LockBucketRetentionPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.LockBucketRetentionPolicyRequest"; + }; + + return LockBucketRetentionPolicyRequest; + })(); + + v2.UpdateBucketRequest = (function() { + + /** + * Properties of an UpdateBucketRequest. + * @memberof google.storage.v2 + * @interface IUpdateBucketRequest + * @property {google.storage.v2.IBucket|null} [bucket] UpdateBucketRequest bucket + * @property {number|Long|null} [ifMetagenerationMatch] UpdateBucketRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] UpdateBucketRequest ifMetagenerationNotMatch + * @property {string|null} [predefinedAcl] UpdateBucketRequest predefinedAcl + * @property {string|null} [predefinedDefaultObjectAcl] UpdateBucketRequest predefinedDefaultObjectAcl + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBucketRequest updateMask + */ + + /** + * Constructs a new UpdateBucketRequest. + * @memberof google.storage.v2 + * @classdesc Represents an UpdateBucketRequest. + * @implements IUpdateBucketRequest + * @constructor + * @param {google.storage.v2.IUpdateBucketRequest=} [properties] Properties to set + */ + function UpdateBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBucketRequest bucket. + * @member {google.storage.v2.IBucket|null|undefined} bucket + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.bucket = null; + + /** + * UpdateBucketRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.ifMetagenerationMatch = null; + + /** + * UpdateBucketRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * UpdateBucketRequest predefinedAcl. + * @member {string} predefinedAcl + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.predefinedAcl = ""; + + /** + * UpdateBucketRequest predefinedDefaultObjectAcl. + * @member {string} predefinedDefaultObjectAcl + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.predefinedDefaultObjectAcl = ""; + + /** + * UpdateBucketRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.updateMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateBucketRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateBucketRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateBucketRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {google.storage.v2.IUpdateBucketRequest=} [properties] Properties to set + * @returns {google.storage.v2.UpdateBucketRequest} UpdateBucketRequest instance + */ + UpdateBucketRequest.create = function create(properties) { + return new UpdateBucketRequest(properties); + }; + + /** + * Encodes the specified UpdateBucketRequest message. Does not implicitly {@link google.storage.v2.UpdateBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {google.storage.v2.IUpdateBucketRequest} message UpdateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + $root.google.storage.v2.Bucket.encode(message.bucket, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifMetagenerationNotMatch); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.predefinedAcl); + if (message.predefinedDefaultObjectAcl != null && Object.hasOwnProperty.call(message, "predefinedDefaultObjectAcl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.predefinedDefaultObjectAcl); + return writer; + }; + + /** + * Encodes the specified UpdateBucketRequest message, length delimited. Does not implicitly {@link google.storage.v2.UpdateBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {google.storage.v2.IUpdateBucketRequest} message UpdateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.UpdateBucketRequest} UpdateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBucketRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.UpdateBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = $root.google.storage.v2.Bucket.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 3: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 8: { + message.predefinedAcl = reader.string(); + break; + } + case 9: { + message.predefinedDefaultObjectAcl = reader.string(); + break; + } + case 6: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.UpdateBucketRequest} UpdateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBucketRequest message. + * @function verify + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) { + var error = $root.google.storage.v2.Bucket.verify(message.bucket); + if (error) + return "bucket." + error; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + if (!$util.isString(message.predefinedAcl)) + return "predefinedAcl: string expected"; + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) + if (!$util.isString(message.predefinedDefaultObjectAcl)) + return "predefinedDefaultObjectAcl: string expected"; + 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 UpdateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.UpdateBucketRequest} UpdateBucketRequest + */ + UpdateBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.UpdateBucketRequest) + return object; + var message = new $root.google.storage.v2.UpdateBucketRequest(); + if (object.bucket != null) { + if (typeof object.bucket !== "object") + throw TypeError(".google.storage.v2.UpdateBucketRequest.bucket: object expected"); + message.bucket = $root.google.storage.v2.Bucket.fromObject(object.bucket); + } + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.predefinedAcl != null) + message.predefinedAcl = String(object.predefinedAcl); + if (object.predefinedDefaultObjectAcl != null) + message.predefinedDefaultObjectAcl = String(object.predefinedDefaultObjectAcl); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storage.v2.UpdateBucketRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {google.storage.v2.UpdateBucketRequest} message UpdateBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = null; + object.updateMask = null; + object.predefinedAcl = ""; + object.predefinedDefaultObjectAcl = ""; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = $root.google.storage.v2.Bucket.toObject(message.bucket, options); + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + object.predefinedAcl = message.predefinedAcl; + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) + object.predefinedDefaultObjectAcl = message.predefinedDefaultObjectAcl; + return object; + }; + + /** + * Converts this UpdateBucketRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.UpdateBucketRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBucketRequest + * @function getTypeUrl + * @memberof google.storage.v2.UpdateBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.UpdateBucketRequest"; + }; + + return UpdateBucketRequest; + })(); + + v2.ComposeObjectRequest = (function() { + + /** + * Properties of a ComposeObjectRequest. + * @memberof google.storage.v2 + * @interface IComposeObjectRequest + * @property {google.storage.v2.IObject|null} [destination] ComposeObjectRequest destination + * @property {Array.|null} [sourceObjects] ComposeObjectRequest sourceObjects + * @property {string|null} [destinationPredefinedAcl] ComposeObjectRequest destinationPredefinedAcl + * @property {number|Long|null} [ifGenerationMatch] ComposeObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifMetagenerationMatch] ComposeObjectRequest ifMetagenerationMatch + * @property {string|null} [kmsKey] ComposeObjectRequest kmsKey + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] ComposeObjectRequest commonObjectRequestParams + * @property {google.storage.v2.IObjectChecksums|null} [objectChecksums] ComposeObjectRequest objectChecksums + * @property {boolean|null} [deleteSourceObjects] ComposeObjectRequest deleteSourceObjects + */ + + /** + * Constructs a new ComposeObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a ComposeObjectRequest. + * @implements IComposeObjectRequest + * @constructor + * @param {google.storage.v2.IComposeObjectRequest=} [properties] Properties to set + */ + function ComposeObjectRequest(properties) { + this.sourceObjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComposeObjectRequest destination. + * @member {google.storage.v2.IObject|null|undefined} destination + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.destination = null; + + /** + * ComposeObjectRequest sourceObjects. + * @member {Array.} sourceObjects + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.sourceObjects = $util.emptyArray; + + /** + * ComposeObjectRequest destinationPredefinedAcl. + * @member {string} destinationPredefinedAcl + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.destinationPredefinedAcl = ""; + + /** + * ComposeObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.ifGenerationMatch = null; + + /** + * ComposeObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * ComposeObjectRequest kmsKey. + * @member {string} kmsKey + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.kmsKey = ""; + + /** + * ComposeObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.commonObjectRequestParams = null; + + /** + * ComposeObjectRequest objectChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} objectChecksums + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.objectChecksums = null; + + /** + * ComposeObjectRequest deleteSourceObjects. + * @member {boolean|null|undefined} deleteSourceObjects + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + */ + ComposeObjectRequest.prototype.deleteSourceObjects = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComposeObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComposeObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComposeObjectRequest.prototype, "_deleteSourceObjects", { + get: $util.oneOfGetter($oneOfFields = ["deleteSourceObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComposeObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {google.storage.v2.IComposeObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.ComposeObjectRequest} ComposeObjectRequest instance + */ + ComposeObjectRequest.create = function create(properties) { + return new ComposeObjectRequest(properties); + }; + + /** + * Encodes the specified ComposeObjectRequest message. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {google.storage.v2.IComposeObjectRequest} message ComposeObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComposeObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.storage.v2.Object.encode(message.destination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sourceObjects != null && message.sourceObjects.length) + for (var i = 0; i < message.sourceObjects.length; ++i) + $root.google.storage.v2.ComposeObjectRequest.SourceObject.encode(message.sourceObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifGenerationMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifMetagenerationMatch); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKey); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.destinationPredefinedAcl != null && Object.hasOwnProperty.call(message, "destinationPredefinedAcl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.destinationPredefinedAcl); + if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.deleteSourceObjects != null && Object.hasOwnProperty.call(message, "deleteSourceObjects")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deleteSourceObjects); + return writer; + }; + + /** + * Encodes the specified ComposeObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {google.storage.v2.IComposeObjectRequest} message ComposeObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComposeObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComposeObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ComposeObjectRequest} ComposeObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComposeObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ComposeObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.destination = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.sourceObjects && message.sourceObjects.length)) + message.sourceObjects = []; + message.sourceObjects.push($root.google.storage.v2.ComposeObjectRequest.SourceObject.decode(reader, reader.uint32())); + break; + } + case 9: { + message.destinationPredefinedAcl = reader.string(); + break; + } + case 4: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 6: { + message.kmsKey = reader.string(); + break; + } + case 7: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 10: { + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + case 11: { + message.deleteSourceObjects = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComposeObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ComposeObjectRequest} ComposeObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComposeObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComposeObjectRequest message. + * @function verify + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComposeObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.storage.v2.Object.verify(message.destination); + if (error) + return "destination." + error; + } + if (message.sourceObjects != null && message.hasOwnProperty("sourceObjects")) { + if (!Array.isArray(message.sourceObjects)) + return "sourceObjects: array expected"; + for (var i = 0; i < message.sourceObjects.length; ++i) { + var error = $root.google.storage.v2.ComposeObjectRequest.SourceObject.verify(message.sourceObjects[i]); + if (error) + return "sourceObjects." + error; + } + } + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) + if (!$util.isString(message.destinationPredefinedAcl)) + return "destinationPredefinedAcl: string expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums); + if (error) + return "objectChecksums." + error; + } + if (message.deleteSourceObjects != null && message.hasOwnProperty("deleteSourceObjects")) { + properties._deleteSourceObjects = 1; + if (typeof message.deleteSourceObjects !== "boolean") + return "deleteSourceObjects: boolean expected"; + } + return null; + }; + + /** + * Creates a ComposeObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ComposeObjectRequest} ComposeObjectRequest + */ + ComposeObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ComposeObjectRequest) + return object; + var message = new $root.google.storage.v2.ComposeObjectRequest(); + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.storage.v2.ComposeObjectRequest.destination: object expected"); + message.destination = $root.google.storage.v2.Object.fromObject(object.destination); + } + if (object.sourceObjects) { + if (!Array.isArray(object.sourceObjects)) + throw TypeError(".google.storage.v2.ComposeObjectRequest.sourceObjects: array expected"); + message.sourceObjects = []; + for (var i = 0; i < object.sourceObjects.length; ++i) { + if (typeof object.sourceObjects[i] !== "object") + throw TypeError(".google.storage.v2.ComposeObjectRequest.sourceObjects: object expected"); + message.sourceObjects[i] = $root.google.storage.v2.ComposeObjectRequest.SourceObject.fromObject(object.sourceObjects[i]); + } + } + if (object.destinationPredefinedAcl != null) + message.destinationPredefinedAcl = String(object.destinationPredefinedAcl); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.ComposeObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.objectChecksums != null) { + if (typeof object.objectChecksums !== "object") + throw TypeError(".google.storage.v2.ComposeObjectRequest.objectChecksums: object expected"); + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums); + } + if (object.deleteSourceObjects != null) + message.deleteSourceObjects = Boolean(object.deleteSourceObjects); + return message; + }; + + /** + * Creates a plain object from a ComposeObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {google.storage.v2.ComposeObjectRequest} message ComposeObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComposeObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sourceObjects = []; + if (options.defaults) { + object.destination = null; + object.kmsKey = ""; + object.commonObjectRequestParams = null; + object.destinationPredefinedAcl = ""; + object.objectChecksums = null; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.storage.v2.Object.toObject(message.destination, options); + if (message.sourceObjects && message.sourceObjects.length) { + object.sourceObjects = []; + for (var j = 0; j < message.sourceObjects.length; ++j) + object.sourceObjects[j] = $root.google.storage.v2.ComposeObjectRequest.SourceObject.toObject(message.sourceObjects[j], options); + } + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) + object.destinationPredefinedAcl = message.destinationPredefinedAcl; + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); + if (message.deleteSourceObjects != null && message.hasOwnProperty("deleteSourceObjects")) { + object.deleteSourceObjects = message.deleteSourceObjects; + if (options.oneofs) + object._deleteSourceObjects = "deleteSourceObjects"; + } + return object; + }; + + /** + * Converts this ComposeObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.ComposeObjectRequest + * @instance + * @returns {Object.} JSON object + */ + ComposeObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComposeObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.ComposeObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComposeObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ComposeObjectRequest"; + }; + + ComposeObjectRequest.SourceObject = (function() { + + /** + * Properties of a SourceObject. + * @memberof google.storage.v2.ComposeObjectRequest + * @interface ISourceObject + * @property {string|null} [name] SourceObject name + * @property {number|Long|null} [generation] SourceObject generation + * @property {google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions|null} [objectPreconditions] SourceObject objectPreconditions + */ + + /** + * Constructs a new SourceObject. + * @memberof google.storage.v2.ComposeObjectRequest + * @classdesc Represents a SourceObject. + * @implements ISourceObject + * @constructor + * @param {google.storage.v2.ComposeObjectRequest.ISourceObject=} [properties] Properties to set + */ + function SourceObject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceObject name. + * @member {string} name + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @instance + */ + SourceObject.prototype.name = ""; + + /** + * SourceObject generation. + * @member {number|Long} generation + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @instance + */ + SourceObject.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SourceObject objectPreconditions. + * @member {google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions|null|undefined} objectPreconditions + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @instance + */ + SourceObject.prototype.objectPreconditions = null; + + /** + * Creates a new SourceObject instance using the specified properties. + * @function create + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {google.storage.v2.ComposeObjectRequest.ISourceObject=} [properties] Properties to set + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject} SourceObject instance + */ + SourceObject.create = function create(properties) { + return new SourceObject(properties); + }; + + /** + * Encodes the specified SourceObject message. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {google.storage.v2.ComposeObjectRequest.ISourceObject} message SourceObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceObject.encode = function encode(message, writer) { + 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.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.generation); + if (message.objectPreconditions != null && Object.hasOwnProperty.call(message, "objectPreconditions")) + $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.encode(message.objectPreconditions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceObject message, length delimited. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {google.storage.v2.ComposeObjectRequest.ISourceObject} message SourceObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceObject message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject} SourceObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceObject.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ComposeObjectRequest.SourceObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.generation = reader.int64(); + break; + } + case 3: { + message.objectPreconditions = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject} SourceObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceObject message. + * @function verify + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceObject.verify = function verify(message) { + if (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.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.objectPreconditions != null && message.hasOwnProperty("objectPreconditions")) { + var error = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.verify(message.objectPreconditions); + if (error) + return "objectPreconditions." + error; + } + return null; + }; + + /** + * Creates a SourceObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject} SourceObject + */ + SourceObject.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ComposeObjectRequest.SourceObject) + return object; + var message = new $root.google.storage.v2.ComposeObjectRequest.SourceObject(); + if (object.name != null) + message.name = String(object.name); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.objectPreconditions != null) { + if (typeof object.objectPreconditions !== "object") + throw TypeError(".google.storage.v2.ComposeObjectRequest.SourceObject.objectPreconditions: object expected"); + message.objectPreconditions = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.fromObject(object.objectPreconditions); + } + return message; + }; + + /** + * Creates a plain object from a SourceObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {google.storage.v2.ComposeObjectRequest.SourceObject} message SourceObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.objectPreconditions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.objectPreconditions != null && message.hasOwnProperty("objectPreconditions")) + object.objectPreconditions = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.toObject(message.objectPreconditions, options); + return object; + }; + + /** + * Converts this SourceObject to JSON. + * @function toJSON + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @instance + * @returns {Object.} JSON object + */ + SourceObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceObject + * @function getTypeUrl + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceObject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ComposeObjectRequest.SourceObject"; + }; + + SourceObject.ObjectPreconditions = (function() { + + /** + * Properties of an ObjectPreconditions. + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @interface IObjectPreconditions + * @property {number|Long|null} [ifGenerationMatch] ObjectPreconditions ifGenerationMatch + */ + + /** + * Constructs a new ObjectPreconditions. + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject + * @classdesc Represents an ObjectPreconditions. + * @implements IObjectPreconditions + * @constructor + * @param {google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions=} [properties] Properties to set + */ + function ObjectPreconditions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectPreconditions ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @instance + */ + ObjectPreconditions.prototype.ifGenerationMatch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObjectPreconditions.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObjectPreconditions instance using the specified properties. + * @function create + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions=} [properties] Properties to set + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} ObjectPreconditions instance + */ + ObjectPreconditions.create = function create(properties) { + return new ObjectPreconditions(properties); + }; + + /** + * Encodes the specified ObjectPreconditions message. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions} message ObjectPreconditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectPreconditions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.ifGenerationMatch); + return writer; + }; + + /** + * Encodes the specified ObjectPreconditions message, length delimited. Does not implicitly {@link google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {google.storage.v2.ComposeObjectRequest.SourceObject.IObjectPreconditions} message ObjectPreconditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectPreconditions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectPreconditions message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} ObjectPreconditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectPreconditions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ifGenerationMatch = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectPreconditions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} ObjectPreconditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectPreconditions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectPreconditions message. + * @function verify + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectPreconditions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + return null; + }; + + /** + * Creates an ObjectPreconditions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} ObjectPreconditions + */ + ObjectPreconditions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) + return object; + var message = new $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions(); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ObjectPreconditions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions} message ObjectPreconditions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectPreconditions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + return object; + }; + + /** + * Converts this ObjectPreconditions to JSON. + * @function toJSON + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @instance + * @returns {Object.} JSON object + */ + ObjectPreconditions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectPreconditions + * @function getTypeUrl + * @memberof google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectPreconditions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions"; + }; + + return ObjectPreconditions; + })(); + + return SourceObject; + })(); + + return ComposeObjectRequest; + })(); + + v2.DeleteObjectRequest = (function() { + + /** + * Properties of a DeleteObjectRequest. + * @memberof google.storage.v2 + * @interface IDeleteObjectRequest + * @property {string|null} [bucket] DeleteObjectRequest bucket + * @property {string|null} [object] DeleteObjectRequest object + * @property {number|Long|null} [generation] DeleteObjectRequest generation + * @property {number|Long|null} [ifGenerationMatch] DeleteObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] DeleteObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] DeleteObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] DeleteObjectRequest ifMetagenerationNotMatch + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] DeleteObjectRequest commonObjectRequestParams + */ + + /** + * Constructs a new DeleteObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a DeleteObjectRequest. + * @implements IDeleteObjectRequest + * @constructor + * @param {google.storage.v2.IDeleteObjectRequest=} [properties] Properties to set + */ + function DeleteObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteObjectRequest bucket. + * @member {string} bucket + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.bucket = ""; + + /** + * DeleteObjectRequest object. + * @member {string} object + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.object = ""; + + /** + * DeleteObjectRequest generation. + * @member {number|Long} generation + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeleteObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.ifGenerationMatch = null; + + /** + * DeleteObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * DeleteObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * DeleteObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * DeleteObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + */ + DeleteObjectRequest.prototype.commonObjectRequestParams = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {google.storage.v2.IDeleteObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.DeleteObjectRequest} DeleteObjectRequest instance + */ + DeleteObjectRequest.create = function create(properties) { + return new DeleteObjectRequest(properties); + }; + + /** + * Encodes the specified DeleteObjectRequest message. Does not implicitly {@link google.storage.v2.DeleteObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {google.storage.v2.IDeleteObjectRequest} message DeleteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.ifMetagenerationNotMatch); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.DeleteObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {google.storage.v2.IDeleteObjectRequest} message DeleteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.DeleteObjectRequest} DeleteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.DeleteObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 4: { + message.generation = reader.int64(); + break; + } + case 5: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 6: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 7: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 8: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 10: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.DeleteObjectRequest} DeleteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteObjectRequest message. + * @function verify + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + return null; + }; + + /** + * Creates a DeleteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.DeleteObjectRequest} DeleteObjectRequest + */ + DeleteObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.DeleteObjectRequest) + return object; + var message = new $root.google.storage.v2.DeleteObjectRequest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.DeleteObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + return message; + }; + + /** + * Creates a plain object from a DeleteObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {google.storage.v2.DeleteObjectRequest} message DeleteObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.commonObjectRequestParams = null; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + return object; + }; + + /** + * Converts this DeleteObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.DeleteObjectRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.DeleteObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.DeleteObjectRequest"; + }; + + return DeleteObjectRequest; + })(); + + v2.RestoreObjectRequest = (function() { + + /** + * Properties of a RestoreObjectRequest. + * @memberof google.storage.v2 + * @interface IRestoreObjectRequest + * @property {string|null} [bucket] RestoreObjectRequest bucket + * @property {string|null} [object] RestoreObjectRequest object + * @property {number|Long|null} [generation] RestoreObjectRequest generation + * @property {string|null} [restoreToken] RestoreObjectRequest restoreToken + * @property {number|Long|null} [ifGenerationMatch] RestoreObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] RestoreObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] RestoreObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] RestoreObjectRequest ifMetagenerationNotMatch + * @property {boolean|null} [copySourceAcl] RestoreObjectRequest copySourceAcl + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] RestoreObjectRequest commonObjectRequestParams + */ + + /** + * Constructs a new RestoreObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a RestoreObjectRequest. + * @implements IRestoreObjectRequest + * @constructor + * @param {google.storage.v2.IRestoreObjectRequest=} [properties] Properties to set + */ + function RestoreObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreObjectRequest bucket. + * @member {string} bucket + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.bucket = ""; + + /** + * RestoreObjectRequest object. + * @member {string} object + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.object = ""; + + /** + * RestoreObjectRequest generation. + * @member {number|Long} generation + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RestoreObjectRequest restoreToken. + * @member {string} restoreToken + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.restoreToken = ""; + + /** + * RestoreObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.ifGenerationMatch = null; + + /** + * RestoreObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * RestoreObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * RestoreObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * RestoreObjectRequest copySourceAcl. + * @member {boolean|null|undefined} copySourceAcl + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.copySourceAcl = null; + + /** + * RestoreObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + */ + RestoreObjectRequest.prototype.commonObjectRequestParams = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestoreObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestoreObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestoreObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestoreObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestoreObjectRequest.prototype, "_copySourceAcl", { + get: $util.oneOfGetter($oneOfFields = ["copySourceAcl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {google.storage.v2.IRestoreObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.RestoreObjectRequest} RestoreObjectRequest instance + */ + RestoreObjectRequest.create = function create(properties) { + return new RestoreObjectRequest(properties); + }; + + /** + * Encodes the specified RestoreObjectRequest message. Does not implicitly {@link google.storage.v2.RestoreObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {google.storage.v2.IRestoreObjectRequest} message RestoreObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifMetagenerationNotMatch); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.copySourceAcl != null && Object.hasOwnProperty.call(message, "copySourceAcl")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.copySourceAcl); + if (message.restoreToken != null && Object.hasOwnProperty.call(message, "restoreToken")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.restoreToken); + return writer; + }; + + /** + * Encodes the specified RestoreObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.RestoreObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {google.storage.v2.IRestoreObjectRequest} message RestoreObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.RestoreObjectRequest} RestoreObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.RestoreObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 11: { + message.restoreToken = reader.string(); + break; + } + case 4: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 6: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 7: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 9: { + message.copySourceAcl = reader.bool(); + break; + } + case 8: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.RestoreObjectRequest} RestoreObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreObjectRequest message. + * @function verify + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) + if (!$util.isString(message.restoreToken)) + return "restoreToken: string expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.copySourceAcl != null && message.hasOwnProperty("copySourceAcl")) { + properties._copySourceAcl = 1; + if (typeof message.copySourceAcl !== "boolean") + return "copySourceAcl: boolean expected"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + return null; + }; + + /** + * Creates a RestoreObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.RestoreObjectRequest} RestoreObjectRequest + */ + RestoreObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.RestoreObjectRequest) + return object; + var message = new $root.google.storage.v2.RestoreObjectRequest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.restoreToken != null) + message.restoreToken = String(object.restoreToken); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.copySourceAcl != null) + message.copySourceAcl = Boolean(object.copySourceAcl); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.RestoreObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + return message; + }; + + /** + * Creates a plain object from a RestoreObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {google.storage.v2.RestoreObjectRequest} message RestoreObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.commonObjectRequestParams = null; + object.restoreToken = ""; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.copySourceAcl != null && message.hasOwnProperty("copySourceAcl")) { + object.copySourceAcl = message.copySourceAcl; + if (options.oneofs) + object._copySourceAcl = "copySourceAcl"; + } + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) + object.restoreToken = message.restoreToken; + return object; + }; + + /** + * Converts this RestoreObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.RestoreObjectRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.RestoreObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.RestoreObjectRequest"; + }; + + return RestoreObjectRequest; + })(); + + v2.CancelResumableWriteRequest = (function() { + + /** + * Properties of a CancelResumableWriteRequest. + * @memberof google.storage.v2 + * @interface ICancelResumableWriteRequest + * @property {string|null} [uploadId] CancelResumableWriteRequest uploadId + */ + + /** + * Constructs a new CancelResumableWriteRequest. + * @memberof google.storage.v2 + * @classdesc Represents a CancelResumableWriteRequest. + * @implements ICancelResumableWriteRequest + * @constructor + * @param {google.storage.v2.ICancelResumableWriteRequest=} [properties] Properties to set + */ + function CancelResumableWriteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelResumableWriteRequest uploadId. + * @member {string} uploadId + * @memberof google.storage.v2.CancelResumableWriteRequest + * @instance + */ + CancelResumableWriteRequest.prototype.uploadId = ""; + + /** + * Creates a new CancelResumableWriteRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {google.storage.v2.ICancelResumableWriteRequest=} [properties] Properties to set + * @returns {google.storage.v2.CancelResumableWriteRequest} CancelResumableWriteRequest instance + */ + CancelResumableWriteRequest.create = function create(properties) { + return new CancelResumableWriteRequest(properties); + }; + + /** + * Encodes the specified CancelResumableWriteRequest message. Does not implicitly {@link google.storage.v2.CancelResumableWriteRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {google.storage.v2.ICancelResumableWriteRequest} message CancelResumableWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelResumableWriteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); + return writer; + }; + + /** + * Encodes the specified CancelResumableWriteRequest message, length delimited. Does not implicitly {@link google.storage.v2.CancelResumableWriteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {google.storage.v2.ICancelResumableWriteRequest} message CancelResumableWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelResumableWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelResumableWriteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.CancelResumableWriteRequest} CancelResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelResumableWriteRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.CancelResumableWriteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uploadId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelResumableWriteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.CancelResumableWriteRequest} CancelResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelResumableWriteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelResumableWriteRequest message. + * @function verify + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelResumableWriteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) + if (!$util.isString(message.uploadId)) + return "uploadId: string expected"; + return null; + }; + + /** + * Creates a CancelResumableWriteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.CancelResumableWriteRequest} CancelResumableWriteRequest + */ + CancelResumableWriteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.CancelResumableWriteRequest) + return object; + var message = new $root.google.storage.v2.CancelResumableWriteRequest(); + if (object.uploadId != null) + message.uploadId = String(object.uploadId); + return message; + }; + + /** + * Creates a plain object from a CancelResumableWriteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {google.storage.v2.CancelResumableWriteRequest} message CancelResumableWriteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelResumableWriteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uploadId = ""; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) + object.uploadId = message.uploadId; + return object; + }; + + /** + * Converts this CancelResumableWriteRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.CancelResumableWriteRequest + * @instance + * @returns {Object.} JSON object + */ + CancelResumableWriteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelResumableWriteRequest + * @function getTypeUrl + * @memberof google.storage.v2.CancelResumableWriteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelResumableWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.CancelResumableWriteRequest"; + }; + + return CancelResumableWriteRequest; + })(); + + v2.CancelResumableWriteResponse = (function() { + + /** + * Properties of a CancelResumableWriteResponse. + * @memberof google.storage.v2 + * @interface ICancelResumableWriteResponse + */ + + /** + * Constructs a new CancelResumableWriteResponse. + * @memberof google.storage.v2 + * @classdesc Represents a CancelResumableWriteResponse. + * @implements ICancelResumableWriteResponse + * @constructor + * @param {google.storage.v2.ICancelResumableWriteResponse=} [properties] Properties to set + */ + function CancelResumableWriteResponse(properties) { + if (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 CancelResumableWriteResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {google.storage.v2.ICancelResumableWriteResponse=} [properties] Properties to set + * @returns {google.storage.v2.CancelResumableWriteResponse} CancelResumableWriteResponse instance + */ + CancelResumableWriteResponse.create = function create(properties) { + return new CancelResumableWriteResponse(properties); + }; + + /** + * Encodes the specified CancelResumableWriteResponse message. Does not implicitly {@link google.storage.v2.CancelResumableWriteResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {google.storage.v2.ICancelResumableWriteResponse} message CancelResumableWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelResumableWriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CancelResumableWriteResponse message, length delimited. Does not implicitly {@link google.storage.v2.CancelResumableWriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {google.storage.v2.ICancelResumableWriteResponse} message CancelResumableWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelResumableWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelResumableWriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.CancelResumableWriteResponse} CancelResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelResumableWriteResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.CancelResumableWriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelResumableWriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.CancelResumableWriteResponse} CancelResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelResumableWriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelResumableWriteResponse message. + * @function verify + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelResumableWriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CancelResumableWriteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.CancelResumableWriteResponse} CancelResumableWriteResponse + */ + CancelResumableWriteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.CancelResumableWriteResponse) + return object; + return new $root.google.storage.v2.CancelResumableWriteResponse(); + }; + + /** + * Creates a plain object from a CancelResumableWriteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {google.storage.v2.CancelResumableWriteResponse} message CancelResumableWriteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelResumableWriteResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CancelResumableWriteResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.CancelResumableWriteResponse + * @instance + * @returns {Object.} JSON object + */ + CancelResumableWriteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelResumableWriteResponse + * @function getTypeUrl + * @memberof google.storage.v2.CancelResumableWriteResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelResumableWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.CancelResumableWriteResponse"; + }; + + return CancelResumableWriteResponse; + })(); + + v2.ReadObjectRequest = (function() { + + /** + * Properties of a ReadObjectRequest. + * @memberof google.storage.v2 + * @interface IReadObjectRequest + * @property {string|null} [bucket] ReadObjectRequest bucket + * @property {string|null} [object] ReadObjectRequest object + * @property {number|Long|null} [generation] ReadObjectRequest generation + * @property {number|Long|null} [readOffset] ReadObjectRequest readOffset + * @property {number|Long|null} [readLimit] ReadObjectRequest readLimit + * @property {number|Long|null} [ifGenerationMatch] ReadObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] ReadObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] ReadObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] ReadObjectRequest ifMetagenerationNotMatch + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] ReadObjectRequest commonObjectRequestParams + * @property {google.protobuf.IFieldMask|null} [readMask] ReadObjectRequest readMask + */ + + /** + * Constructs a new ReadObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a ReadObjectRequest. + * @implements IReadObjectRequest + * @constructor + * @param {google.storage.v2.IReadObjectRequest=} [properties] Properties to set + */ + function ReadObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadObjectRequest bucket. + * @member {string} bucket + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.bucket = ""; + + /** + * ReadObjectRequest object. + * @member {string} object + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.object = ""; + + /** + * ReadObjectRequest generation. + * @member {number|Long} generation + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadObjectRequest readOffset. + * @member {number|Long} readOffset + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.readOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadObjectRequest readLimit. + * @member {number|Long} readLimit + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.readLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.ifGenerationMatch = null; + + /** + * ReadObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * ReadObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * ReadObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * ReadObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.commonObjectRequestParams = null; + + /** + * ReadObjectRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.storage.v2.ReadObjectRequest + * @instance + */ + ReadObjectRequest.prototype.readMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ReadObjectRequest.prototype, "_readMask", { + get: $util.oneOfGetter($oneOfFields = ["readMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {google.storage.v2.IReadObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.ReadObjectRequest} ReadObjectRequest instance + */ + ReadObjectRequest.create = function create(properties) { + return new ReadObjectRequest(properties); + }; + + /** + * Encodes the specified ReadObjectRequest message. Does not implicitly {@link google.storage.v2.ReadObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {google.storage.v2.IReadObjectRequest} message ReadObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.readOffset != null && Object.hasOwnProperty.call(message, "readOffset")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.readOffset); + if (message.readLimit != null && Object.hasOwnProperty.call(message, "readLimit")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.readLimit); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.ifMetagenerationNotMatch); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.ReadObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {google.storage.v2.IReadObjectRequest} message ReadObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ReadObjectRequest} ReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ReadObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + message.readOffset = reader.int64(); + break; + } + case 5: { + message.readLimit = reader.int64(); + break; + } + case 6: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 7: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 8: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 9: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 10: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 12: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ReadObjectRequest} ReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadObjectRequest message. + * @function verify + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.readOffset != null && message.hasOwnProperty("readOffset")) + if (!$util.isInteger(message.readOffset) && !(message.readOffset && $util.isInteger(message.readOffset.low) && $util.isInteger(message.readOffset.high))) + return "readOffset: integer|Long expected"; + if (message.readLimit != null && message.hasOwnProperty("readLimit")) + if (!$util.isInteger(message.readLimit) && !(message.readLimit && $util.isInteger(message.readLimit.low) && $util.isInteger(message.readLimit.high))) + return "readLimit: integer|Long expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.readMask != null && message.hasOwnProperty("readMask")) { + properties._readMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + } + return null; + }; + + /** + * Creates a ReadObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ReadObjectRequest} ReadObjectRequest + */ + ReadObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ReadObjectRequest) + return object; + var message = new $root.google.storage.v2.ReadObjectRequest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.readOffset != null) + if ($util.Long) + (message.readOffset = $util.Long.fromValue(object.readOffset)).unsigned = false; + else if (typeof object.readOffset === "string") + message.readOffset = parseInt(object.readOffset, 10); + else if (typeof object.readOffset === "number") + message.readOffset = object.readOffset; + else if (typeof object.readOffset === "object") + message.readOffset = new $util.LongBits(object.readOffset.low >>> 0, object.readOffset.high >>> 0).toNumber(); + if (object.readLimit != null) + if ($util.Long) + (message.readLimit = $util.Long.fromValue(object.readLimit)).unsigned = false; + else if (typeof object.readLimit === "string") + message.readLimit = parseInt(object.readLimit, 10); + else if (typeof object.readLimit === "number") + message.readLimit = object.readLimit; + else if (typeof object.readLimit === "object") + message.readLimit = new $util.LongBits(object.readLimit.low >>> 0, object.readLimit.high >>> 0).toNumber(); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.ReadObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.storage.v2.ReadObjectRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + return message; + }; + + /** + * Creates a plain object from a ReadObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {google.storage.v2.ReadObjectRequest} message ReadObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.readOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.readLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readLimit = options.longs === String ? "0" : 0; + object.commonObjectRequestParams = null; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.readOffset != null && message.hasOwnProperty("readOffset")) + if (typeof message.readOffset === "number") + object.readOffset = options.longs === String ? String(message.readOffset) : message.readOffset; + else + object.readOffset = options.longs === String ? $util.Long.prototype.toString.call(message.readOffset) : options.longs === Number ? new $util.LongBits(message.readOffset.low >>> 0, message.readOffset.high >>> 0).toNumber() : message.readOffset; + if (message.readLimit != null && message.hasOwnProperty("readLimit")) + if (typeof message.readLimit === "number") + object.readLimit = options.longs === String ? String(message.readLimit) : message.readLimit; + else + object.readLimit = options.longs === String ? $util.Long.prototype.toString.call(message.readLimit) : options.longs === Number ? new $util.LongBits(message.readLimit.low >>> 0, message.readLimit.high >>> 0).toNumber() : message.readLimit; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.oneofs) + object._readMask = "readMask"; + } + return object; + }; + + /** + * Converts this ReadObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.ReadObjectRequest + * @instance + * @returns {Object.} JSON object + */ + ReadObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.ReadObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ReadObjectRequest"; + }; + + return ReadObjectRequest; + })(); + + v2.GetObjectRequest = (function() { + + /** + * Properties of a GetObjectRequest. + * @memberof google.storage.v2 + * @interface IGetObjectRequest + * @property {string|null} [bucket] GetObjectRequest bucket + * @property {string|null} [object] GetObjectRequest object + * @property {number|Long|null} [generation] GetObjectRequest generation + * @property {boolean|null} [softDeleted] GetObjectRequest softDeleted + * @property {number|Long|null} [ifGenerationMatch] GetObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] GetObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] GetObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] GetObjectRequest ifMetagenerationNotMatch + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] GetObjectRequest commonObjectRequestParams + * @property {google.protobuf.IFieldMask|null} [readMask] GetObjectRequest readMask + * @property {string|null} [restoreToken] GetObjectRequest restoreToken + */ + + /** + * Constructs a new GetObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a GetObjectRequest. + * @implements IGetObjectRequest + * @constructor + * @param {google.storage.v2.IGetObjectRequest=} [properties] Properties to set + */ + function GetObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetObjectRequest bucket. + * @member {string} bucket + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.bucket = ""; + + /** + * GetObjectRequest object. + * @member {string} object + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.object = ""; + + /** + * GetObjectRequest generation. + * @member {number|Long} generation + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GetObjectRequest softDeleted. + * @member {boolean|null|undefined} softDeleted + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.softDeleted = null; + + /** + * GetObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.ifGenerationMatch = null; + + /** + * GetObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * GetObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * GetObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * GetObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.commonObjectRequestParams = null; + + /** + * GetObjectRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.readMask = null; + + /** + * GetObjectRequest restoreToken. + * @member {string} restoreToken + * @memberof google.storage.v2.GetObjectRequest + * @instance + */ + GetObjectRequest.prototype.restoreToken = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetObjectRequest.prototype, "_softDeleted", { + get: $util.oneOfGetter($oneOfFields = ["softDeleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetObjectRequest.prototype, "_readMask", { + get: $util.oneOfGetter($oneOfFields = ["readMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {google.storage.v2.IGetObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.GetObjectRequest} GetObjectRequest instance + */ + GetObjectRequest.create = function create(properties) { + return new GetObjectRequest(properties); + }; + + /** + * Encodes the specified GetObjectRequest message. Does not implicitly {@link google.storage.v2.GetObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {google.storage.v2.IGetObjectRequest} message GetObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifMetagenerationNotMatch); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.softDeleted != null && Object.hasOwnProperty.call(message, "softDeleted")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.softDeleted); + if (message.restoreToken != null && Object.hasOwnProperty.call(message, "restoreToken")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.restoreToken); + return writer; + }; + + /** + * Encodes the specified GetObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.GetObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {google.storage.v2.IGetObjectRequest} message GetObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.GetObjectRequest} GetObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.GetObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 11: { + message.softDeleted = reader.bool(); + break; + } + case 4: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 6: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 7: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 8: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 10: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 12: { + message.restoreToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.GetObjectRequest} GetObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetObjectRequest message. + * @function verify + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) { + properties._softDeleted = 1; + if (typeof message.softDeleted !== "boolean") + return "softDeleted: boolean expected"; + } + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.readMask != null && message.hasOwnProperty("readMask")) { + properties._readMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + } + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) + if (!$util.isString(message.restoreToken)) + return "restoreToken: string expected"; + return null; + }; + + /** + * Creates a GetObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.GetObjectRequest} GetObjectRequest + */ + GetObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.GetObjectRequest) + return object; + var message = new $root.google.storage.v2.GetObjectRequest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.softDeleted != null) + message.softDeleted = Boolean(object.softDeleted); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.GetObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.storage.v2.GetObjectRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.restoreToken != null) + message.restoreToken = String(object.restoreToken); + return message; + }; + + /** + * Creates a plain object from a GetObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {google.storage.v2.GetObjectRequest} message GetObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.commonObjectRequestParams = null; + object.restoreToken = ""; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.oneofs) + object._readMask = "readMask"; + } + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) { + object.softDeleted = message.softDeleted; + if (options.oneofs) + object._softDeleted = "softDeleted"; + } + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) + object.restoreToken = message.restoreToken; + return object; + }; + + /** + * Converts this GetObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.GetObjectRequest + * @instance + * @returns {Object.} JSON object + */ + GetObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.GetObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.GetObjectRequest"; + }; + + return GetObjectRequest; + })(); + + v2.ReadObjectResponse = (function() { + + /** + * Properties of a ReadObjectResponse. + * @memberof google.storage.v2 + * @interface IReadObjectResponse + * @property {google.storage.v2.IChecksummedData|null} [checksummedData] ReadObjectResponse checksummedData + * @property {google.storage.v2.IObjectChecksums|null} [objectChecksums] ReadObjectResponse objectChecksums + * @property {google.storage.v2.IContentRange|null} [contentRange] ReadObjectResponse contentRange + * @property {google.storage.v2.IObject|null} [metadata] ReadObjectResponse metadata + */ + + /** + * Constructs a new ReadObjectResponse. + * @memberof google.storage.v2 + * @classdesc Represents a ReadObjectResponse. + * @implements IReadObjectResponse + * @constructor + * @param {google.storage.v2.IReadObjectResponse=} [properties] Properties to set + */ + function ReadObjectResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadObjectResponse checksummedData. + * @member {google.storage.v2.IChecksummedData|null|undefined} checksummedData + * @memberof google.storage.v2.ReadObjectResponse + * @instance + */ + ReadObjectResponse.prototype.checksummedData = null; + + /** + * ReadObjectResponse objectChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} objectChecksums + * @memberof google.storage.v2.ReadObjectResponse + * @instance + */ + ReadObjectResponse.prototype.objectChecksums = null; + + /** + * ReadObjectResponse contentRange. + * @member {google.storage.v2.IContentRange|null|undefined} contentRange + * @memberof google.storage.v2.ReadObjectResponse + * @instance + */ + ReadObjectResponse.prototype.contentRange = null; + + /** + * ReadObjectResponse metadata. + * @member {google.storage.v2.IObject|null|undefined} metadata + * @memberof google.storage.v2.ReadObjectResponse + * @instance + */ + ReadObjectResponse.prototype.metadata = null; + + /** + * Creates a new ReadObjectResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {google.storage.v2.IReadObjectResponse=} [properties] Properties to set + * @returns {google.storage.v2.ReadObjectResponse} ReadObjectResponse instance + */ + ReadObjectResponse.create = function create(properties) { + return new ReadObjectResponse(properties); + }; + + /** + * Encodes the specified ReadObjectResponse message. Does not implicitly {@link google.storage.v2.ReadObjectResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {google.storage.v2.IReadObjectResponse} message ReadObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadObjectResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) + $root.google.storage.v2.ChecksummedData.encode(message.checksummedData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contentRange != null && Object.hasOwnProperty.call(message, "contentRange")) + $root.google.storage.v2.ContentRange.encode(message.contentRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.storage.v2.Object.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.ReadObjectResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {google.storage.v2.IReadObjectResponse} message ReadObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadObjectResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ReadObjectResponse} ReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadObjectResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ReadObjectResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.checksummedData = $root.google.storage.v2.ChecksummedData.decode(reader, reader.uint32()); + break; + } + case 2: { + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + case 3: { + message.contentRange = $root.google.storage.v2.ContentRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.metadata = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadObjectResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ReadObjectResponse} ReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadObjectResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadObjectResponse message. + * @function verify + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadObjectResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { + var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData); + if (error) + return "checksummedData." + error; + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums); + if (error) + return "objectChecksums." + error; + } + if (message.contentRange != null && message.hasOwnProperty("contentRange")) { + var error = $root.google.storage.v2.ContentRange.verify(message.contentRange); + if (error) + return "contentRange." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.storage.v2.Object.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ReadObjectResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ReadObjectResponse} ReadObjectResponse + */ + ReadObjectResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ReadObjectResponse) + return object; + var message = new $root.google.storage.v2.ReadObjectResponse(); + if (object.checksummedData != null) { + if (typeof object.checksummedData !== "object") + throw TypeError(".google.storage.v2.ReadObjectResponse.checksummedData: object expected"); + message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData); + } + if (object.objectChecksums != null) { + if (typeof object.objectChecksums !== "object") + throw TypeError(".google.storage.v2.ReadObjectResponse.objectChecksums: object expected"); + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums); + } + if (object.contentRange != null) { + if (typeof object.contentRange !== "object") + throw TypeError(".google.storage.v2.ReadObjectResponse.contentRange: object expected"); + message.contentRange = $root.google.storage.v2.ContentRange.fromObject(object.contentRange); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.storage.v2.ReadObjectResponse.metadata: object expected"); + message.metadata = $root.google.storage.v2.Object.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ReadObjectResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {google.storage.v2.ReadObjectResponse} message ReadObjectResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadObjectResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.checksummedData = null; + object.objectChecksums = null; + object.contentRange = null; + object.metadata = null; + } + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) + object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options); + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); + if (message.contentRange != null && message.hasOwnProperty("contentRange")) + object.contentRange = $root.google.storage.v2.ContentRange.toObject(message.contentRange, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.storage.v2.Object.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ReadObjectResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.ReadObjectResponse + * @instance + * @returns {Object.} JSON object + */ + ReadObjectResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadObjectResponse + * @function getTypeUrl + * @memberof google.storage.v2.ReadObjectResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadObjectResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ReadObjectResponse"; + }; + + return ReadObjectResponse; + })(); + + v2.BidiReadObjectSpec = (function() { + + /** + * Properties of a BidiReadObjectSpec. + * @memberof google.storage.v2 + * @interface IBidiReadObjectSpec + * @property {string|null} [bucket] BidiReadObjectSpec bucket + * @property {string|null} [object] BidiReadObjectSpec object + * @property {number|Long|null} [generation] BidiReadObjectSpec generation + * @property {number|Long|null} [ifGenerationMatch] BidiReadObjectSpec ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] BidiReadObjectSpec ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] BidiReadObjectSpec ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] BidiReadObjectSpec ifMetagenerationNotMatch + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] BidiReadObjectSpec commonObjectRequestParams + * @property {google.protobuf.IFieldMask|null} [readMask] BidiReadObjectSpec readMask + * @property {google.storage.v2.IBidiReadHandle|null} [readHandle] BidiReadObjectSpec readHandle + * @property {string|null} [routingToken] BidiReadObjectSpec routingToken + */ + + /** + * Constructs a new BidiReadObjectSpec. + * @memberof google.storage.v2 + * @classdesc Represents a BidiReadObjectSpec. + * @implements IBidiReadObjectSpec + * @constructor + * @param {google.storage.v2.IBidiReadObjectSpec=} [properties] Properties to set + */ + function BidiReadObjectSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiReadObjectSpec bucket. + * @member {string} bucket + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.bucket = ""; + + /** + * BidiReadObjectSpec object. + * @member {string} object + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.object = ""; + + /** + * BidiReadObjectSpec generation. + * @member {number|Long} generation + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BidiReadObjectSpec ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.ifGenerationMatch = null; + + /** + * BidiReadObjectSpec ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.ifGenerationNotMatch = null; + + /** + * BidiReadObjectSpec ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.ifMetagenerationMatch = null; + + /** + * BidiReadObjectSpec ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.ifMetagenerationNotMatch = null; + + /** + * BidiReadObjectSpec commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.commonObjectRequestParams = null; + + /** + * BidiReadObjectSpec readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.readMask = null; + + /** + * BidiReadObjectSpec readHandle. + * @member {google.storage.v2.IBidiReadHandle|null|undefined} readHandle + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.readHandle = null; + + /** + * BidiReadObjectSpec routingToken. + * @member {string|null|undefined} routingToken + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + */ + BidiReadObjectSpec.prototype.routingToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_readMask", { + get: $util.oneOfGetter($oneOfFields = ["readMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_readHandle", { + get: $util.oneOfGetter($oneOfFields = ["readHandle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectSpec.prototype, "_routingToken", { + get: $util.oneOfGetter($oneOfFields = ["routingToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiReadObjectSpec instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {google.storage.v2.IBidiReadObjectSpec=} [properties] Properties to set + * @returns {google.storage.v2.BidiReadObjectSpec} BidiReadObjectSpec instance + */ + BidiReadObjectSpec.create = function create(properties) { + return new BidiReadObjectSpec(properties); + }; + + /** + * Encodes the specified BidiReadObjectSpec message. Does not implicitly {@link google.storage.v2.BidiReadObjectSpec.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {google.storage.v2.IBidiReadObjectSpec} message BidiReadObjectSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifMetagenerationNotMatch); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) + $root.google.storage.v2.BidiReadHandle.encode(message.readHandle, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.routingToken); + return writer; + }; + + /** + * Encodes the specified BidiReadObjectSpec message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {google.storage.v2.IBidiReadObjectSpec} message BidiReadObjectSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiReadObjectSpec message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiReadObjectSpec} BidiReadObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiReadObjectSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 6: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 7: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 8: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 12: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 13: { + message.readHandle = $root.google.storage.v2.BidiReadHandle.decode(reader, reader.uint32()); + break; + } + case 14: { + message.routingToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiReadObjectSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiReadObjectSpec} BidiReadObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiReadObjectSpec message. + * @function verify + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiReadObjectSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.readMask != null && message.hasOwnProperty("readMask")) { + properties._readMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + } + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { + properties._readHandle = 1; + { + var error = $root.google.storage.v2.BidiReadHandle.verify(message.readHandle); + if (error) + return "readHandle." + error; + } + } + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + properties._routingToken = 1; + if (!$util.isString(message.routingToken)) + return "routingToken: string expected"; + } + return null; + }; + + /** + * Creates a BidiReadObjectSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiReadObjectSpec} BidiReadObjectSpec + */ + BidiReadObjectSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiReadObjectSpec) + return object; + var message = new $root.google.storage.v2.BidiReadObjectSpec(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectSpec.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectSpec.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.readHandle != null) { + if (typeof object.readHandle !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectSpec.readHandle: object expected"); + message.readHandle = $root.google.storage.v2.BidiReadHandle.fromObject(object.readHandle); + } + if (object.routingToken != null) + message.routingToken = String(object.routingToken); + return message; + }; + + /** + * Creates a plain object from a BidiReadObjectSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {google.storage.v2.BidiReadObjectSpec} message BidiReadObjectSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiReadObjectSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.commonObjectRequestParams = null; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.oneofs) + object._readMask = "readMask"; + } + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { + object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options); + if (options.oneofs) + object._readHandle = "readHandle"; + } + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + object.routingToken = message.routingToken; + if (options.oneofs) + object._routingToken = "routingToken"; + } + return object; + }; + + /** + * Converts this BidiReadObjectSpec to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiReadObjectSpec + * @instance + * @returns {Object.} JSON object + */ + BidiReadObjectSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiReadObjectSpec + * @function getTypeUrl + * @memberof google.storage.v2.BidiReadObjectSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiReadObjectSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiReadObjectSpec"; + }; + + return BidiReadObjectSpec; + })(); + + v2.BidiReadObjectRequest = (function() { + + /** + * Properties of a BidiReadObjectRequest. + * @memberof google.storage.v2 + * @interface IBidiReadObjectRequest + * @property {google.storage.v2.IBidiReadObjectSpec|null} [readObjectSpec] BidiReadObjectRequest readObjectSpec + * @property {Array.|null} [readRanges] BidiReadObjectRequest readRanges + */ + + /** + * Constructs a new BidiReadObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a BidiReadObjectRequest. + * @implements IBidiReadObjectRequest + * @constructor + * @param {google.storage.v2.IBidiReadObjectRequest=} [properties] Properties to set + */ + function BidiReadObjectRequest(properties) { + this.readRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiReadObjectRequest readObjectSpec. + * @member {google.storage.v2.IBidiReadObjectSpec|null|undefined} readObjectSpec + * @memberof google.storage.v2.BidiReadObjectRequest + * @instance + */ + BidiReadObjectRequest.prototype.readObjectSpec = null; + + /** + * BidiReadObjectRequest readRanges. + * @member {Array.} readRanges + * @memberof google.storage.v2.BidiReadObjectRequest + * @instance + */ + BidiReadObjectRequest.prototype.readRanges = $util.emptyArray; + + /** + * Creates a new BidiReadObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {google.storage.v2.IBidiReadObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.BidiReadObjectRequest} BidiReadObjectRequest instance + */ + BidiReadObjectRequest.create = function create(properties) { + return new BidiReadObjectRequest(properties); + }; + + /** + * Encodes the specified BidiReadObjectRequest message. Does not implicitly {@link google.storage.v2.BidiReadObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {google.storage.v2.IBidiReadObjectRequest} message BidiReadObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readObjectSpec != null && Object.hasOwnProperty.call(message, "readObjectSpec")) + $root.google.storage.v2.BidiReadObjectSpec.encode(message.readObjectSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readRanges != null && message.readRanges.length) + for (var i = 0; i < message.readRanges.length; ++i) + $root.google.storage.v2.ReadRange.encode(message.readRanges[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiReadObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {google.storage.v2.IBidiReadObjectRequest} message BidiReadObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiReadObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiReadObjectRequest} BidiReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiReadObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readObjectSpec = $root.google.storage.v2.BidiReadObjectSpec.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.readRanges && message.readRanges.length)) + message.readRanges = []; + message.readRanges.push($root.google.storage.v2.ReadRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiReadObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiReadObjectRequest} BidiReadObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiReadObjectRequest message. + * @function verify + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiReadObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readObjectSpec != null && message.hasOwnProperty("readObjectSpec")) { + var error = $root.google.storage.v2.BidiReadObjectSpec.verify(message.readObjectSpec); + if (error) + return "readObjectSpec." + error; + } + if (message.readRanges != null && message.hasOwnProperty("readRanges")) { + if (!Array.isArray(message.readRanges)) + return "readRanges: array expected"; + for (var i = 0; i < message.readRanges.length; ++i) { + var error = $root.google.storage.v2.ReadRange.verify(message.readRanges[i]); + if (error) + return "readRanges." + error; + } + } + return null; + }; + + /** + * Creates a BidiReadObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiReadObjectRequest} BidiReadObjectRequest + */ + BidiReadObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiReadObjectRequest) + return object; + var message = new $root.google.storage.v2.BidiReadObjectRequest(); + if (object.readObjectSpec != null) { + if (typeof object.readObjectSpec !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectRequest.readObjectSpec: object expected"); + message.readObjectSpec = $root.google.storage.v2.BidiReadObjectSpec.fromObject(object.readObjectSpec); + } + if (object.readRanges) { + if (!Array.isArray(object.readRanges)) + throw TypeError(".google.storage.v2.BidiReadObjectRequest.readRanges: array expected"); + message.readRanges = []; + for (var i = 0; i < object.readRanges.length; ++i) { + if (typeof object.readRanges[i] !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectRequest.readRanges: object expected"); + message.readRanges[i] = $root.google.storage.v2.ReadRange.fromObject(object.readRanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BidiReadObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {google.storage.v2.BidiReadObjectRequest} message BidiReadObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiReadObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.readRanges = []; + if (options.defaults) + object.readObjectSpec = null; + if (message.readObjectSpec != null && message.hasOwnProperty("readObjectSpec")) + object.readObjectSpec = $root.google.storage.v2.BidiReadObjectSpec.toObject(message.readObjectSpec, options); + if (message.readRanges && message.readRanges.length) { + object.readRanges = []; + for (var j = 0; j < message.readRanges.length; ++j) + object.readRanges[j] = $root.google.storage.v2.ReadRange.toObject(message.readRanges[j], options); + } + return object; + }; + + /** + * Converts this BidiReadObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiReadObjectRequest + * @instance + * @returns {Object.} JSON object + */ + BidiReadObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiReadObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.BidiReadObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiReadObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiReadObjectRequest"; + }; + + return BidiReadObjectRequest; + })(); + + v2.BidiReadObjectResponse = (function() { + + /** + * Properties of a BidiReadObjectResponse. + * @memberof google.storage.v2 + * @interface IBidiReadObjectResponse + * @property {Array.|null} [objectDataRanges] BidiReadObjectResponse objectDataRanges + * @property {google.storage.v2.IObject|null} [metadata] BidiReadObjectResponse metadata + * @property {google.storage.v2.IBidiReadHandle|null} [readHandle] BidiReadObjectResponse readHandle + */ + + /** + * Constructs a new BidiReadObjectResponse. + * @memberof google.storage.v2 + * @classdesc Represents a BidiReadObjectResponse. + * @implements IBidiReadObjectResponse + * @constructor + * @param {google.storage.v2.IBidiReadObjectResponse=} [properties] Properties to set + */ + function BidiReadObjectResponse(properties) { + this.objectDataRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiReadObjectResponse objectDataRanges. + * @member {Array.} objectDataRanges + * @memberof google.storage.v2.BidiReadObjectResponse + * @instance + */ + BidiReadObjectResponse.prototype.objectDataRanges = $util.emptyArray; + + /** + * BidiReadObjectResponse metadata. + * @member {google.storage.v2.IObject|null|undefined} metadata + * @memberof google.storage.v2.BidiReadObjectResponse + * @instance + */ + BidiReadObjectResponse.prototype.metadata = null; + + /** + * BidiReadObjectResponse readHandle. + * @member {google.storage.v2.IBidiReadHandle|null|undefined} readHandle + * @memberof google.storage.v2.BidiReadObjectResponse + * @instance + */ + BidiReadObjectResponse.prototype.readHandle = null; + + /** + * Creates a new BidiReadObjectResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {google.storage.v2.IBidiReadObjectResponse=} [properties] Properties to set + * @returns {google.storage.v2.BidiReadObjectResponse} BidiReadObjectResponse instance + */ + BidiReadObjectResponse.create = function create(properties) { + return new BidiReadObjectResponse(properties); + }; + + /** + * Encodes the specified BidiReadObjectResponse message. Does not implicitly {@link google.storage.v2.BidiReadObjectResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {google.storage.v2.IBidiReadObjectResponse} message BidiReadObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.storage.v2.Object.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectDataRanges != null && message.objectDataRanges.length) + for (var i = 0; i < message.objectDataRanges.length; ++i) + $root.google.storage.v2.ObjectRangeData.encode(message.objectDataRanges[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) + $root.google.storage.v2.BidiReadHandle.encode(message.readHandle, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiReadObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {google.storage.v2.IBidiReadObjectResponse} message BidiReadObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiReadObjectResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiReadObjectResponse} BidiReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiReadObjectResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + if (!(message.objectDataRanges && message.objectDataRanges.length)) + message.objectDataRanges = []; + message.objectDataRanges.push($root.google.storage.v2.ObjectRangeData.decode(reader, reader.uint32())); + break; + } + case 4: { + message.metadata = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 7: { + message.readHandle = $root.google.storage.v2.BidiReadHandle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiReadObjectResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiReadObjectResponse} BidiReadObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiReadObjectResponse message. + * @function verify + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiReadObjectResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectDataRanges != null && message.hasOwnProperty("objectDataRanges")) { + if (!Array.isArray(message.objectDataRanges)) + return "objectDataRanges: array expected"; + for (var i = 0; i < message.objectDataRanges.length; ++i) { + var error = $root.google.storage.v2.ObjectRangeData.verify(message.objectDataRanges[i]); + if (error) + return "objectDataRanges." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.storage.v2.Object.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { + var error = $root.google.storage.v2.BidiReadHandle.verify(message.readHandle); + if (error) + return "readHandle." + error; + } + return null; + }; + + /** + * Creates a BidiReadObjectResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiReadObjectResponse} BidiReadObjectResponse + */ + BidiReadObjectResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiReadObjectResponse) + return object; + var message = new $root.google.storage.v2.BidiReadObjectResponse(); + if (object.objectDataRanges) { + if (!Array.isArray(object.objectDataRanges)) + throw TypeError(".google.storage.v2.BidiReadObjectResponse.objectDataRanges: array expected"); + message.objectDataRanges = []; + for (var i = 0; i < object.objectDataRanges.length; ++i) { + if (typeof object.objectDataRanges[i] !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectResponse.objectDataRanges: object expected"); + message.objectDataRanges[i] = $root.google.storage.v2.ObjectRangeData.fromObject(object.objectDataRanges[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectResponse.metadata: object expected"); + message.metadata = $root.google.storage.v2.Object.fromObject(object.metadata); + } + if (object.readHandle != null) { + if (typeof object.readHandle !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectResponse.readHandle: object expected"); + message.readHandle = $root.google.storage.v2.BidiReadHandle.fromObject(object.readHandle); + } + return message; + }; + + /** + * Creates a plain object from a BidiReadObjectResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {google.storage.v2.BidiReadObjectResponse} message BidiReadObjectResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiReadObjectResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.objectDataRanges = []; + if (options.defaults) { + object.metadata = null; + object.readHandle = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.storage.v2.Object.toObject(message.metadata, options); + if (message.objectDataRanges && message.objectDataRanges.length) { + object.objectDataRanges = []; + for (var j = 0; j < message.objectDataRanges.length; ++j) + object.objectDataRanges[j] = $root.google.storage.v2.ObjectRangeData.toObject(message.objectDataRanges[j], options); + } + if (message.readHandle != null && message.hasOwnProperty("readHandle")) + object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options); + return object; + }; + + /** + * Converts this BidiReadObjectResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiReadObjectResponse + * @instance + * @returns {Object.} JSON object + */ + BidiReadObjectResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiReadObjectResponse + * @function getTypeUrl + * @memberof google.storage.v2.BidiReadObjectResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiReadObjectResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiReadObjectResponse"; + }; + + return BidiReadObjectResponse; + })(); + + v2.BidiReadObjectRedirectedError = (function() { + + /** + * Properties of a BidiReadObjectRedirectedError. + * @memberof google.storage.v2 + * @interface IBidiReadObjectRedirectedError + * @property {google.storage.v2.IBidiReadHandle|null} [readHandle] BidiReadObjectRedirectedError readHandle + * @property {string|null} [routingToken] BidiReadObjectRedirectedError routingToken + */ + + /** + * Constructs a new BidiReadObjectRedirectedError. + * @memberof google.storage.v2 + * @classdesc Represents a BidiReadObjectRedirectedError. + * @implements IBidiReadObjectRedirectedError + * @constructor + * @param {google.storage.v2.IBidiReadObjectRedirectedError=} [properties] Properties to set + */ + function BidiReadObjectRedirectedError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiReadObjectRedirectedError readHandle. + * @member {google.storage.v2.IBidiReadHandle|null|undefined} readHandle + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @instance + */ + BidiReadObjectRedirectedError.prototype.readHandle = null; + + /** + * BidiReadObjectRedirectedError routingToken. + * @member {string|null|undefined} routingToken + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @instance + */ + BidiReadObjectRedirectedError.prototype.routingToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiReadObjectRedirectedError.prototype, "_routingToken", { + get: $util.oneOfGetter($oneOfFields = ["routingToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiReadObjectRedirectedError instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {google.storage.v2.IBidiReadObjectRedirectedError=} [properties] Properties to set + * @returns {google.storage.v2.BidiReadObjectRedirectedError} BidiReadObjectRedirectedError instance + */ + BidiReadObjectRedirectedError.create = function create(properties) { + return new BidiReadObjectRedirectedError(properties); + }; + + /** + * Encodes the specified BidiReadObjectRedirectedError message. Does not implicitly {@link google.storage.v2.BidiReadObjectRedirectedError.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {google.storage.v2.IBidiReadObjectRedirectedError} message BidiReadObjectRedirectedError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectRedirectedError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) + $root.google.storage.v2.BidiReadHandle.encode(message.readHandle, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.routingToken); + return writer; + }; + + /** + * Encodes the specified BidiReadObjectRedirectedError message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectRedirectedError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {google.storage.v2.IBidiReadObjectRedirectedError} message BidiReadObjectRedirectedError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectRedirectedError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiReadObjectRedirectedError message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiReadObjectRedirectedError} BidiReadObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectRedirectedError.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiReadObjectRedirectedError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readHandle = $root.google.storage.v2.BidiReadHandle.decode(reader, reader.uint32()); + break; + } + case 2: { + message.routingToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiReadObjectRedirectedError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiReadObjectRedirectedError} BidiReadObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectRedirectedError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiReadObjectRedirectedError message. + * @function verify + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiReadObjectRedirectedError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { + var error = $root.google.storage.v2.BidiReadHandle.verify(message.readHandle); + if (error) + return "readHandle." + error; + } + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + properties._routingToken = 1; + if (!$util.isString(message.routingToken)) + return "routingToken: string expected"; + } + return null; + }; + + /** + * Creates a BidiReadObjectRedirectedError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiReadObjectRedirectedError} BidiReadObjectRedirectedError + */ + BidiReadObjectRedirectedError.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiReadObjectRedirectedError) + return object; + var message = new $root.google.storage.v2.BidiReadObjectRedirectedError(); + if (object.readHandle != null) { + if (typeof object.readHandle !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectRedirectedError.readHandle: object expected"); + message.readHandle = $root.google.storage.v2.BidiReadHandle.fromObject(object.readHandle); + } + if (object.routingToken != null) + message.routingToken = String(object.routingToken); + return message; + }; + + /** + * Creates a plain object from a BidiReadObjectRedirectedError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {google.storage.v2.BidiReadObjectRedirectedError} message BidiReadObjectRedirectedError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiReadObjectRedirectedError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.readHandle = null; + if (message.readHandle != null && message.hasOwnProperty("readHandle")) + object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options); + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + object.routingToken = message.routingToken; + if (options.oneofs) + object._routingToken = "routingToken"; + } + return object; + }; + + /** + * Converts this BidiReadObjectRedirectedError to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @instance + * @returns {Object.} JSON object + */ + BidiReadObjectRedirectedError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiReadObjectRedirectedError + * @function getTypeUrl + * @memberof google.storage.v2.BidiReadObjectRedirectedError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiReadObjectRedirectedError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiReadObjectRedirectedError"; + }; + + return BidiReadObjectRedirectedError; + })(); + + v2.BidiWriteObjectRedirectedError = (function() { + + /** + * Properties of a BidiWriteObjectRedirectedError. + * @memberof google.storage.v2 + * @interface IBidiWriteObjectRedirectedError + * @property {string|null} [routingToken] BidiWriteObjectRedirectedError routingToken + * @property {google.storage.v2.IBidiWriteHandle|null} [writeHandle] BidiWriteObjectRedirectedError writeHandle + * @property {number|Long|null} [generation] BidiWriteObjectRedirectedError generation + */ + + /** + * Constructs a new BidiWriteObjectRedirectedError. + * @memberof google.storage.v2 + * @classdesc Represents a BidiWriteObjectRedirectedError. + * @implements IBidiWriteObjectRedirectedError + * @constructor + * @param {google.storage.v2.IBidiWriteObjectRedirectedError=} [properties] Properties to set + */ + function BidiWriteObjectRedirectedError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiWriteObjectRedirectedError routingToken. + * @member {string|null|undefined} routingToken + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @instance + */ + BidiWriteObjectRedirectedError.prototype.routingToken = null; + + /** + * BidiWriteObjectRedirectedError writeHandle. + * @member {google.storage.v2.IBidiWriteHandle|null|undefined} writeHandle + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @instance + */ + BidiWriteObjectRedirectedError.prototype.writeHandle = null; + + /** + * BidiWriteObjectRedirectedError generation. + * @member {number|Long|null|undefined} generation + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @instance + */ + BidiWriteObjectRedirectedError.prototype.generation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiWriteObjectRedirectedError.prototype, "_routingToken", { + get: $util.oneOfGetter($oneOfFields = ["routingToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiWriteObjectRedirectedError.prototype, "_writeHandle", { + get: $util.oneOfGetter($oneOfFields = ["writeHandle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiWriteObjectRedirectedError.prototype, "_generation", { + get: $util.oneOfGetter($oneOfFields = ["generation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiWriteObjectRedirectedError instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {google.storage.v2.IBidiWriteObjectRedirectedError=} [properties] Properties to set + * @returns {google.storage.v2.BidiWriteObjectRedirectedError} BidiWriteObjectRedirectedError instance + */ + BidiWriteObjectRedirectedError.create = function create(properties) { + return new BidiWriteObjectRedirectedError(properties); + }; + + /** + * Encodes the specified BidiWriteObjectRedirectedError message. Does not implicitly {@link google.storage.v2.BidiWriteObjectRedirectedError.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {google.storage.v2.IBidiWriteObjectRedirectedError} message BidiWriteObjectRedirectedError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteObjectRedirectedError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.routingToken); + if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) + $root.google.storage.v2.BidiWriteHandle.encode(message.writeHandle, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified BidiWriteObjectRedirectedError message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteObjectRedirectedError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {google.storage.v2.IBidiWriteObjectRedirectedError} message BidiWriteObjectRedirectedError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteObjectRedirectedError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiWriteObjectRedirectedError message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiWriteObjectRedirectedError} BidiWriteObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteObjectRedirectedError.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiWriteObjectRedirectedError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.routingToken = reader.string(); + break; + } + case 2: { + message.writeHandle = $root.google.storage.v2.BidiWriteHandle.decode(reader, reader.uint32()); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiWriteObjectRedirectedError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiWriteObjectRedirectedError} BidiWriteObjectRedirectedError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteObjectRedirectedError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiWriteObjectRedirectedError message. + * @function verify + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiWriteObjectRedirectedError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + properties._routingToken = 1; + if (!$util.isString(message.routingToken)) + return "routingToken: string expected"; + } + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + properties._writeHandle = 1; + { + var error = $root.google.storage.v2.BidiWriteHandle.verify(message.writeHandle); + if (error) + return "writeHandle." + error; + } + } + if (message.generation != null && message.hasOwnProperty("generation")) { + properties._generation = 1; + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + } + return null; + }; + + /** + * Creates a BidiWriteObjectRedirectedError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiWriteObjectRedirectedError} BidiWriteObjectRedirectedError + */ + BidiWriteObjectRedirectedError.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiWriteObjectRedirectedError) + return object; + var message = new $root.google.storage.v2.BidiWriteObjectRedirectedError(); + if (object.routingToken != null) + message.routingToken = String(object.routingToken); + if (object.writeHandle != null) { + if (typeof object.writeHandle !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectRedirectedError.writeHandle: object expected"); + message.writeHandle = $root.google.storage.v2.BidiWriteHandle.fromObject(object.writeHandle); + } + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BidiWriteObjectRedirectedError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {google.storage.v2.BidiWriteObjectRedirectedError} message BidiWriteObjectRedirectedError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiWriteObjectRedirectedError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + object.routingToken = message.routingToken; + if (options.oneofs) + object._routingToken = "routingToken"; + } + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options); + if (options.oneofs) + object._writeHandle = "writeHandle"; + } + if (message.generation != null && message.hasOwnProperty("generation")) { + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (options.oneofs) + object._generation = "generation"; + } + return object; + }; + + /** + * Converts this BidiWriteObjectRedirectedError to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @instance + * @returns {Object.} JSON object + */ + BidiWriteObjectRedirectedError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiWriteObjectRedirectedError + * @function getTypeUrl + * @memberof google.storage.v2.BidiWriteObjectRedirectedError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiWriteObjectRedirectedError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiWriteObjectRedirectedError"; + }; + + return BidiWriteObjectRedirectedError; + })(); + + v2.BidiReadObjectError = (function() { + + /** + * Properties of a BidiReadObjectError. + * @memberof google.storage.v2 + * @interface IBidiReadObjectError + * @property {Array.|null} [readRangeErrors] BidiReadObjectError readRangeErrors + */ + + /** + * Constructs a new BidiReadObjectError. + * @memberof google.storage.v2 + * @classdesc Represents a BidiReadObjectError. + * @implements IBidiReadObjectError + * @constructor + * @param {google.storage.v2.IBidiReadObjectError=} [properties] Properties to set + */ + function BidiReadObjectError(properties) { + this.readRangeErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiReadObjectError readRangeErrors. + * @member {Array.} readRangeErrors + * @memberof google.storage.v2.BidiReadObjectError + * @instance + */ + BidiReadObjectError.prototype.readRangeErrors = $util.emptyArray; + + /** + * Creates a new BidiReadObjectError instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {google.storage.v2.IBidiReadObjectError=} [properties] Properties to set + * @returns {google.storage.v2.BidiReadObjectError} BidiReadObjectError instance + */ + BidiReadObjectError.create = function create(properties) { + return new BidiReadObjectError(properties); + }; + + /** + * Encodes the specified BidiReadObjectError message. Does not implicitly {@link google.storage.v2.BidiReadObjectError.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {google.storage.v2.IBidiReadObjectError} message BidiReadObjectError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readRangeErrors != null && message.readRangeErrors.length) + for (var i = 0; i < message.readRangeErrors.length; ++i) + $root.google.storage.v2.ReadRangeError.encode(message.readRangeErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiReadObjectError message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadObjectError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {google.storage.v2.IBidiReadObjectError} message BidiReadObjectError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadObjectError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiReadObjectError message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiReadObjectError} BidiReadObjectError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectError.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiReadObjectError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.readRangeErrors && message.readRangeErrors.length)) + message.readRangeErrors = []; + message.readRangeErrors.push($root.google.storage.v2.ReadRangeError.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiReadObjectError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiReadObjectError} BidiReadObjectError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadObjectError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiReadObjectError message. + * @function verify + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiReadObjectError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readRangeErrors != null && message.hasOwnProperty("readRangeErrors")) { + if (!Array.isArray(message.readRangeErrors)) + return "readRangeErrors: array expected"; + for (var i = 0; i < message.readRangeErrors.length; ++i) { + var error = $root.google.storage.v2.ReadRangeError.verify(message.readRangeErrors[i]); + if (error) + return "readRangeErrors." + error; + } + } + return null; + }; + + /** + * Creates a BidiReadObjectError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiReadObjectError} BidiReadObjectError + */ + BidiReadObjectError.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiReadObjectError) + return object; + var message = new $root.google.storage.v2.BidiReadObjectError(); + if (object.readRangeErrors) { + if (!Array.isArray(object.readRangeErrors)) + throw TypeError(".google.storage.v2.BidiReadObjectError.readRangeErrors: array expected"); + message.readRangeErrors = []; + for (var i = 0; i < object.readRangeErrors.length; ++i) { + if (typeof object.readRangeErrors[i] !== "object") + throw TypeError(".google.storage.v2.BidiReadObjectError.readRangeErrors: object expected"); + message.readRangeErrors[i] = $root.google.storage.v2.ReadRangeError.fromObject(object.readRangeErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BidiReadObjectError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {google.storage.v2.BidiReadObjectError} message BidiReadObjectError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiReadObjectError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.readRangeErrors = []; + if (message.readRangeErrors && message.readRangeErrors.length) { + object.readRangeErrors = []; + for (var j = 0; j < message.readRangeErrors.length; ++j) + object.readRangeErrors[j] = $root.google.storage.v2.ReadRangeError.toObject(message.readRangeErrors[j], options); + } + return object; + }; + + /** + * Converts this BidiReadObjectError to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiReadObjectError + * @instance + * @returns {Object.} JSON object + */ + BidiReadObjectError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiReadObjectError + * @function getTypeUrl + * @memberof google.storage.v2.BidiReadObjectError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiReadObjectError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiReadObjectError"; + }; + + return BidiReadObjectError; + })(); + + v2.ReadRangeError = (function() { + + /** + * Properties of a ReadRangeError. + * @memberof google.storage.v2 + * @interface IReadRangeError + * @property {number|Long|null} [readId] ReadRangeError readId + * @property {google.rpc.IStatus|null} [status] ReadRangeError status + */ + + /** + * Constructs a new ReadRangeError. + * @memberof google.storage.v2 + * @classdesc Represents a ReadRangeError. + * @implements IReadRangeError + * @constructor + * @param {google.storage.v2.IReadRangeError=} [properties] Properties to set + */ + function ReadRangeError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRangeError readId. + * @member {number|Long} readId + * @memberof google.storage.v2.ReadRangeError + * @instance + */ + ReadRangeError.prototype.readId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRangeError status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.storage.v2.ReadRangeError + * @instance + */ + ReadRangeError.prototype.status = null; + + /** + * Creates a new ReadRangeError instance using the specified properties. + * @function create + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {google.storage.v2.IReadRangeError=} [properties] Properties to set + * @returns {google.storage.v2.ReadRangeError} ReadRangeError instance + */ + ReadRangeError.create = function create(properties) { + return new ReadRangeError(properties); + }; + + /** + * Encodes the specified ReadRangeError message. Does not implicitly {@link google.storage.v2.ReadRangeError.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {google.storage.v2.IReadRangeError} message ReadRangeError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRangeError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readId != null && Object.hasOwnProperty.call(message, "readId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.readId); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRangeError message, length delimited. Does not implicitly {@link google.storage.v2.ReadRangeError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {google.storage.v2.IReadRangeError} message ReadRangeError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRangeError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRangeError message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ReadRangeError} ReadRangeError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRangeError.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ReadRangeError(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readId = reader.int64(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRangeError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ReadRangeError} ReadRangeError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRangeError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRangeError message. + * @function verify + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRangeError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readId != null && message.hasOwnProperty("readId")) + if (!$util.isInteger(message.readId) && !(message.readId && $util.isInteger(message.readId.low) && $util.isInteger(message.readId.high))) + return "readId: integer|Long expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a ReadRangeError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ReadRangeError} ReadRangeError + */ + ReadRangeError.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ReadRangeError) + return object; + var message = new $root.google.storage.v2.ReadRangeError(); + if (object.readId != null) + if ($util.Long) + (message.readId = $util.Long.fromValue(object.readId)).unsigned = false; + else if (typeof object.readId === "string") + message.readId = parseInt(object.readId, 10); + else if (typeof object.readId === "number") + message.readId = object.readId; + else if (typeof object.readId === "object") + message.readId = new $util.LongBits(object.readId.low >>> 0, object.readId.high >>> 0).toNumber(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.storage.v2.ReadRangeError.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a ReadRangeError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {google.storage.v2.ReadRangeError} message ReadRangeError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRangeError.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.readId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readId = options.longs === String ? "0" : 0; + object.status = null; + } + if (message.readId != null && message.hasOwnProperty("readId")) + if (typeof message.readId === "number") + object.readId = options.longs === String ? String(message.readId) : message.readId; + else + object.readId = options.longs === String ? $util.Long.prototype.toString.call(message.readId) : options.longs === Number ? new $util.LongBits(message.readId.low >>> 0, message.readId.high >>> 0).toNumber() : message.readId; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this ReadRangeError to JSON. + * @function toJSON + * @memberof google.storage.v2.ReadRangeError + * @instance + * @returns {Object.} JSON object + */ + ReadRangeError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRangeError + * @function getTypeUrl + * @memberof google.storage.v2.ReadRangeError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRangeError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ReadRangeError"; + }; + + return ReadRangeError; + })(); + + v2.ReadRange = (function() { + + /** + * Properties of a ReadRange. + * @memberof google.storage.v2 + * @interface IReadRange + * @property {number|Long|null} [readOffset] ReadRange readOffset + * @property {number|Long|null} [readLength] ReadRange readLength + * @property {number|Long|null} [readId] ReadRange readId + */ + + /** + * Constructs a new ReadRange. + * @memberof google.storage.v2 + * @classdesc Represents a ReadRange. + * @implements IReadRange + * @constructor + * @param {google.storage.v2.IReadRange=} [properties] Properties to set + */ + function ReadRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRange readOffset. + * @member {number|Long} readOffset + * @memberof google.storage.v2.ReadRange + * @instance + */ + ReadRange.prototype.readOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRange readLength. + * @member {number|Long} readLength + * @memberof google.storage.v2.ReadRange + * @instance + */ + ReadRange.prototype.readLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRange readId. + * @member {number|Long} readId + * @memberof google.storage.v2.ReadRange + * @instance + */ + ReadRange.prototype.readId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ReadRange instance using the specified properties. + * @function create + * @memberof google.storage.v2.ReadRange + * @static + * @param {google.storage.v2.IReadRange=} [properties] Properties to set + * @returns {google.storage.v2.ReadRange} ReadRange instance + */ + ReadRange.create = function create(properties) { + return new ReadRange(properties); + }; + + /** + * Encodes the specified ReadRange message. Does not implicitly {@link google.storage.v2.ReadRange.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ReadRange + * @static + * @param {google.storage.v2.IReadRange} message ReadRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOffset != null && Object.hasOwnProperty.call(message, "readOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.readOffset); + if (message.readLength != null && Object.hasOwnProperty.call(message, "readLength")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.readLength); + if (message.readId != null && Object.hasOwnProperty.call(message, "readId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.readId); + return writer; + }; + + /** + * Encodes the specified ReadRange message, length delimited. Does not implicitly {@link google.storage.v2.ReadRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ReadRange + * @static + * @param {google.storage.v2.IReadRange} message ReadRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRange message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ReadRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ReadRange} ReadRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ReadRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.readOffset = reader.int64(); + break; + } + case 2: { + message.readLength = reader.int64(); + break; + } + case 3: { + message.readId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ReadRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ReadRange} ReadRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRange message. + * @function verify + * @memberof google.storage.v2.ReadRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readOffset != null && message.hasOwnProperty("readOffset")) + if (!$util.isInteger(message.readOffset) && !(message.readOffset && $util.isInteger(message.readOffset.low) && $util.isInteger(message.readOffset.high))) + return "readOffset: integer|Long expected"; + if (message.readLength != null && message.hasOwnProperty("readLength")) + if (!$util.isInteger(message.readLength) && !(message.readLength && $util.isInteger(message.readLength.low) && $util.isInteger(message.readLength.high))) + return "readLength: integer|Long expected"; + if (message.readId != null && message.hasOwnProperty("readId")) + if (!$util.isInteger(message.readId) && !(message.readId && $util.isInteger(message.readId.low) && $util.isInteger(message.readId.high))) + return "readId: integer|Long expected"; + return null; + }; + + /** + * Creates a ReadRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ReadRange + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ReadRange} ReadRange + */ + ReadRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ReadRange) + return object; + var message = new $root.google.storage.v2.ReadRange(); + if (object.readOffset != null) + if ($util.Long) + (message.readOffset = $util.Long.fromValue(object.readOffset)).unsigned = false; + else if (typeof object.readOffset === "string") + message.readOffset = parseInt(object.readOffset, 10); + else if (typeof object.readOffset === "number") + message.readOffset = object.readOffset; + else if (typeof object.readOffset === "object") + message.readOffset = new $util.LongBits(object.readOffset.low >>> 0, object.readOffset.high >>> 0).toNumber(); + if (object.readLength != null) + if ($util.Long) + (message.readLength = $util.Long.fromValue(object.readLength)).unsigned = false; + else if (typeof object.readLength === "string") + message.readLength = parseInt(object.readLength, 10); + else if (typeof object.readLength === "number") + message.readLength = object.readLength; + else if (typeof object.readLength === "object") + message.readLength = new $util.LongBits(object.readLength.low >>> 0, object.readLength.high >>> 0).toNumber(); + if (object.readId != null) + if ($util.Long) + (message.readId = $util.Long.fromValue(object.readId)).unsigned = false; + else if (typeof object.readId === "string") + message.readId = parseInt(object.readId, 10); + else if (typeof object.readId === "number") + message.readId = object.readId; + else if (typeof object.readId === "object") + message.readId = new $util.LongBits(object.readId.low >>> 0, object.readId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ReadRange + * @static + * @param {google.storage.v2.ReadRange} message ReadRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRange.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.readOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.readLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readLength = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.readId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readId = options.longs === String ? "0" : 0; + } + if (message.readOffset != null && message.hasOwnProperty("readOffset")) + if (typeof message.readOffset === "number") + object.readOffset = options.longs === String ? String(message.readOffset) : message.readOffset; + else + object.readOffset = options.longs === String ? $util.Long.prototype.toString.call(message.readOffset) : options.longs === Number ? new $util.LongBits(message.readOffset.low >>> 0, message.readOffset.high >>> 0).toNumber() : message.readOffset; + if (message.readLength != null && message.hasOwnProperty("readLength")) + if (typeof message.readLength === "number") + object.readLength = options.longs === String ? String(message.readLength) : message.readLength; + else + object.readLength = options.longs === String ? $util.Long.prototype.toString.call(message.readLength) : options.longs === Number ? new $util.LongBits(message.readLength.low >>> 0, message.readLength.high >>> 0).toNumber() : message.readLength; + if (message.readId != null && message.hasOwnProperty("readId")) + if (typeof message.readId === "number") + object.readId = options.longs === String ? String(message.readId) : message.readId; + else + object.readId = options.longs === String ? $util.Long.prototype.toString.call(message.readId) : options.longs === Number ? new $util.LongBits(message.readId.low >>> 0, message.readId.high >>> 0).toNumber() : message.readId; + return object; + }; + + /** + * Converts this ReadRange to JSON. + * @function toJSON + * @memberof google.storage.v2.ReadRange + * @instance + * @returns {Object.} JSON object + */ + ReadRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadRange + * @function getTypeUrl + * @memberof google.storage.v2.ReadRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ReadRange"; + }; + + return ReadRange; + })(); + + v2.ObjectRangeData = (function() { + + /** + * Properties of an ObjectRangeData. + * @memberof google.storage.v2 + * @interface IObjectRangeData + * @property {google.storage.v2.IChecksummedData|null} [checksummedData] ObjectRangeData checksummedData + * @property {google.storage.v2.IReadRange|null} [readRange] ObjectRangeData readRange + * @property {boolean|null} [rangeEnd] ObjectRangeData rangeEnd + */ + + /** + * Constructs a new ObjectRangeData. + * @memberof google.storage.v2 + * @classdesc Represents an ObjectRangeData. + * @implements IObjectRangeData + * @constructor + * @param {google.storage.v2.IObjectRangeData=} [properties] Properties to set + */ + function ObjectRangeData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectRangeData checksummedData. + * @member {google.storage.v2.IChecksummedData|null|undefined} checksummedData + * @memberof google.storage.v2.ObjectRangeData + * @instance + */ + ObjectRangeData.prototype.checksummedData = null; + + /** + * ObjectRangeData readRange. + * @member {google.storage.v2.IReadRange|null|undefined} readRange + * @memberof google.storage.v2.ObjectRangeData + * @instance + */ + ObjectRangeData.prototype.readRange = null; + + /** + * ObjectRangeData rangeEnd. + * @member {boolean} rangeEnd + * @memberof google.storage.v2.ObjectRangeData + * @instance + */ + ObjectRangeData.prototype.rangeEnd = false; + + /** + * Creates a new ObjectRangeData instance using the specified properties. + * @function create + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {google.storage.v2.IObjectRangeData=} [properties] Properties to set + * @returns {google.storage.v2.ObjectRangeData} ObjectRangeData instance + */ + ObjectRangeData.create = function create(properties) { + return new ObjectRangeData(properties); + }; + + /** + * Encodes the specified ObjectRangeData message. Does not implicitly {@link google.storage.v2.ObjectRangeData.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {google.storage.v2.IObjectRangeData} message ObjectRangeData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectRangeData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) + $root.google.storage.v2.ChecksummedData.encode(message.checksummedData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.readRange != null && Object.hasOwnProperty.call(message, "readRange")) + $root.google.storage.v2.ReadRange.encode(message.readRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rangeEnd != null && Object.hasOwnProperty.call(message, "rangeEnd")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.rangeEnd); + return writer; + }; + + /** + * Encodes the specified ObjectRangeData message, length delimited. Does not implicitly {@link google.storage.v2.ObjectRangeData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {google.storage.v2.IObjectRangeData} message ObjectRangeData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectRangeData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectRangeData message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ObjectRangeData} ObjectRangeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectRangeData.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ObjectRangeData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.checksummedData = $root.google.storage.v2.ChecksummedData.decode(reader, reader.uint32()); + break; + } + case 2: { + message.readRange = $root.google.storage.v2.ReadRange.decode(reader, reader.uint32()); + break; + } + case 3: { + message.rangeEnd = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectRangeData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ObjectRangeData} ObjectRangeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectRangeData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectRangeData message. + * @function verify + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectRangeData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { + var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData); + if (error) + return "checksummedData." + error; + } + if (message.readRange != null && message.hasOwnProperty("readRange")) { + var error = $root.google.storage.v2.ReadRange.verify(message.readRange); + if (error) + return "readRange." + error; + } + if (message.rangeEnd != null && message.hasOwnProperty("rangeEnd")) + if (typeof message.rangeEnd !== "boolean") + return "rangeEnd: boolean expected"; + return null; + }; + + /** + * Creates an ObjectRangeData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ObjectRangeData} ObjectRangeData + */ + ObjectRangeData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ObjectRangeData) + return object; + var message = new $root.google.storage.v2.ObjectRangeData(); + if (object.checksummedData != null) { + if (typeof object.checksummedData !== "object") + throw TypeError(".google.storage.v2.ObjectRangeData.checksummedData: object expected"); + message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData); + } + if (object.readRange != null) { + if (typeof object.readRange !== "object") + throw TypeError(".google.storage.v2.ObjectRangeData.readRange: object expected"); + message.readRange = $root.google.storage.v2.ReadRange.fromObject(object.readRange); + } + if (object.rangeEnd != null) + message.rangeEnd = Boolean(object.rangeEnd); + return message; + }; + + /** + * Creates a plain object from an ObjectRangeData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {google.storage.v2.ObjectRangeData} message ObjectRangeData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectRangeData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.checksummedData = null; + object.readRange = null; + object.rangeEnd = false; + } + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) + object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options); + if (message.readRange != null && message.hasOwnProperty("readRange")) + object.readRange = $root.google.storage.v2.ReadRange.toObject(message.readRange, options); + if (message.rangeEnd != null && message.hasOwnProperty("rangeEnd")) + object.rangeEnd = message.rangeEnd; + return object; + }; + + /** + * Converts this ObjectRangeData to JSON. + * @function toJSON + * @memberof google.storage.v2.ObjectRangeData + * @instance + * @returns {Object.} JSON object + */ + ObjectRangeData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectRangeData + * @function getTypeUrl + * @memberof google.storage.v2.ObjectRangeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectRangeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ObjectRangeData"; + }; + + return ObjectRangeData; + })(); + + v2.BidiReadHandle = (function() { + + /** + * Properties of a BidiReadHandle. + * @memberof google.storage.v2 + * @interface IBidiReadHandle + * @property {Uint8Array|null} [handle] BidiReadHandle handle + */ + + /** + * Constructs a new BidiReadHandle. + * @memberof google.storage.v2 + * @classdesc Represents a BidiReadHandle. + * @implements IBidiReadHandle + * @constructor + * @param {google.storage.v2.IBidiReadHandle=} [properties] Properties to set + */ + function BidiReadHandle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiReadHandle handle. + * @member {Uint8Array} handle + * @memberof google.storage.v2.BidiReadHandle + * @instance + */ + BidiReadHandle.prototype.handle = $util.newBuffer([]); + + /** + * Creates a new BidiReadHandle instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {google.storage.v2.IBidiReadHandle=} [properties] Properties to set + * @returns {google.storage.v2.BidiReadHandle} BidiReadHandle instance + */ + BidiReadHandle.create = function create(properties) { + return new BidiReadHandle(properties); + }; + + /** + * Encodes the specified BidiReadHandle message. Does not implicitly {@link google.storage.v2.BidiReadHandle.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {google.storage.v2.IBidiReadHandle} message BidiReadHandle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadHandle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.handle); + return writer; + }; + + /** + * Encodes the specified BidiReadHandle message, length delimited. Does not implicitly {@link google.storage.v2.BidiReadHandle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {google.storage.v2.IBidiReadHandle} message BidiReadHandle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiReadHandle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiReadHandle message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiReadHandle} BidiReadHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadHandle.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiReadHandle(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.handle = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiReadHandle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiReadHandle} BidiReadHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiReadHandle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiReadHandle message. + * @function verify + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiReadHandle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.handle != null && message.hasOwnProperty("handle")) + if (!(message.handle && typeof message.handle.length === "number" || $util.isString(message.handle))) + return "handle: buffer expected"; + return null; + }; + + /** + * Creates a BidiReadHandle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiReadHandle} BidiReadHandle + */ + BidiReadHandle.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiReadHandle) + return object; + var message = new $root.google.storage.v2.BidiReadHandle(); + if (object.handle != null) + if (typeof object.handle === "string") + $util.base64.decode(object.handle, message.handle = $util.newBuffer($util.base64.length(object.handle)), 0); + else if (object.handle.length >= 0) + message.handle = object.handle; + return message; + }; + + /** + * Creates a plain object from a BidiReadHandle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {google.storage.v2.BidiReadHandle} message BidiReadHandle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiReadHandle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.handle = ""; + else { + object.handle = []; + if (options.bytes !== Array) + object.handle = $util.newBuffer(object.handle); + } + if (message.handle != null && message.hasOwnProperty("handle")) + object.handle = options.bytes === String ? $util.base64.encode(message.handle, 0, message.handle.length) : options.bytes === Array ? Array.prototype.slice.call(message.handle) : message.handle; + return object; + }; + + /** + * Converts this BidiReadHandle to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiReadHandle + * @instance + * @returns {Object.} JSON object + */ + BidiReadHandle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiReadHandle + * @function getTypeUrl + * @memberof google.storage.v2.BidiReadHandle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiReadHandle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiReadHandle"; + }; + + return BidiReadHandle; + })(); + + v2.BidiWriteHandle = (function() { + + /** + * Properties of a BidiWriteHandle. + * @memberof google.storage.v2 + * @interface IBidiWriteHandle + * @property {Uint8Array|null} [handle] BidiWriteHandle handle + */ + + /** + * Constructs a new BidiWriteHandle. + * @memberof google.storage.v2 + * @classdesc Represents a BidiWriteHandle. + * @implements IBidiWriteHandle + * @constructor + * @param {google.storage.v2.IBidiWriteHandle=} [properties] Properties to set + */ + function BidiWriteHandle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiWriteHandle handle. + * @member {Uint8Array} handle + * @memberof google.storage.v2.BidiWriteHandle + * @instance + */ + BidiWriteHandle.prototype.handle = $util.newBuffer([]); + + /** + * Creates a new BidiWriteHandle instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {google.storage.v2.IBidiWriteHandle=} [properties] Properties to set + * @returns {google.storage.v2.BidiWriteHandle} BidiWriteHandle instance + */ + BidiWriteHandle.create = function create(properties) { + return new BidiWriteHandle(properties); + }; + + /** + * Encodes the specified BidiWriteHandle message. Does not implicitly {@link google.storage.v2.BidiWriteHandle.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {google.storage.v2.IBidiWriteHandle} message BidiWriteHandle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteHandle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.handle); + return writer; + }; + + /** + * Encodes the specified BidiWriteHandle message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteHandle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {google.storage.v2.IBidiWriteHandle} message BidiWriteHandle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteHandle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiWriteHandle message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiWriteHandle} BidiWriteHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteHandle.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiWriteHandle(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.handle = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiWriteHandle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiWriteHandle} BidiWriteHandle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteHandle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiWriteHandle message. + * @function verify + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiWriteHandle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.handle != null && message.hasOwnProperty("handle")) + if (!(message.handle && typeof message.handle.length === "number" || $util.isString(message.handle))) + return "handle: buffer expected"; + return null; + }; + + /** + * Creates a BidiWriteHandle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiWriteHandle} BidiWriteHandle + */ + BidiWriteHandle.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiWriteHandle) + return object; + var message = new $root.google.storage.v2.BidiWriteHandle(); + if (object.handle != null) + if (typeof object.handle === "string") + $util.base64.decode(object.handle, message.handle = $util.newBuffer($util.base64.length(object.handle)), 0); + else if (object.handle.length >= 0) + message.handle = object.handle; + return message; + }; + + /** + * Creates a plain object from a BidiWriteHandle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {google.storage.v2.BidiWriteHandle} message BidiWriteHandle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiWriteHandle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.handle = ""; + else { + object.handle = []; + if (options.bytes !== Array) + object.handle = $util.newBuffer(object.handle); + } + if (message.handle != null && message.hasOwnProperty("handle")) + object.handle = options.bytes === String ? $util.base64.encode(message.handle, 0, message.handle.length) : options.bytes === Array ? Array.prototype.slice.call(message.handle) : message.handle; + return object; + }; + + /** + * Converts this BidiWriteHandle to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiWriteHandle + * @instance + * @returns {Object.} JSON object + */ + BidiWriteHandle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiWriteHandle + * @function getTypeUrl + * @memberof google.storage.v2.BidiWriteHandle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiWriteHandle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiWriteHandle"; + }; + + return BidiWriteHandle; + })(); + + v2.WriteObjectSpec = (function() { + + /** + * Properties of a WriteObjectSpec. + * @memberof google.storage.v2 + * @interface IWriteObjectSpec + * @property {google.storage.v2.IObject|null} [resource] WriteObjectSpec resource + * @property {string|null} [predefinedAcl] WriteObjectSpec predefinedAcl + * @property {number|Long|null} [ifGenerationMatch] WriteObjectSpec ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] WriteObjectSpec ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] WriteObjectSpec ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] WriteObjectSpec ifMetagenerationNotMatch + * @property {number|Long|null} [objectSize] WriteObjectSpec objectSize + * @property {boolean|null} [appendable] WriteObjectSpec appendable + */ + + /** + * Constructs a new WriteObjectSpec. + * @memberof google.storage.v2 + * @classdesc Represents a WriteObjectSpec. + * @implements IWriteObjectSpec + * @constructor + * @param {google.storage.v2.IWriteObjectSpec=} [properties] Properties to set + */ + function WriteObjectSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteObjectSpec resource. + * @member {google.storage.v2.IObject|null|undefined} resource + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.resource = null; + + /** + * WriteObjectSpec predefinedAcl. + * @member {string} predefinedAcl + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.predefinedAcl = ""; + + /** + * WriteObjectSpec ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.ifGenerationMatch = null; + + /** + * WriteObjectSpec ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.ifGenerationNotMatch = null; + + /** + * WriteObjectSpec ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.ifMetagenerationMatch = null; + + /** + * WriteObjectSpec ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.ifMetagenerationNotMatch = null; + + /** + * WriteObjectSpec objectSize. + * @member {number|Long|null|undefined} objectSize + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.objectSize = null; + + /** + * WriteObjectSpec appendable. + * @member {boolean|null|undefined} appendable + * @memberof google.storage.v2.WriteObjectSpec + * @instance + */ + WriteObjectSpec.prototype.appendable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WriteObjectSpec.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WriteObjectSpec.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WriteObjectSpec.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WriteObjectSpec.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WriteObjectSpec.prototype, "_objectSize", { + get: $util.oneOfGetter($oneOfFields = ["objectSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WriteObjectSpec.prototype, "_appendable", { + get: $util.oneOfGetter($oneOfFields = ["appendable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WriteObjectSpec instance using the specified properties. + * @function create + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {google.storage.v2.IWriteObjectSpec=} [properties] Properties to set + * @returns {google.storage.v2.WriteObjectSpec} WriteObjectSpec instance + */ + WriteObjectSpec.create = function create(properties) { + return new WriteObjectSpec(properties); + }; + + /** + * Encodes the specified WriteObjectSpec message. Does not implicitly {@link google.storage.v2.WriteObjectSpec.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {google.storage.v2.IWriteObjectSpec} message WriteObjectSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteObjectSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.storage.v2.Object.encode(message.resource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifMetagenerationNotMatch); + if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.predefinedAcl); + if (message.objectSize != null && Object.hasOwnProperty.call(message, "objectSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.objectSize); + if (message.appendable != null && Object.hasOwnProperty.call(message, "appendable")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.appendable); + return writer; + }; + + /** + * Encodes the specified WriteObjectSpec message, length delimited. Does not implicitly {@link google.storage.v2.WriteObjectSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {google.storage.v2.IWriteObjectSpec} message WriteObjectSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteObjectSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteObjectSpec message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.WriteObjectSpec} WriteObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteObjectSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.WriteObjectSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 7: { + message.predefinedAcl = reader.string(); + break; + } + case 3: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 4: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 5: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 6: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 8: { + message.objectSize = reader.int64(); + break; + } + case 9: { + message.appendable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteObjectSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.WriteObjectSpec} WriteObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteObjectSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteObjectSpec message. + * @function verify + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteObjectSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.storage.v2.Object.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + if (!$util.isString(message.predefinedAcl)) + return "predefinedAcl: string expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.objectSize != null && message.hasOwnProperty("objectSize")) { + properties._objectSize = 1; + if (!$util.isInteger(message.objectSize) && !(message.objectSize && $util.isInteger(message.objectSize.low) && $util.isInteger(message.objectSize.high))) + return "objectSize: integer|Long expected"; + } + if (message.appendable != null && message.hasOwnProperty("appendable")) { + properties._appendable = 1; + if (typeof message.appendable !== "boolean") + return "appendable: boolean expected"; + } + return null; + }; + + /** + * Creates a WriteObjectSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.WriteObjectSpec} WriteObjectSpec + */ + WriteObjectSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.WriteObjectSpec) + return object; + var message = new $root.google.storage.v2.WriteObjectSpec(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.storage.v2.WriteObjectSpec.resource: object expected"); + message.resource = $root.google.storage.v2.Object.fromObject(object.resource); + } + if (object.predefinedAcl != null) + message.predefinedAcl = String(object.predefinedAcl); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.objectSize != null) + if ($util.Long) + (message.objectSize = $util.Long.fromValue(object.objectSize)).unsigned = false; + else if (typeof object.objectSize === "string") + message.objectSize = parseInt(object.objectSize, 10); + else if (typeof object.objectSize === "number") + message.objectSize = object.objectSize; + else if (typeof object.objectSize === "object") + message.objectSize = new $util.LongBits(object.objectSize.low >>> 0, object.objectSize.high >>> 0).toNumber(); + if (object.appendable != null) + message.appendable = Boolean(object.appendable); + return message; + }; + + /** + * Creates a plain object from a WriteObjectSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {google.storage.v2.WriteObjectSpec} message WriteObjectSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteObjectSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = null; + object.predefinedAcl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.storage.v2.Object.toObject(message.resource, options); + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + object.predefinedAcl = message.predefinedAcl; + if (message.objectSize != null && message.hasOwnProperty("objectSize")) { + if (typeof message.objectSize === "number") + object.objectSize = options.longs === String ? String(message.objectSize) : message.objectSize; + else + object.objectSize = options.longs === String ? $util.Long.prototype.toString.call(message.objectSize) : options.longs === Number ? new $util.LongBits(message.objectSize.low >>> 0, message.objectSize.high >>> 0).toNumber() : message.objectSize; + if (options.oneofs) + object._objectSize = "objectSize"; + } + if (message.appendable != null && message.hasOwnProperty("appendable")) { + object.appendable = message.appendable; + if (options.oneofs) + object._appendable = "appendable"; + } + return object; + }; + + /** + * Converts this WriteObjectSpec to JSON. + * @function toJSON + * @memberof google.storage.v2.WriteObjectSpec + * @instance + * @returns {Object.} JSON object + */ + WriteObjectSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteObjectSpec + * @function getTypeUrl + * @memberof google.storage.v2.WriteObjectSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteObjectSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.WriteObjectSpec"; + }; + + return WriteObjectSpec; + })(); + + v2.WriteObjectRequest = (function() { + + /** + * Properties of a WriteObjectRequest. + * @memberof google.storage.v2 + * @interface IWriteObjectRequest + * @property {string|null} [uploadId] WriteObjectRequest uploadId + * @property {google.storage.v2.IWriteObjectSpec|null} [writeObjectSpec] WriteObjectRequest writeObjectSpec + * @property {number|Long|null} [writeOffset] WriteObjectRequest writeOffset + * @property {google.storage.v2.IChecksummedData|null} [checksummedData] WriteObjectRequest checksummedData + * @property {google.storage.v2.IObjectChecksums|null} [objectChecksums] WriteObjectRequest objectChecksums + * @property {boolean|null} [finishWrite] WriteObjectRequest finishWrite + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] WriteObjectRequest commonObjectRequestParams + */ + + /** + * Constructs a new WriteObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a WriteObjectRequest. + * @implements IWriteObjectRequest + * @constructor + * @param {google.storage.v2.IWriteObjectRequest=} [properties] Properties to set + */ + function WriteObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteObjectRequest uploadId. + * @member {string|null|undefined} uploadId + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.uploadId = null; + + /** + * WriteObjectRequest writeObjectSpec. + * @member {google.storage.v2.IWriteObjectSpec|null|undefined} writeObjectSpec + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.writeObjectSpec = null; + + /** + * WriteObjectRequest writeOffset. + * @member {number|Long} writeOffset + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.writeOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * WriteObjectRequest checksummedData. + * @member {google.storage.v2.IChecksummedData|null|undefined} checksummedData + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.checksummedData = null; + + /** + * WriteObjectRequest objectChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} objectChecksums + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.objectChecksums = null; + + /** + * WriteObjectRequest finishWrite. + * @member {boolean} finishWrite + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.finishWrite = false; + + /** + * WriteObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + WriteObjectRequest.prototype.commonObjectRequestParams = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WriteObjectRequest firstMessage. + * @member {"uploadId"|"writeObjectSpec"|undefined} firstMessage + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + Object.defineProperty(WriteObjectRequest.prototype, "firstMessage", { + get: $util.oneOfGetter($oneOfFields = ["uploadId", "writeObjectSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * WriteObjectRequest data. + * @member {"checksummedData"|undefined} data + * @memberof google.storage.v2.WriteObjectRequest + * @instance + */ + Object.defineProperty(WriteObjectRequest.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["checksummedData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WriteObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {google.storage.v2.IWriteObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.WriteObjectRequest} WriteObjectRequest instance + */ + WriteObjectRequest.create = function create(properties) { + return new WriteObjectRequest(properties); + }; + + /** + * Encodes the specified WriteObjectRequest message. Does not implicitly {@link google.storage.v2.WriteObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {google.storage.v2.IWriteObjectRequest} message WriteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); + if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) + $root.google.storage.v2.WriteObjectSpec.encode(message.writeObjectSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.writeOffset != null && Object.hasOwnProperty.call(message, "writeOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.writeOffset); + if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) + $root.google.storage.v2.ChecksummedData.encode(message.checksummedData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.finishWrite != null && Object.hasOwnProperty.call(message, "finishWrite")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.finishWrite); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.WriteObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {google.storage.v2.IWriteObjectRequest} message WriteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.WriteObjectRequest} WriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.WriteObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uploadId = reader.string(); + break; + } + case 2: { + message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.writeOffset = reader.int64(); + break; + } + case 4: { + message.checksummedData = $root.google.storage.v2.ChecksummedData.decode(reader, reader.uint32()); + break; + } + case 6: { + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + case 7: { + message.finishWrite = reader.bool(); + break; + } + case 8: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.WriteObjectRequest} WriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteObjectRequest message. + * @function verify + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { + properties.firstMessage = 1; + if (!$util.isString(message.uploadId)) + return "uploadId: string expected"; + } + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { + if (properties.firstMessage === 1) + return "firstMessage: multiple values"; + properties.firstMessage = 1; + { + var error = $root.google.storage.v2.WriteObjectSpec.verify(message.writeObjectSpec); + if (error) + return "writeObjectSpec." + error; + } + } + if (message.writeOffset != null && message.hasOwnProperty("writeOffset")) + if (!$util.isInteger(message.writeOffset) && !(message.writeOffset && $util.isInteger(message.writeOffset.low) && $util.isInteger(message.writeOffset.high))) + return "writeOffset: integer|Long expected"; + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { + properties.data = 1; + { + var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData); + if (error) + return "checksummedData." + error; + } + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums); + if (error) + return "objectChecksums." + error; + } + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) + if (typeof message.finishWrite !== "boolean") + return "finishWrite: boolean expected"; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + return null; + }; + + /** + * Creates a WriteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.WriteObjectRequest} WriteObjectRequest + */ + WriteObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.WriteObjectRequest) + return object; + var message = new $root.google.storage.v2.WriteObjectRequest(); + if (object.uploadId != null) + message.uploadId = String(object.uploadId); + if (object.writeObjectSpec != null) { + if (typeof object.writeObjectSpec !== "object") + throw TypeError(".google.storage.v2.WriteObjectRequest.writeObjectSpec: object expected"); + message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.fromObject(object.writeObjectSpec); + } + if (object.writeOffset != null) + if ($util.Long) + (message.writeOffset = $util.Long.fromValue(object.writeOffset)).unsigned = false; + else if (typeof object.writeOffset === "string") + message.writeOffset = parseInt(object.writeOffset, 10); + else if (typeof object.writeOffset === "number") + message.writeOffset = object.writeOffset; + else if (typeof object.writeOffset === "object") + message.writeOffset = new $util.LongBits(object.writeOffset.low >>> 0, object.writeOffset.high >>> 0).toNumber(); + if (object.checksummedData != null) { + if (typeof object.checksummedData !== "object") + throw TypeError(".google.storage.v2.WriteObjectRequest.checksummedData: object expected"); + message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData); + } + if (object.objectChecksums != null) { + if (typeof object.objectChecksums !== "object") + throw TypeError(".google.storage.v2.WriteObjectRequest.objectChecksums: object expected"); + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums); + } + if (object.finishWrite != null) + message.finishWrite = Boolean(object.finishWrite); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.WriteObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + return message; + }; + + /** + * Creates a plain object from a WriteObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {google.storage.v2.WriteObjectRequest} message WriteObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteObjectRequest.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.writeOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.writeOffset = options.longs === String ? "0" : 0; + object.objectChecksums = null; + object.finishWrite = false; + object.commonObjectRequestParams = null; + } + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { + object.uploadId = message.uploadId; + if (options.oneofs) + object.firstMessage = "uploadId"; + } + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { + object.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.toObject(message.writeObjectSpec, options); + if (options.oneofs) + object.firstMessage = "writeObjectSpec"; + } + if (message.writeOffset != null && message.hasOwnProperty("writeOffset")) + if (typeof message.writeOffset === "number") + object.writeOffset = options.longs === String ? String(message.writeOffset) : message.writeOffset; + else + object.writeOffset = options.longs === String ? $util.Long.prototype.toString.call(message.writeOffset) : options.longs === Number ? new $util.LongBits(message.writeOffset.low >>> 0, message.writeOffset.high >>> 0).toNumber() : message.writeOffset; + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { + object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options); + if (options.oneofs) + object.data = "checksummedData"; + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) + object.finishWrite = message.finishWrite; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + return object; + }; + + /** + * Converts this WriteObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.WriteObjectRequest + * @instance + * @returns {Object.} JSON object + */ + WriteObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.WriteObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.WriteObjectRequest"; + }; + + return WriteObjectRequest; + })(); + + v2.WriteObjectResponse = (function() { + + /** + * Properties of a WriteObjectResponse. + * @memberof google.storage.v2 + * @interface IWriteObjectResponse + * @property {number|Long|null} [persistedSize] WriteObjectResponse persistedSize + * @property {google.storage.v2.IObject|null} [resource] WriteObjectResponse resource + * @property {google.storage.v2.IObjectChecksums|null} [persistedDataChecksums] WriteObjectResponse persistedDataChecksums + */ + + /** + * Constructs a new WriteObjectResponse. + * @memberof google.storage.v2 + * @classdesc Represents a WriteObjectResponse. + * @implements IWriteObjectResponse + * @constructor + * @param {google.storage.v2.IWriteObjectResponse=} [properties] Properties to set + */ + function WriteObjectResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteObjectResponse persistedSize. + * @member {number|Long|null|undefined} persistedSize + * @memberof google.storage.v2.WriteObjectResponse + * @instance + */ + WriteObjectResponse.prototype.persistedSize = null; + + /** + * WriteObjectResponse resource. + * @member {google.storage.v2.IObject|null|undefined} resource + * @memberof google.storage.v2.WriteObjectResponse + * @instance + */ + WriteObjectResponse.prototype.resource = null; + + /** + * WriteObjectResponse persistedDataChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} persistedDataChecksums + * @memberof google.storage.v2.WriteObjectResponse + * @instance + */ + WriteObjectResponse.prototype.persistedDataChecksums = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WriteObjectResponse writeStatus. + * @member {"persistedSize"|"resource"|undefined} writeStatus + * @memberof google.storage.v2.WriteObjectResponse + * @instance + */ + Object.defineProperty(WriteObjectResponse.prototype, "writeStatus", { + get: $util.oneOfGetter($oneOfFields = ["persistedSize", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WriteObjectResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {google.storage.v2.IWriteObjectResponse=} [properties] Properties to set + * @returns {google.storage.v2.WriteObjectResponse} WriteObjectResponse instance + */ + WriteObjectResponse.create = function create(properties) { + return new WriteObjectResponse(properties); + }; + + /** + * Encodes the specified WriteObjectResponse message. Does not implicitly {@link google.storage.v2.WriteObjectResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {google.storage.v2.IWriteObjectResponse} message WriteObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteObjectResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.persistedSize); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.storage.v2.Object.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.WriteObjectResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {google.storage.v2.IWriteObjectResponse} message WriteObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteObjectResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.WriteObjectResponse} WriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteObjectResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.WriteObjectResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persistedSize = reader.int64(); + break; + } + case 2: { + message.resource = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 3: { + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteObjectResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.WriteObjectResponse} WriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteObjectResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteObjectResponse message. + * @function verify + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteObjectResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { + properties.writeStatus = 1; + if (!$util.isInteger(message.persistedSize) && !(message.persistedSize && $util.isInteger(message.persistedSize.low) && $util.isInteger(message.persistedSize.high))) + return "persistedSize: integer|Long expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.writeStatus === 1) + return "writeStatus: multiple values"; + properties.writeStatus = 1; + { + var error = $root.google.storage.v2.Object.verify(message.resource); + if (error) + return "resource." + error; + } + } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums); + if (error) + return "persistedDataChecksums." + error; + } + return null; + }; + + /** + * Creates a WriteObjectResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.WriteObjectResponse} WriteObjectResponse + */ + WriteObjectResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.WriteObjectResponse) + return object; + var message = new $root.google.storage.v2.WriteObjectResponse(); + if (object.persistedSize != null) + if ($util.Long) + (message.persistedSize = $util.Long.fromValue(object.persistedSize)).unsigned = false; + else if (typeof object.persistedSize === "string") + message.persistedSize = parseInt(object.persistedSize, 10); + else if (typeof object.persistedSize === "number") + message.persistedSize = object.persistedSize; + else if (typeof object.persistedSize === "object") + message.persistedSize = new $util.LongBits(object.persistedSize.low >>> 0, object.persistedSize.high >>> 0).toNumber(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.storage.v2.WriteObjectResponse.resource: object expected"); + message.resource = $root.google.storage.v2.Object.fromObject(object.resource); + } + if (object.persistedDataChecksums != null) { + if (typeof object.persistedDataChecksums !== "object") + throw TypeError(".google.storage.v2.WriteObjectResponse.persistedDataChecksums: object expected"); + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums); + } + return message; + }; + + /** + * Creates a plain object from a WriteObjectResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {google.storage.v2.WriteObjectResponse} message WriteObjectResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteObjectResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.persistedDataChecksums = null; + if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { + if (typeof message.persistedSize === "number") + object.persistedSize = options.longs === String ? String(message.persistedSize) : message.persistedSize; + else + object.persistedSize = options.longs === String ? $util.Long.prototype.toString.call(message.persistedSize) : options.longs === Number ? new $util.LongBits(message.persistedSize.low >>> 0, message.persistedSize.high >>> 0).toNumber() : message.persistedSize; + if (options.oneofs) + object.writeStatus = "persistedSize"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.storage.v2.Object.toObject(message.resource, options); + if (options.oneofs) + object.writeStatus = "resource"; + } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); + return object; + }; + + /** + * Converts this WriteObjectResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.WriteObjectResponse + * @instance + * @returns {Object.} JSON object + */ + WriteObjectResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteObjectResponse + * @function getTypeUrl + * @memberof google.storage.v2.WriteObjectResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteObjectResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.WriteObjectResponse"; + }; + + return WriteObjectResponse; + })(); + + v2.AppendObjectSpec = (function() { + + /** + * Properties of an AppendObjectSpec. + * @memberof google.storage.v2 + * @interface IAppendObjectSpec + * @property {string|null} [bucket] AppendObjectSpec bucket + * @property {string|null} [object] AppendObjectSpec object + * @property {number|Long|null} [generation] AppendObjectSpec generation + * @property {number|Long|null} [ifMetagenerationMatch] AppendObjectSpec ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] AppendObjectSpec ifMetagenerationNotMatch + * @property {string|null} [routingToken] AppendObjectSpec routingToken + * @property {google.storage.v2.IBidiWriteHandle|null} [writeHandle] AppendObjectSpec writeHandle + */ + + /** + * Constructs a new AppendObjectSpec. + * @memberof google.storage.v2 + * @classdesc Represents an AppendObjectSpec. + * @implements IAppendObjectSpec + * @constructor + * @param {google.storage.v2.IAppendObjectSpec=} [properties] Properties to set + */ + function AppendObjectSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppendObjectSpec bucket. + * @member {string} bucket + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.bucket = ""; + + /** + * AppendObjectSpec object. + * @member {string} object + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.object = ""; + + /** + * AppendObjectSpec generation. + * @member {number|Long} generation + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AppendObjectSpec ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.ifMetagenerationMatch = null; + + /** + * AppendObjectSpec ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.ifMetagenerationNotMatch = null; + + /** + * AppendObjectSpec routingToken. + * @member {string|null|undefined} routingToken + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.routingToken = null; + + /** + * AppendObjectSpec writeHandle. + * @member {google.storage.v2.IBidiWriteHandle|null|undefined} writeHandle + * @memberof google.storage.v2.AppendObjectSpec + * @instance + */ + AppendObjectSpec.prototype.writeHandle = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppendObjectSpec.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppendObjectSpec.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppendObjectSpec.prototype, "_routingToken", { + get: $util.oneOfGetter($oneOfFields = ["routingToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AppendObjectSpec.prototype, "_writeHandle", { + get: $util.oneOfGetter($oneOfFields = ["writeHandle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AppendObjectSpec instance using the specified properties. + * @function create + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {google.storage.v2.IAppendObjectSpec=} [properties] Properties to set + * @returns {google.storage.v2.AppendObjectSpec} AppendObjectSpec instance + */ + AppendObjectSpec.create = function create(properties) { + return new AppendObjectSpec(properties); + }; + + /** + * Encodes the specified AppendObjectSpec message. Does not implicitly {@link google.storage.v2.AppendObjectSpec.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {google.storage.v2.IAppendObjectSpec} message AppendObjectSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppendObjectSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifMetagenerationNotMatch); + if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.routingToken); + if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) + $root.google.storage.v2.BidiWriteHandle.encode(message.writeHandle, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppendObjectSpec message, length delimited. Does not implicitly {@link google.storage.v2.AppendObjectSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {google.storage.v2.IAppendObjectSpec} message AppendObjectSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppendObjectSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppendObjectSpec message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.AppendObjectSpec} AppendObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppendObjectSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.AppendObjectSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 6: { + message.routingToken = reader.string(); + break; + } + case 7: { + message.writeHandle = $root.google.storage.v2.BidiWriteHandle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppendObjectSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.AppendObjectSpec} AppendObjectSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppendObjectSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppendObjectSpec message. + * @function verify + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppendObjectSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + properties._routingToken = 1; + if (!$util.isString(message.routingToken)) + return "routingToken: string expected"; + } + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + properties._writeHandle = 1; + { + var error = $root.google.storage.v2.BidiWriteHandle.verify(message.writeHandle); + if (error) + return "writeHandle." + error; + } + } + return null; + }; + + /** + * Creates an AppendObjectSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.AppendObjectSpec} AppendObjectSpec + */ + AppendObjectSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.AppendObjectSpec) + return object; + var message = new $root.google.storage.v2.AppendObjectSpec(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.routingToken != null) + message.routingToken = String(object.routingToken); + if (object.writeHandle != null) { + if (typeof object.writeHandle !== "object") + throw TypeError(".google.storage.v2.AppendObjectSpec.writeHandle: object expected"); + message.writeHandle = $root.google.storage.v2.BidiWriteHandle.fromObject(object.writeHandle); + } + return message; + }; + + /** + * Creates a plain object from an AppendObjectSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {google.storage.v2.AppendObjectSpec} message AppendObjectSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppendObjectSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { + object.routingToken = message.routingToken; + if (options.oneofs) + object._routingToken = "routingToken"; + } + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options); + if (options.oneofs) + object._writeHandle = "writeHandle"; + } + return object; + }; + + /** + * Converts this AppendObjectSpec to JSON. + * @function toJSON + * @memberof google.storage.v2.AppendObjectSpec + * @instance + * @returns {Object.} JSON object + */ + AppendObjectSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppendObjectSpec + * @function getTypeUrl + * @memberof google.storage.v2.AppendObjectSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppendObjectSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.AppendObjectSpec"; + }; + + return AppendObjectSpec; + })(); + + v2.BidiWriteObjectRequest = (function() { + + /** + * Properties of a BidiWriteObjectRequest. + * @memberof google.storage.v2 + * @interface IBidiWriteObjectRequest + * @property {string|null} [uploadId] BidiWriteObjectRequest uploadId + * @property {google.storage.v2.IWriteObjectSpec|null} [writeObjectSpec] BidiWriteObjectRequest writeObjectSpec + * @property {google.storage.v2.IAppendObjectSpec|null} [appendObjectSpec] BidiWriteObjectRequest appendObjectSpec + * @property {number|Long|null} [writeOffset] BidiWriteObjectRequest writeOffset + * @property {google.storage.v2.IChecksummedData|null} [checksummedData] BidiWriteObjectRequest checksummedData + * @property {google.storage.v2.IObjectChecksums|null} [objectChecksums] BidiWriteObjectRequest objectChecksums + * @property {boolean|null} [stateLookup] BidiWriteObjectRequest stateLookup + * @property {boolean|null} [flush] BidiWriteObjectRequest flush + * @property {boolean|null} [finishWrite] BidiWriteObjectRequest finishWrite + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] BidiWriteObjectRequest commonObjectRequestParams + */ + + /** + * Constructs a new BidiWriteObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a BidiWriteObjectRequest. + * @implements IBidiWriteObjectRequest + * @constructor + * @param {google.storage.v2.IBidiWriteObjectRequest=} [properties] Properties to set + */ + function BidiWriteObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiWriteObjectRequest uploadId. + * @member {string|null|undefined} uploadId + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.uploadId = null; + + /** + * BidiWriteObjectRequest writeObjectSpec. + * @member {google.storage.v2.IWriteObjectSpec|null|undefined} writeObjectSpec + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.writeObjectSpec = null; + + /** + * BidiWriteObjectRequest appendObjectSpec. + * @member {google.storage.v2.IAppendObjectSpec|null|undefined} appendObjectSpec + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.appendObjectSpec = null; + + /** + * BidiWriteObjectRequest writeOffset. + * @member {number|Long} writeOffset + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.writeOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BidiWriteObjectRequest checksummedData. + * @member {google.storage.v2.IChecksummedData|null|undefined} checksummedData + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.checksummedData = null; + + /** + * BidiWriteObjectRequest objectChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} objectChecksums + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.objectChecksums = null; + + /** + * BidiWriteObjectRequest stateLookup. + * @member {boolean} stateLookup + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.stateLookup = false; + + /** + * BidiWriteObjectRequest flush. + * @member {boolean} flush + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.flush = false; + + /** + * BidiWriteObjectRequest finishWrite. + * @member {boolean} finishWrite + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.finishWrite = false; + + /** + * BidiWriteObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + BidiWriteObjectRequest.prototype.commonObjectRequestParams = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiWriteObjectRequest firstMessage. + * @member {"uploadId"|"writeObjectSpec"|"appendObjectSpec"|undefined} firstMessage + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + Object.defineProperty(BidiWriteObjectRequest.prototype, "firstMessage", { + get: $util.oneOfGetter($oneOfFields = ["uploadId", "writeObjectSpec", "appendObjectSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BidiWriteObjectRequest data. + * @member {"checksummedData"|undefined} data + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + */ + Object.defineProperty(BidiWriteObjectRequest.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["checksummedData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiWriteObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {google.storage.v2.IBidiWriteObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.BidiWriteObjectRequest} BidiWriteObjectRequest instance + */ + BidiWriteObjectRequest.create = function create(properties) { + return new BidiWriteObjectRequest(properties); + }; + + /** + * Encodes the specified BidiWriteObjectRequest message. Does not implicitly {@link google.storage.v2.BidiWriteObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {google.storage.v2.IBidiWriteObjectRequest} message BidiWriteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); + if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) + $root.google.storage.v2.WriteObjectSpec.encode(message.writeObjectSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.writeOffset != null && Object.hasOwnProperty.call(message, "writeOffset")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.writeOffset); + if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) + $root.google.storage.v2.ChecksummedData.encode(message.checksummedData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.stateLookup != null && Object.hasOwnProperty.call(message, "stateLookup")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.stateLookup); + if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.flush); + if (message.finishWrite != null && Object.hasOwnProperty.call(message, "finishWrite")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.finishWrite); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.appendObjectSpec != null && Object.hasOwnProperty.call(message, "appendObjectSpec")) + $root.google.storage.v2.AppendObjectSpec.encode(message.appendObjectSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiWriteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {google.storage.v2.IBidiWriteObjectRequest} message BidiWriteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiWriteObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiWriteObjectRequest} BidiWriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiWriteObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uploadId = reader.string(); + break; + } + case 2: { + message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.decode(reader, reader.uint32()); + break; + } + case 11: { + message.appendObjectSpec = $root.google.storage.v2.AppendObjectSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.writeOffset = reader.int64(); + break; + } + case 4: { + message.checksummedData = $root.google.storage.v2.ChecksummedData.decode(reader, reader.uint32()); + break; + } + case 6: { + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + case 7: { + message.stateLookup = reader.bool(); + break; + } + case 8: { + message.flush = reader.bool(); + break; + } + case 9: { + message.finishWrite = reader.bool(); + break; + } + case 10: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiWriteObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiWriteObjectRequest} BidiWriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiWriteObjectRequest message. + * @function verify + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiWriteObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { + properties.firstMessage = 1; + if (!$util.isString(message.uploadId)) + return "uploadId: string expected"; + } + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { + if (properties.firstMessage === 1) + return "firstMessage: multiple values"; + properties.firstMessage = 1; + { + var error = $root.google.storage.v2.WriteObjectSpec.verify(message.writeObjectSpec); + if (error) + return "writeObjectSpec." + error; + } + } + if (message.appendObjectSpec != null && message.hasOwnProperty("appendObjectSpec")) { + if (properties.firstMessage === 1) + return "firstMessage: multiple values"; + properties.firstMessage = 1; + { + var error = $root.google.storage.v2.AppendObjectSpec.verify(message.appendObjectSpec); + if (error) + return "appendObjectSpec." + error; + } + } + if (message.writeOffset != null && message.hasOwnProperty("writeOffset")) + if (!$util.isInteger(message.writeOffset) && !(message.writeOffset && $util.isInteger(message.writeOffset.low) && $util.isInteger(message.writeOffset.high))) + return "writeOffset: integer|Long expected"; + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { + properties.data = 1; + { + var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData); + if (error) + return "checksummedData." + error; + } + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums); + if (error) + return "objectChecksums." + error; + } + if (message.stateLookup != null && message.hasOwnProperty("stateLookup")) + if (typeof message.stateLookup !== "boolean") + return "stateLookup: boolean expected"; + if (message.flush != null && message.hasOwnProperty("flush")) + if (typeof message.flush !== "boolean") + return "flush: boolean expected"; + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) + if (typeof message.finishWrite !== "boolean") + return "finishWrite: boolean expected"; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + return null; + }; + + /** + * Creates a BidiWriteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiWriteObjectRequest} BidiWriteObjectRequest + */ + BidiWriteObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiWriteObjectRequest) + return object; + var message = new $root.google.storage.v2.BidiWriteObjectRequest(); + if (object.uploadId != null) + message.uploadId = String(object.uploadId); + if (object.writeObjectSpec != null) { + if (typeof object.writeObjectSpec !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectRequest.writeObjectSpec: object expected"); + message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.fromObject(object.writeObjectSpec); + } + if (object.appendObjectSpec != null) { + if (typeof object.appendObjectSpec !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectRequest.appendObjectSpec: object expected"); + message.appendObjectSpec = $root.google.storage.v2.AppendObjectSpec.fromObject(object.appendObjectSpec); + } + if (object.writeOffset != null) + if ($util.Long) + (message.writeOffset = $util.Long.fromValue(object.writeOffset)).unsigned = false; + else if (typeof object.writeOffset === "string") + message.writeOffset = parseInt(object.writeOffset, 10); + else if (typeof object.writeOffset === "number") + message.writeOffset = object.writeOffset; + else if (typeof object.writeOffset === "object") + message.writeOffset = new $util.LongBits(object.writeOffset.low >>> 0, object.writeOffset.high >>> 0).toNumber(); + if (object.checksummedData != null) { + if (typeof object.checksummedData !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectRequest.checksummedData: object expected"); + message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData); + } + if (object.objectChecksums != null) { + if (typeof object.objectChecksums !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectRequest.objectChecksums: object expected"); + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums); + } + if (object.stateLookup != null) + message.stateLookup = Boolean(object.stateLookup); + if (object.flush != null) + message.flush = Boolean(object.flush); + if (object.finishWrite != null) + message.finishWrite = Boolean(object.finishWrite); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + return message; + }; + + /** + * Creates a plain object from a BidiWriteObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {google.storage.v2.BidiWriteObjectRequest} message BidiWriteObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiWriteObjectRequest.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.writeOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.writeOffset = options.longs === String ? "0" : 0; + object.objectChecksums = null; + object.stateLookup = false; + object.flush = false; + object.finishWrite = false; + object.commonObjectRequestParams = null; + } + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { + object.uploadId = message.uploadId; + if (options.oneofs) + object.firstMessage = "uploadId"; + } + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { + object.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.toObject(message.writeObjectSpec, options); + if (options.oneofs) + object.firstMessage = "writeObjectSpec"; + } + if (message.writeOffset != null && message.hasOwnProperty("writeOffset")) + if (typeof message.writeOffset === "number") + object.writeOffset = options.longs === String ? String(message.writeOffset) : message.writeOffset; + else + object.writeOffset = options.longs === String ? $util.Long.prototype.toString.call(message.writeOffset) : options.longs === Number ? new $util.LongBits(message.writeOffset.low >>> 0, message.writeOffset.high >>> 0).toNumber() : message.writeOffset; + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { + object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options); + if (options.oneofs) + object.data = "checksummedData"; + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); + if (message.stateLookup != null && message.hasOwnProperty("stateLookup")) + object.stateLookup = message.stateLookup; + if (message.flush != null && message.hasOwnProperty("flush")) + object.flush = message.flush; + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) + object.finishWrite = message.finishWrite; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.appendObjectSpec != null && message.hasOwnProperty("appendObjectSpec")) { + object.appendObjectSpec = $root.google.storage.v2.AppendObjectSpec.toObject(message.appendObjectSpec, options); + if (options.oneofs) + object.firstMessage = "appendObjectSpec"; + } + return object; + }; + + /** + * Converts this BidiWriteObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiWriteObjectRequest + * @instance + * @returns {Object.} JSON object + */ + BidiWriteObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiWriteObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.BidiWriteObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiWriteObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiWriteObjectRequest"; + }; + + return BidiWriteObjectRequest; + })(); + + v2.BidiWriteObjectResponse = (function() { + + /** + * Properties of a BidiWriteObjectResponse. + * @memberof google.storage.v2 + * @interface IBidiWriteObjectResponse + * @property {number|Long|null} [persistedSize] BidiWriteObjectResponse persistedSize + * @property {google.storage.v2.IObject|null} [resource] BidiWriteObjectResponse resource + * @property {google.storage.v2.IObjectChecksums|null} [persistedDataChecksums] BidiWriteObjectResponse persistedDataChecksums + * @property {google.storage.v2.IBidiWriteHandle|null} [writeHandle] BidiWriteObjectResponse writeHandle + */ + + /** + * Constructs a new BidiWriteObjectResponse. + * @memberof google.storage.v2 + * @classdesc Represents a BidiWriteObjectResponse. + * @implements IBidiWriteObjectResponse + * @constructor + * @param {google.storage.v2.IBidiWriteObjectResponse=} [properties] Properties to set + */ + function BidiWriteObjectResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiWriteObjectResponse persistedSize. + * @member {number|Long|null|undefined} persistedSize + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + */ + BidiWriteObjectResponse.prototype.persistedSize = null; + + /** + * BidiWriteObjectResponse resource. + * @member {google.storage.v2.IObject|null|undefined} resource + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + */ + BidiWriteObjectResponse.prototype.resource = null; + + /** + * BidiWriteObjectResponse persistedDataChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} persistedDataChecksums + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + */ + BidiWriteObjectResponse.prototype.persistedDataChecksums = null; + + /** + * BidiWriteObjectResponse writeHandle. + * @member {google.storage.v2.IBidiWriteHandle|null|undefined} writeHandle + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + */ + BidiWriteObjectResponse.prototype.writeHandle = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiWriteObjectResponse writeStatus. + * @member {"persistedSize"|"resource"|undefined} writeStatus + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + */ + Object.defineProperty(BidiWriteObjectResponse.prototype, "writeStatus", { + get: $util.oneOfGetter($oneOfFields = ["persistedSize", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BidiWriteObjectResponse.prototype, "_writeHandle", { + get: $util.oneOfGetter($oneOfFields = ["writeHandle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiWriteObjectResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {google.storage.v2.IBidiWriteObjectResponse=} [properties] Properties to set + * @returns {google.storage.v2.BidiWriteObjectResponse} BidiWriteObjectResponse instance + */ + BidiWriteObjectResponse.create = function create(properties) { + return new BidiWriteObjectResponse(properties); + }; + + /** + * Encodes the specified BidiWriteObjectResponse message. Does not implicitly {@link google.storage.v2.BidiWriteObjectResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {google.storage.v2.IBidiWriteObjectResponse} message BidiWriteObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteObjectResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.persistedSize); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.storage.v2.Object.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) + $root.google.storage.v2.BidiWriteHandle.encode(message.writeHandle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiWriteObjectResponse message, length delimited. Does not implicitly {@link google.storage.v2.BidiWriteObjectResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {google.storage.v2.IBidiWriteObjectResponse} message BidiWriteObjectResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiWriteObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiWriteObjectResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BidiWriteObjectResponse} BidiWriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteObjectResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BidiWriteObjectResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persistedSize = reader.int64(); + break; + } + case 2: { + message.resource = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 4: { + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + case 3: { + message.writeHandle = $root.google.storage.v2.BidiWriteHandle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiWriteObjectResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BidiWriteObjectResponse} BidiWriteObjectResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiWriteObjectResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiWriteObjectResponse message. + * @function verify + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiWriteObjectResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { + properties.writeStatus = 1; + if (!$util.isInteger(message.persistedSize) && !(message.persistedSize && $util.isInteger(message.persistedSize.low) && $util.isInteger(message.persistedSize.high))) + return "persistedSize: integer|Long expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.writeStatus === 1) + return "writeStatus: multiple values"; + properties.writeStatus = 1; + { + var error = $root.google.storage.v2.Object.verify(message.resource); + if (error) + return "resource." + error; + } + } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums); + if (error) + return "persistedDataChecksums." + error; + } + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + properties._writeHandle = 1; + { + var error = $root.google.storage.v2.BidiWriteHandle.verify(message.writeHandle); + if (error) + return "writeHandle." + error; + } + } + return null; + }; + + /** + * Creates a BidiWriteObjectResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BidiWriteObjectResponse} BidiWriteObjectResponse + */ + BidiWriteObjectResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BidiWriteObjectResponse) + return object; + var message = new $root.google.storage.v2.BidiWriteObjectResponse(); + if (object.persistedSize != null) + if ($util.Long) + (message.persistedSize = $util.Long.fromValue(object.persistedSize)).unsigned = false; + else if (typeof object.persistedSize === "string") + message.persistedSize = parseInt(object.persistedSize, 10); + else if (typeof object.persistedSize === "number") + message.persistedSize = object.persistedSize; + else if (typeof object.persistedSize === "object") + message.persistedSize = new $util.LongBits(object.persistedSize.low >>> 0, object.persistedSize.high >>> 0).toNumber(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectResponse.resource: object expected"); + message.resource = $root.google.storage.v2.Object.fromObject(object.resource); + } + if (object.persistedDataChecksums != null) { + if (typeof object.persistedDataChecksums !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectResponse.persistedDataChecksums: object expected"); + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums); + } + if (object.writeHandle != null) { + if (typeof object.writeHandle !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectResponse.writeHandle: object expected"); + message.writeHandle = $root.google.storage.v2.BidiWriteHandle.fromObject(object.writeHandle); + } + return message; + }; + + /** + * Creates a plain object from a BidiWriteObjectResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {google.storage.v2.BidiWriteObjectResponse} message BidiWriteObjectResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiWriteObjectResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.persistedDataChecksums = null; + if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { + if (typeof message.persistedSize === "number") + object.persistedSize = options.longs === String ? String(message.persistedSize) : message.persistedSize; + else + object.persistedSize = options.longs === String ? $util.Long.prototype.toString.call(message.persistedSize) : options.longs === Number ? new $util.LongBits(message.persistedSize.low >>> 0, message.persistedSize.high >>> 0).toNumber() : message.persistedSize; + if (options.oneofs) + object.writeStatus = "persistedSize"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.storage.v2.Object.toObject(message.resource, options); + if (options.oneofs) + object.writeStatus = "resource"; + } + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options); + if (options.oneofs) + object._writeHandle = "writeHandle"; + } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); + return object; + }; + + /** + * Converts this BidiWriteObjectResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + * @returns {Object.} JSON object + */ + BidiWriteObjectResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiWriteObjectResponse + * @function getTypeUrl + * @memberof google.storage.v2.BidiWriteObjectResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiWriteObjectResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BidiWriteObjectResponse"; + }; + + return BidiWriteObjectResponse; + })(); + + v2.ListObjectsRequest = (function() { + + /** + * Properties of a ListObjectsRequest. + * @memberof google.storage.v2 + * @interface IListObjectsRequest + * @property {string|null} [parent] ListObjectsRequest parent + * @property {number|null} [pageSize] ListObjectsRequest pageSize + * @property {string|null} [pageToken] ListObjectsRequest pageToken + * @property {string|null} [delimiter] ListObjectsRequest delimiter + * @property {boolean|null} [includeTrailingDelimiter] ListObjectsRequest includeTrailingDelimiter + * @property {string|null} [prefix] ListObjectsRequest prefix + * @property {boolean|null} [versions] ListObjectsRequest versions + * @property {google.protobuf.IFieldMask|null} [readMask] ListObjectsRequest readMask + * @property {string|null} [lexicographicStart] ListObjectsRequest lexicographicStart + * @property {string|null} [lexicographicEnd] ListObjectsRequest lexicographicEnd + * @property {boolean|null} [softDeleted] ListObjectsRequest softDeleted + * @property {boolean|null} [includeFoldersAsPrefixes] ListObjectsRequest includeFoldersAsPrefixes + * @property {string|null} [matchGlob] ListObjectsRequest matchGlob + * @property {string|null} [filter] ListObjectsRequest filter + */ + + /** + * Constructs a new ListObjectsRequest. + * @memberof google.storage.v2 + * @classdesc Represents a ListObjectsRequest. + * @implements IListObjectsRequest + * @constructor + * @param {google.storage.v2.IListObjectsRequest=} [properties] Properties to set + */ + function ListObjectsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListObjectsRequest parent. + * @member {string} parent + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.parent = ""; + + /** + * ListObjectsRequest pageSize. + * @member {number} pageSize + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.pageSize = 0; + + /** + * ListObjectsRequest pageToken. + * @member {string} pageToken + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.pageToken = ""; + + /** + * ListObjectsRequest delimiter. + * @member {string} delimiter + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.delimiter = ""; + + /** + * ListObjectsRequest includeTrailingDelimiter. + * @member {boolean} includeTrailingDelimiter + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.includeTrailingDelimiter = false; + + /** + * ListObjectsRequest prefix. + * @member {string} prefix + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.prefix = ""; + + /** + * ListObjectsRequest versions. + * @member {boolean} versions + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.versions = false; + + /** + * ListObjectsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.readMask = null; + + /** + * ListObjectsRequest lexicographicStart. + * @member {string} lexicographicStart + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.lexicographicStart = ""; + + /** + * ListObjectsRequest lexicographicEnd. + * @member {string} lexicographicEnd + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.lexicographicEnd = ""; + + /** + * ListObjectsRequest softDeleted. + * @member {boolean} softDeleted + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.softDeleted = false; + + /** + * ListObjectsRequest includeFoldersAsPrefixes. + * @member {boolean} includeFoldersAsPrefixes + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.includeFoldersAsPrefixes = false; + + /** + * ListObjectsRequest matchGlob. + * @member {string} matchGlob + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.matchGlob = ""; + + /** + * ListObjectsRequest filter. + * @member {string} filter + * @memberof google.storage.v2.ListObjectsRequest + * @instance + */ + ListObjectsRequest.prototype.filter = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListObjectsRequest.prototype, "_readMask", { + get: $util.oneOfGetter($oneOfFields = ["readMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListObjectsRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {google.storage.v2.IListObjectsRequest=} [properties] Properties to set + * @returns {google.storage.v2.ListObjectsRequest} ListObjectsRequest instance + */ + ListObjectsRequest.create = function create(properties) { + return new ListObjectsRequest(properties); + }; + + /** + * Encodes the specified ListObjectsRequest message. Does not implicitly {@link google.storage.v2.ListObjectsRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {google.storage.v2.IListObjectsRequest} message ListObjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListObjectsRequest.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.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.delimiter); + if (message.includeTrailingDelimiter != null && Object.hasOwnProperty.call(message, "includeTrailingDelimiter")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.includeTrailingDelimiter); + if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.prefix); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.versions); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lexicographicStart != null && Object.hasOwnProperty.call(message, "lexicographicStart")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.lexicographicStart); + if (message.lexicographicEnd != null && Object.hasOwnProperty.call(message, "lexicographicEnd")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.lexicographicEnd); + if (message.softDeleted != null && Object.hasOwnProperty.call(message, "softDeleted")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.softDeleted); + if (message.includeFoldersAsPrefixes != null && Object.hasOwnProperty.call(message, "includeFoldersAsPrefixes")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.includeFoldersAsPrefixes); + if (message.matchGlob != null && Object.hasOwnProperty.call(message, "matchGlob")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.matchGlob); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListObjectsRequest message, length delimited. Does not implicitly {@link google.storage.v2.ListObjectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {google.storage.v2.IListObjectsRequest} message ListObjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListObjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListObjectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ListObjectsRequest} ListObjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListObjectsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ListObjectsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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.delimiter = reader.string(); + break; + } + case 5: { + message.includeTrailingDelimiter = reader.bool(); + break; + } + case 6: { + message.prefix = reader.string(); + break; + } + case 7: { + message.versions = reader.bool(); + break; + } + case 8: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 10: { + message.lexicographicStart = reader.string(); + break; + } + case 11: { + message.lexicographicEnd = reader.string(); + break; + } + case 12: { + message.softDeleted = reader.bool(); + break; + } + case 13: { + message.includeFoldersAsPrefixes = reader.bool(); + break; + } + case 14: { + message.matchGlob = reader.string(); + break; + } + case 15: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListObjectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ListObjectsRequest} ListObjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListObjectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListObjectsRequest message. + * @function verify + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListObjectsRequest.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.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.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + if (message.includeTrailingDelimiter != null && message.hasOwnProperty("includeTrailingDelimiter")) + if (typeof message.includeTrailingDelimiter !== "boolean") + return "includeTrailingDelimiter: boolean expected"; + if (message.prefix != null && message.hasOwnProperty("prefix")) + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + if (message.versions != null && message.hasOwnProperty("versions")) + if (typeof message.versions !== "boolean") + return "versions: boolean expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + properties._readMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + } + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) + if (!$util.isString(message.lexicographicStart)) + return "lexicographicStart: string expected"; + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) + if (!$util.isString(message.lexicographicEnd)) + return "lexicographicEnd: string expected"; + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) + if (typeof message.softDeleted !== "boolean") + return "softDeleted: boolean expected"; + if (message.includeFoldersAsPrefixes != null && message.hasOwnProperty("includeFoldersAsPrefixes")) + if (typeof message.includeFoldersAsPrefixes !== "boolean") + return "includeFoldersAsPrefixes: boolean expected"; + if (message.matchGlob != null && message.hasOwnProperty("matchGlob")) + if (!$util.isString(message.matchGlob)) + return "matchGlob: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListObjectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ListObjectsRequest} ListObjectsRequest + */ + ListObjectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ListObjectsRequest) + return object; + var message = new $root.google.storage.v2.ListObjectsRequest(); + 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.delimiter != null) + message.delimiter = String(object.delimiter); + if (object.includeTrailingDelimiter != null) + message.includeTrailingDelimiter = Boolean(object.includeTrailingDelimiter); + if (object.prefix != null) + message.prefix = String(object.prefix); + if (object.versions != null) + message.versions = Boolean(object.versions); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.storage.v2.ListObjectsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.lexicographicStart != null) + message.lexicographicStart = String(object.lexicographicStart); + if (object.lexicographicEnd != null) + message.lexicographicEnd = String(object.lexicographicEnd); + if (object.softDeleted != null) + message.softDeleted = Boolean(object.softDeleted); + if (object.includeFoldersAsPrefixes != null) + message.includeFoldersAsPrefixes = Boolean(object.includeFoldersAsPrefixes); + if (object.matchGlob != null) + message.matchGlob = String(object.matchGlob); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListObjectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {google.storage.v2.ListObjectsRequest} message ListObjectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListObjectsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.delimiter = ""; + object.includeTrailingDelimiter = false; + object.prefix = ""; + object.versions = false; + object.lexicographicStart = ""; + object.lexicographicEnd = ""; + object.softDeleted = false; + object.includeFoldersAsPrefixes = false; + object.matchGlob = ""; + 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.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + if (message.includeTrailingDelimiter != null && message.hasOwnProperty("includeTrailingDelimiter")) + object.includeTrailingDelimiter = message.includeTrailingDelimiter; + if (message.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = message.prefix; + if (message.versions != null && message.hasOwnProperty("versions")) + object.versions = message.versions; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.oneofs) + object._readMask = "readMask"; + } + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) + object.lexicographicStart = message.lexicographicStart; + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) + object.lexicographicEnd = message.lexicographicEnd; + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) + object.softDeleted = message.softDeleted; + if (message.includeFoldersAsPrefixes != null && message.hasOwnProperty("includeFoldersAsPrefixes")) + object.includeFoldersAsPrefixes = message.includeFoldersAsPrefixes; + if (message.matchGlob != null && message.hasOwnProperty("matchGlob")) + object.matchGlob = message.matchGlob; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListObjectsRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.ListObjectsRequest + * @instance + * @returns {Object.} JSON object + */ + ListObjectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListObjectsRequest + * @function getTypeUrl + * @memberof google.storage.v2.ListObjectsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListObjectsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ListObjectsRequest"; + }; + + return ListObjectsRequest; + })(); + + v2.QueryWriteStatusRequest = (function() { + + /** + * Properties of a QueryWriteStatusRequest. + * @memberof google.storage.v2 + * @interface IQueryWriteStatusRequest + * @property {string|null} [uploadId] QueryWriteStatusRequest uploadId + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] QueryWriteStatusRequest commonObjectRequestParams + */ + + /** + * Constructs a new QueryWriteStatusRequest. + * @memberof google.storage.v2 + * @classdesc Represents a QueryWriteStatusRequest. + * @implements IQueryWriteStatusRequest + * @constructor + * @param {google.storage.v2.IQueryWriteStatusRequest=} [properties] Properties to set + */ + function QueryWriteStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryWriteStatusRequest uploadId. + * @member {string} uploadId + * @memberof google.storage.v2.QueryWriteStatusRequest + * @instance + */ + QueryWriteStatusRequest.prototype.uploadId = ""; + + /** + * QueryWriteStatusRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.QueryWriteStatusRequest + * @instance + */ + QueryWriteStatusRequest.prototype.commonObjectRequestParams = null; + + /** + * Creates a new QueryWriteStatusRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {google.storage.v2.IQueryWriteStatusRequest=} [properties] Properties to set + * @returns {google.storage.v2.QueryWriteStatusRequest} QueryWriteStatusRequest instance + */ + QueryWriteStatusRequest.create = function create(properties) { + return new QueryWriteStatusRequest(properties); + }; + + /** + * Encodes the specified QueryWriteStatusRequest message. Does not implicitly {@link google.storage.v2.QueryWriteStatusRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {google.storage.v2.IQueryWriteStatusRequest} message QueryWriteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryWriteStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryWriteStatusRequest message, length delimited. Does not implicitly {@link google.storage.v2.QueryWriteStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {google.storage.v2.IQueryWriteStatusRequest} message QueryWriteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryWriteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryWriteStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.QueryWriteStatusRequest} QueryWriteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryWriteStatusRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.QueryWriteStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uploadId = reader.string(); + break; + } + case 2: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryWriteStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.QueryWriteStatusRequest} QueryWriteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryWriteStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryWriteStatusRequest message. + * @function verify + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryWriteStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) + if (!$util.isString(message.uploadId)) + return "uploadId: string expected"; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + return null; + }; + + /** + * Creates a QueryWriteStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.QueryWriteStatusRequest} QueryWriteStatusRequest + */ + QueryWriteStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.QueryWriteStatusRequest) + return object; + var message = new $root.google.storage.v2.QueryWriteStatusRequest(); + if (object.uploadId != null) + message.uploadId = String(object.uploadId); + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.QueryWriteStatusRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + return message; + }; + + /** + * Creates a plain object from a QueryWriteStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {google.storage.v2.QueryWriteStatusRequest} message QueryWriteStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryWriteStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uploadId = ""; + object.commonObjectRequestParams = null; + } + if (message.uploadId != null && message.hasOwnProperty("uploadId")) + object.uploadId = message.uploadId; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + return object; + }; + + /** + * Converts this QueryWriteStatusRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.QueryWriteStatusRequest + * @instance + * @returns {Object.} JSON object + */ + QueryWriteStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryWriteStatusRequest + * @function getTypeUrl + * @memberof google.storage.v2.QueryWriteStatusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryWriteStatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.QueryWriteStatusRequest"; + }; + + return QueryWriteStatusRequest; + })(); + + v2.QueryWriteStatusResponse = (function() { + + /** + * Properties of a QueryWriteStatusResponse. + * @memberof google.storage.v2 + * @interface IQueryWriteStatusResponse + * @property {number|Long|null} [persistedSize] QueryWriteStatusResponse persistedSize + * @property {google.storage.v2.IObject|null} [resource] QueryWriteStatusResponse resource + * @property {google.storage.v2.IObjectChecksums|null} [persistedDataChecksums] QueryWriteStatusResponse persistedDataChecksums + */ + + /** + * Constructs a new QueryWriteStatusResponse. + * @memberof google.storage.v2 + * @classdesc Represents a QueryWriteStatusResponse. + * @implements IQueryWriteStatusResponse + * @constructor + * @param {google.storage.v2.IQueryWriteStatusResponse=} [properties] Properties to set + */ + function QueryWriteStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryWriteStatusResponse persistedSize. + * @member {number|Long|null|undefined} persistedSize + * @memberof google.storage.v2.QueryWriteStatusResponse + * @instance + */ + QueryWriteStatusResponse.prototype.persistedSize = null; + + /** + * QueryWriteStatusResponse resource. + * @member {google.storage.v2.IObject|null|undefined} resource + * @memberof google.storage.v2.QueryWriteStatusResponse + * @instance + */ + QueryWriteStatusResponse.prototype.resource = null; + + /** + * QueryWriteStatusResponse persistedDataChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} persistedDataChecksums + * @memberof google.storage.v2.QueryWriteStatusResponse + * @instance + */ + QueryWriteStatusResponse.prototype.persistedDataChecksums = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryWriteStatusResponse writeStatus. + * @member {"persistedSize"|"resource"|undefined} writeStatus + * @memberof google.storage.v2.QueryWriteStatusResponse + * @instance + */ + Object.defineProperty(QueryWriteStatusResponse.prototype, "writeStatus", { + get: $util.oneOfGetter($oneOfFields = ["persistedSize", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryWriteStatusResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {google.storage.v2.IQueryWriteStatusResponse=} [properties] Properties to set + * @returns {google.storage.v2.QueryWriteStatusResponse} QueryWriteStatusResponse instance + */ + QueryWriteStatusResponse.create = function create(properties) { + return new QueryWriteStatusResponse(properties); + }; + + /** + * Encodes the specified QueryWriteStatusResponse message. Does not implicitly {@link google.storage.v2.QueryWriteStatusResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {google.storage.v2.IQueryWriteStatusResponse} message QueryWriteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryWriteStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.persistedSize); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.storage.v2.Object.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryWriteStatusResponse message, length delimited. Does not implicitly {@link google.storage.v2.QueryWriteStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {google.storage.v2.IQueryWriteStatusResponse} message QueryWriteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryWriteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryWriteStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.QueryWriteStatusResponse} QueryWriteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryWriteStatusResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.QueryWriteStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persistedSize = reader.int64(); + break; + } + case 2: { + message.resource = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 3: { + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryWriteStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.QueryWriteStatusResponse} QueryWriteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryWriteStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryWriteStatusResponse message. + * @function verify + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryWriteStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { + properties.writeStatus = 1; + if (!$util.isInteger(message.persistedSize) && !(message.persistedSize && $util.isInteger(message.persistedSize.low) && $util.isInteger(message.persistedSize.high))) + return "persistedSize: integer|Long expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.writeStatus === 1) + return "writeStatus: multiple values"; + properties.writeStatus = 1; + { + var error = $root.google.storage.v2.Object.verify(message.resource); + if (error) + return "resource." + error; + } + } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums); + if (error) + return "persistedDataChecksums." + error; + } + return null; + }; + + /** + * Creates a QueryWriteStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.QueryWriteStatusResponse} QueryWriteStatusResponse + */ + QueryWriteStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.QueryWriteStatusResponse) + return object; + var message = new $root.google.storage.v2.QueryWriteStatusResponse(); + if (object.persistedSize != null) + if ($util.Long) + (message.persistedSize = $util.Long.fromValue(object.persistedSize)).unsigned = false; + else if (typeof object.persistedSize === "string") + message.persistedSize = parseInt(object.persistedSize, 10); + else if (typeof object.persistedSize === "number") + message.persistedSize = object.persistedSize; + else if (typeof object.persistedSize === "object") + message.persistedSize = new $util.LongBits(object.persistedSize.low >>> 0, object.persistedSize.high >>> 0).toNumber(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.storage.v2.QueryWriteStatusResponse.resource: object expected"); + message.resource = $root.google.storage.v2.Object.fromObject(object.resource); + } + if (object.persistedDataChecksums != null) { + if (typeof object.persistedDataChecksums !== "object") + throw TypeError(".google.storage.v2.QueryWriteStatusResponse.persistedDataChecksums: object expected"); + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums); + } + return message; + }; + + /** + * Creates a plain object from a QueryWriteStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {google.storage.v2.QueryWriteStatusResponse} message QueryWriteStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryWriteStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.persistedDataChecksums = null; + if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { + if (typeof message.persistedSize === "number") + object.persistedSize = options.longs === String ? String(message.persistedSize) : message.persistedSize; + else + object.persistedSize = options.longs === String ? $util.Long.prototype.toString.call(message.persistedSize) : options.longs === Number ? new $util.LongBits(message.persistedSize.low >>> 0, message.persistedSize.high >>> 0).toNumber() : message.persistedSize; + if (options.oneofs) + object.writeStatus = "persistedSize"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.storage.v2.Object.toObject(message.resource, options); + if (options.oneofs) + object.writeStatus = "resource"; + } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); + return object; + }; + + /** + * Converts this QueryWriteStatusResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.QueryWriteStatusResponse + * @instance + * @returns {Object.} JSON object + */ + QueryWriteStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryWriteStatusResponse + * @function getTypeUrl + * @memberof google.storage.v2.QueryWriteStatusResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryWriteStatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.QueryWriteStatusResponse"; + }; + + return QueryWriteStatusResponse; + })(); + + v2.RewriteObjectRequest = (function() { + + /** + * Properties of a RewriteObjectRequest. + * @memberof google.storage.v2 + * @interface IRewriteObjectRequest + * @property {string|null} [destinationName] RewriteObjectRequest destinationName + * @property {string|null} [destinationBucket] RewriteObjectRequest destinationBucket + * @property {string|null} [destinationKmsKey] RewriteObjectRequest destinationKmsKey + * @property {google.storage.v2.IObject|null} [destination] RewriteObjectRequest destination + * @property {string|null} [sourceBucket] RewriteObjectRequest sourceBucket + * @property {string|null} [sourceObject] RewriteObjectRequest sourceObject + * @property {number|Long|null} [sourceGeneration] RewriteObjectRequest sourceGeneration + * @property {string|null} [rewriteToken] RewriteObjectRequest rewriteToken + * @property {string|null} [destinationPredefinedAcl] RewriteObjectRequest destinationPredefinedAcl + * @property {number|Long|null} [ifGenerationMatch] RewriteObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] RewriteObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] RewriteObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] RewriteObjectRequest ifMetagenerationNotMatch + * @property {number|Long|null} [ifSourceGenerationMatch] RewriteObjectRequest ifSourceGenerationMatch + * @property {number|Long|null} [ifSourceGenerationNotMatch] RewriteObjectRequest ifSourceGenerationNotMatch + * @property {number|Long|null} [ifSourceMetagenerationMatch] RewriteObjectRequest ifSourceMetagenerationMatch + * @property {number|Long|null} [ifSourceMetagenerationNotMatch] RewriteObjectRequest ifSourceMetagenerationNotMatch + * @property {number|Long|null} [maxBytesRewrittenPerCall] RewriteObjectRequest maxBytesRewrittenPerCall + * @property {string|null} [copySourceEncryptionAlgorithm] RewriteObjectRequest copySourceEncryptionAlgorithm + * @property {Uint8Array|null} [copySourceEncryptionKeyBytes] RewriteObjectRequest copySourceEncryptionKeyBytes + * @property {Uint8Array|null} [copySourceEncryptionKeySha256Bytes] RewriteObjectRequest copySourceEncryptionKeySha256Bytes + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] RewriteObjectRequest commonObjectRequestParams + * @property {google.storage.v2.IObjectChecksums|null} [objectChecksums] RewriteObjectRequest objectChecksums + */ + + /** + * Constructs a new RewriteObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a RewriteObjectRequest. + * @implements IRewriteObjectRequest + * @constructor + * @param {google.storage.v2.IRewriteObjectRequest=} [properties] Properties to set + */ + function RewriteObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriteObjectRequest destinationName. + * @member {string} destinationName + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.destinationName = ""; + + /** + * RewriteObjectRequest destinationBucket. + * @member {string} destinationBucket + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.destinationBucket = ""; + + /** + * RewriteObjectRequest destinationKmsKey. + * @member {string} destinationKmsKey + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.destinationKmsKey = ""; + + /** + * RewriteObjectRequest destination. + * @member {google.storage.v2.IObject|null|undefined} destination + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.destination = null; + + /** + * RewriteObjectRequest sourceBucket. + * @member {string} sourceBucket + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.sourceBucket = ""; + + /** + * RewriteObjectRequest sourceObject. + * @member {string} sourceObject + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.sourceObject = ""; + + /** + * RewriteObjectRequest sourceGeneration. + * @member {number|Long} sourceGeneration + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.sourceGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RewriteObjectRequest rewriteToken. + * @member {string} rewriteToken + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.rewriteToken = ""; + + /** + * RewriteObjectRequest destinationPredefinedAcl. + * @member {string} destinationPredefinedAcl + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.destinationPredefinedAcl = ""; + + /** + * RewriteObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifGenerationMatch = null; + + /** + * RewriteObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * RewriteObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * RewriteObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * RewriteObjectRequest ifSourceGenerationMatch. + * @member {number|Long|null|undefined} ifSourceGenerationMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifSourceGenerationMatch = null; + + /** + * RewriteObjectRequest ifSourceGenerationNotMatch. + * @member {number|Long|null|undefined} ifSourceGenerationNotMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifSourceGenerationNotMatch = null; + + /** + * RewriteObjectRequest ifSourceMetagenerationMatch. + * @member {number|Long|null|undefined} ifSourceMetagenerationMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifSourceMetagenerationMatch = null; + + /** + * RewriteObjectRequest ifSourceMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifSourceMetagenerationNotMatch + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.ifSourceMetagenerationNotMatch = null; + + /** + * RewriteObjectRequest maxBytesRewrittenPerCall. + * @member {number|Long} maxBytesRewrittenPerCall + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.maxBytesRewrittenPerCall = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RewriteObjectRequest copySourceEncryptionAlgorithm. + * @member {string} copySourceEncryptionAlgorithm + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.copySourceEncryptionAlgorithm = ""; + + /** + * RewriteObjectRequest copySourceEncryptionKeyBytes. + * @member {Uint8Array} copySourceEncryptionKeyBytes + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.copySourceEncryptionKeyBytes = $util.newBuffer([]); + + /** + * RewriteObjectRequest copySourceEncryptionKeySha256Bytes. + * @member {Uint8Array} copySourceEncryptionKeySha256Bytes + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.copySourceEncryptionKeySha256Bytes = $util.newBuffer([]); + + /** + * RewriteObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.commonObjectRequestParams = null; + + /** + * RewriteObjectRequest objectChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} objectChecksums + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + */ + RewriteObjectRequest.prototype.objectChecksums = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifSourceGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifSourceGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifSourceMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RewriteObjectRequest.prototype, "_ifSourceMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RewriteObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {google.storage.v2.IRewriteObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.RewriteObjectRequest} RewriteObjectRequest instance + */ + RewriteObjectRequest.create = function create(properties) { + return new RewriteObjectRequest(properties); + }; + + /** + * Encodes the specified RewriteObjectRequest message. Does not implicitly {@link google.storage.v2.RewriteObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {google.storage.v2.IRewriteObjectRequest} message RewriteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriteObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.storage.v2.Object.encode(message.destination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sourceBucket != null && Object.hasOwnProperty.call(message, "sourceBucket")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBucket); + if (message.sourceObject != null && Object.hasOwnProperty.call(message, "sourceObject")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceObject); + if (message.sourceGeneration != null && Object.hasOwnProperty.call(message, "sourceGeneration")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sourceGeneration); + if (message.rewriteToken != null && Object.hasOwnProperty.call(message, "rewriteToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.rewriteToken); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.ifMetagenerationNotMatch); + if (message.ifSourceGenerationMatch != null && Object.hasOwnProperty.call(message, "ifSourceGenerationMatch")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.ifSourceGenerationMatch); + if (message.ifSourceGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifSourceGenerationNotMatch")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.ifSourceGenerationNotMatch); + if (message.ifSourceMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifSourceMetagenerationMatch")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.ifSourceMetagenerationMatch); + if (message.ifSourceMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifSourceMetagenerationNotMatch")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.ifSourceMetagenerationNotMatch); + if (message.maxBytesRewrittenPerCall != null && Object.hasOwnProperty.call(message, "maxBytesRewrittenPerCall")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.maxBytesRewrittenPerCall); + if (message.copySourceEncryptionAlgorithm != null && Object.hasOwnProperty.call(message, "copySourceEncryptionAlgorithm")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.copySourceEncryptionAlgorithm); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.copySourceEncryptionKeyBytes != null && Object.hasOwnProperty.call(message, "copySourceEncryptionKeyBytes")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.copySourceEncryptionKeyBytes); + if (message.copySourceEncryptionKeySha256Bytes != null && Object.hasOwnProperty.call(message, "copySourceEncryptionKeySha256Bytes")) + writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.copySourceEncryptionKeySha256Bytes); + if (message.destinationName != null && Object.hasOwnProperty.call(message, "destinationName")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.destinationName); + if (message.destinationBucket != null && Object.hasOwnProperty.call(message, "destinationBucket")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.destinationBucket); + if (message.destinationKmsKey != null && Object.hasOwnProperty.call(message, "destinationKmsKey")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.destinationKmsKey); + if (message.destinationPredefinedAcl != null && Object.hasOwnProperty.call(message, "destinationPredefinedAcl")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.destinationPredefinedAcl); + if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RewriteObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.RewriteObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {google.storage.v2.IRewriteObjectRequest} message RewriteObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriteObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.RewriteObjectRequest} RewriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriteObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.RewriteObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 24: { + message.destinationName = reader.string(); + break; + } + case 25: { + message.destinationBucket = reader.string(); + break; + } + case 27: { + message.destinationKmsKey = reader.string(); + break; + } + case 1: { + message.destination = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sourceBucket = reader.string(); + break; + } + case 3: { + message.sourceObject = reader.string(); + break; + } + case 4: { + message.sourceGeneration = reader.int64(); + break; + } + case 5: { + message.rewriteToken = reader.string(); + break; + } + case 28: { + message.destinationPredefinedAcl = reader.string(); + break; + } + case 7: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 8: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 9: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 10: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 11: { + message.ifSourceGenerationMatch = reader.int64(); + break; + } + case 12: { + message.ifSourceGenerationNotMatch = reader.int64(); + break; + } + case 13: { + message.ifSourceMetagenerationMatch = reader.int64(); + break; + } + case 14: { + message.ifSourceMetagenerationNotMatch = reader.int64(); + break; + } + case 15: { + message.maxBytesRewrittenPerCall = reader.int64(); + break; + } + case 16: { + message.copySourceEncryptionAlgorithm = reader.string(); + break; + } + case 21: { + message.copySourceEncryptionKeyBytes = reader.bytes(); + break; + } + case 22: { + message.copySourceEncryptionKeySha256Bytes = reader.bytes(); + break; + } + case 19: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 29: { + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RewriteObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.RewriteObjectRequest} RewriteObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriteObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriteObjectRequest message. + * @function verify + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriteObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.destinationName != null && message.hasOwnProperty("destinationName")) + if (!$util.isString(message.destinationName)) + return "destinationName: string expected"; + if (message.destinationBucket != null && message.hasOwnProperty("destinationBucket")) + if (!$util.isString(message.destinationBucket)) + return "destinationBucket: string expected"; + if (message.destinationKmsKey != null && message.hasOwnProperty("destinationKmsKey")) + if (!$util.isString(message.destinationKmsKey)) + return "destinationKmsKey: string expected"; + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.storage.v2.Object.verify(message.destination); + if (error) + return "destination." + error; + } + if (message.sourceBucket != null && message.hasOwnProperty("sourceBucket")) + if (!$util.isString(message.sourceBucket)) + return "sourceBucket: string expected"; + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) + if (!$util.isString(message.sourceObject)) + return "sourceObject: string expected"; + if (message.sourceGeneration != null && message.hasOwnProperty("sourceGeneration")) + if (!$util.isInteger(message.sourceGeneration) && !(message.sourceGeneration && $util.isInteger(message.sourceGeneration.low) && $util.isInteger(message.sourceGeneration.high))) + return "sourceGeneration: integer|Long expected"; + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) + if (!$util.isString(message.rewriteToken)) + return "rewriteToken: string expected"; + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) + if (!$util.isString(message.destinationPredefinedAcl)) + return "destinationPredefinedAcl: string expected"; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.ifSourceGenerationMatch != null && message.hasOwnProperty("ifSourceGenerationMatch")) { + properties._ifSourceGenerationMatch = 1; + if (!$util.isInteger(message.ifSourceGenerationMatch) && !(message.ifSourceGenerationMatch && $util.isInteger(message.ifSourceGenerationMatch.low) && $util.isInteger(message.ifSourceGenerationMatch.high))) + return "ifSourceGenerationMatch: integer|Long expected"; + } + if (message.ifSourceGenerationNotMatch != null && message.hasOwnProperty("ifSourceGenerationNotMatch")) { + properties._ifSourceGenerationNotMatch = 1; + if (!$util.isInteger(message.ifSourceGenerationNotMatch) && !(message.ifSourceGenerationNotMatch && $util.isInteger(message.ifSourceGenerationNotMatch.low) && $util.isInteger(message.ifSourceGenerationNotMatch.high))) + return "ifSourceGenerationNotMatch: integer|Long expected"; + } + if (message.ifSourceMetagenerationMatch != null && message.hasOwnProperty("ifSourceMetagenerationMatch")) { + properties._ifSourceMetagenerationMatch = 1; + if (!$util.isInteger(message.ifSourceMetagenerationMatch) && !(message.ifSourceMetagenerationMatch && $util.isInteger(message.ifSourceMetagenerationMatch.low) && $util.isInteger(message.ifSourceMetagenerationMatch.high))) + return "ifSourceMetagenerationMatch: integer|Long expected"; + } + if (message.ifSourceMetagenerationNotMatch != null && message.hasOwnProperty("ifSourceMetagenerationNotMatch")) { + properties._ifSourceMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifSourceMetagenerationNotMatch) && !(message.ifSourceMetagenerationNotMatch && $util.isInteger(message.ifSourceMetagenerationNotMatch.low) && $util.isInteger(message.ifSourceMetagenerationNotMatch.high))) + return "ifSourceMetagenerationNotMatch: integer|Long expected"; + } + if (message.maxBytesRewrittenPerCall != null && message.hasOwnProperty("maxBytesRewrittenPerCall")) + if (!$util.isInteger(message.maxBytesRewrittenPerCall) && !(message.maxBytesRewrittenPerCall && $util.isInteger(message.maxBytesRewrittenPerCall.low) && $util.isInteger(message.maxBytesRewrittenPerCall.high))) + return "maxBytesRewrittenPerCall: integer|Long expected"; + if (message.copySourceEncryptionAlgorithm != null && message.hasOwnProperty("copySourceEncryptionAlgorithm")) + if (!$util.isString(message.copySourceEncryptionAlgorithm)) + return "copySourceEncryptionAlgorithm: string expected"; + if (message.copySourceEncryptionKeyBytes != null && message.hasOwnProperty("copySourceEncryptionKeyBytes")) + if (!(message.copySourceEncryptionKeyBytes && typeof message.copySourceEncryptionKeyBytes.length === "number" || $util.isString(message.copySourceEncryptionKeyBytes))) + return "copySourceEncryptionKeyBytes: buffer expected"; + if (message.copySourceEncryptionKeySha256Bytes != null && message.hasOwnProperty("copySourceEncryptionKeySha256Bytes")) + if (!(message.copySourceEncryptionKeySha256Bytes && typeof message.copySourceEncryptionKeySha256Bytes.length === "number" || $util.isString(message.copySourceEncryptionKeySha256Bytes))) + return "copySourceEncryptionKeySha256Bytes: buffer expected"; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums); + if (error) + return "objectChecksums." + error; + } + return null; + }; + + /** + * Creates a RewriteObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.RewriteObjectRequest} RewriteObjectRequest + */ + RewriteObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.RewriteObjectRequest) + return object; + var message = new $root.google.storage.v2.RewriteObjectRequest(); + if (object.destinationName != null) + message.destinationName = String(object.destinationName); + if (object.destinationBucket != null) + message.destinationBucket = String(object.destinationBucket); + if (object.destinationKmsKey != null) + message.destinationKmsKey = String(object.destinationKmsKey); + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.storage.v2.RewriteObjectRequest.destination: object expected"); + message.destination = $root.google.storage.v2.Object.fromObject(object.destination); + } + if (object.sourceBucket != null) + message.sourceBucket = String(object.sourceBucket); + if (object.sourceObject != null) + message.sourceObject = String(object.sourceObject); + if (object.sourceGeneration != null) + if ($util.Long) + (message.sourceGeneration = $util.Long.fromValue(object.sourceGeneration)).unsigned = false; + else if (typeof object.sourceGeneration === "string") + message.sourceGeneration = parseInt(object.sourceGeneration, 10); + else if (typeof object.sourceGeneration === "number") + message.sourceGeneration = object.sourceGeneration; + else if (typeof object.sourceGeneration === "object") + message.sourceGeneration = new $util.LongBits(object.sourceGeneration.low >>> 0, object.sourceGeneration.high >>> 0).toNumber(); + if (object.rewriteToken != null) + message.rewriteToken = String(object.rewriteToken); + if (object.destinationPredefinedAcl != null) + message.destinationPredefinedAcl = String(object.destinationPredefinedAcl); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.ifSourceGenerationMatch != null) + if ($util.Long) + (message.ifSourceGenerationMatch = $util.Long.fromValue(object.ifSourceGenerationMatch)).unsigned = false; + else if (typeof object.ifSourceGenerationMatch === "string") + message.ifSourceGenerationMatch = parseInt(object.ifSourceGenerationMatch, 10); + else if (typeof object.ifSourceGenerationMatch === "number") + message.ifSourceGenerationMatch = object.ifSourceGenerationMatch; + else if (typeof object.ifSourceGenerationMatch === "object") + message.ifSourceGenerationMatch = new $util.LongBits(object.ifSourceGenerationMatch.low >>> 0, object.ifSourceGenerationMatch.high >>> 0).toNumber(); + if (object.ifSourceGenerationNotMatch != null) + if ($util.Long) + (message.ifSourceGenerationNotMatch = $util.Long.fromValue(object.ifSourceGenerationNotMatch)).unsigned = false; + else if (typeof object.ifSourceGenerationNotMatch === "string") + message.ifSourceGenerationNotMatch = parseInt(object.ifSourceGenerationNotMatch, 10); + else if (typeof object.ifSourceGenerationNotMatch === "number") + message.ifSourceGenerationNotMatch = object.ifSourceGenerationNotMatch; + else if (typeof object.ifSourceGenerationNotMatch === "object") + message.ifSourceGenerationNotMatch = new $util.LongBits(object.ifSourceGenerationNotMatch.low >>> 0, object.ifSourceGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifSourceMetagenerationMatch != null) + if ($util.Long) + (message.ifSourceMetagenerationMatch = $util.Long.fromValue(object.ifSourceMetagenerationMatch)).unsigned = false; + else if (typeof object.ifSourceMetagenerationMatch === "string") + message.ifSourceMetagenerationMatch = parseInt(object.ifSourceMetagenerationMatch, 10); + else if (typeof object.ifSourceMetagenerationMatch === "number") + message.ifSourceMetagenerationMatch = object.ifSourceMetagenerationMatch; + else if (typeof object.ifSourceMetagenerationMatch === "object") + message.ifSourceMetagenerationMatch = new $util.LongBits(object.ifSourceMetagenerationMatch.low >>> 0, object.ifSourceMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifSourceMetagenerationNotMatch != null) + if ($util.Long) + (message.ifSourceMetagenerationNotMatch = $util.Long.fromValue(object.ifSourceMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifSourceMetagenerationNotMatch === "string") + message.ifSourceMetagenerationNotMatch = parseInt(object.ifSourceMetagenerationNotMatch, 10); + else if (typeof object.ifSourceMetagenerationNotMatch === "number") + message.ifSourceMetagenerationNotMatch = object.ifSourceMetagenerationNotMatch; + else if (typeof object.ifSourceMetagenerationNotMatch === "object") + message.ifSourceMetagenerationNotMatch = new $util.LongBits(object.ifSourceMetagenerationNotMatch.low >>> 0, object.ifSourceMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.maxBytesRewrittenPerCall != null) + if ($util.Long) + (message.maxBytesRewrittenPerCall = $util.Long.fromValue(object.maxBytesRewrittenPerCall)).unsigned = false; + else if (typeof object.maxBytesRewrittenPerCall === "string") + message.maxBytesRewrittenPerCall = parseInt(object.maxBytesRewrittenPerCall, 10); + else if (typeof object.maxBytesRewrittenPerCall === "number") + message.maxBytesRewrittenPerCall = object.maxBytesRewrittenPerCall; + else if (typeof object.maxBytesRewrittenPerCall === "object") + message.maxBytesRewrittenPerCall = new $util.LongBits(object.maxBytesRewrittenPerCall.low >>> 0, object.maxBytesRewrittenPerCall.high >>> 0).toNumber(); + if (object.copySourceEncryptionAlgorithm != null) + message.copySourceEncryptionAlgorithm = String(object.copySourceEncryptionAlgorithm); + if (object.copySourceEncryptionKeyBytes != null) + if (typeof object.copySourceEncryptionKeyBytes === "string") + $util.base64.decode(object.copySourceEncryptionKeyBytes, message.copySourceEncryptionKeyBytes = $util.newBuffer($util.base64.length(object.copySourceEncryptionKeyBytes)), 0); + else if (object.copySourceEncryptionKeyBytes.length >= 0) + message.copySourceEncryptionKeyBytes = object.copySourceEncryptionKeyBytes; + if (object.copySourceEncryptionKeySha256Bytes != null) + if (typeof object.copySourceEncryptionKeySha256Bytes === "string") + $util.base64.decode(object.copySourceEncryptionKeySha256Bytes, message.copySourceEncryptionKeySha256Bytes = $util.newBuffer($util.base64.length(object.copySourceEncryptionKeySha256Bytes)), 0); + else if (object.copySourceEncryptionKeySha256Bytes.length >= 0) + message.copySourceEncryptionKeySha256Bytes = object.copySourceEncryptionKeySha256Bytes; + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.RewriteObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.objectChecksums != null) { + if (typeof object.objectChecksums !== "object") + throw TypeError(".google.storage.v2.RewriteObjectRequest.objectChecksums: object expected"); + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums); + } + return message; + }; + + /** + * Creates a plain object from a RewriteObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {google.storage.v2.RewriteObjectRequest} message RewriteObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriteObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destination = null; + object.sourceBucket = ""; + object.sourceObject = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sourceGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sourceGeneration = options.longs === String ? "0" : 0; + object.rewriteToken = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytesRewrittenPerCall = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytesRewrittenPerCall = options.longs === String ? "0" : 0; + object.copySourceEncryptionAlgorithm = ""; + object.commonObjectRequestParams = null; + if (options.bytes === String) + object.copySourceEncryptionKeyBytes = ""; + else { + object.copySourceEncryptionKeyBytes = []; + if (options.bytes !== Array) + object.copySourceEncryptionKeyBytes = $util.newBuffer(object.copySourceEncryptionKeyBytes); + } + if (options.bytes === String) + object.copySourceEncryptionKeySha256Bytes = ""; + else { + object.copySourceEncryptionKeySha256Bytes = []; + if (options.bytes !== Array) + object.copySourceEncryptionKeySha256Bytes = $util.newBuffer(object.copySourceEncryptionKeySha256Bytes); + } + object.destinationName = ""; + object.destinationBucket = ""; + object.destinationKmsKey = ""; + object.destinationPredefinedAcl = ""; + object.objectChecksums = null; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.storage.v2.Object.toObject(message.destination, options); + if (message.sourceBucket != null && message.hasOwnProperty("sourceBucket")) + object.sourceBucket = message.sourceBucket; + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) + object.sourceObject = message.sourceObject; + if (message.sourceGeneration != null && message.hasOwnProperty("sourceGeneration")) + if (typeof message.sourceGeneration === "number") + object.sourceGeneration = options.longs === String ? String(message.sourceGeneration) : message.sourceGeneration; + else + object.sourceGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.sourceGeneration) : options.longs === Number ? new $util.LongBits(message.sourceGeneration.low >>> 0, message.sourceGeneration.high >>> 0).toNumber() : message.sourceGeneration; + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) + object.rewriteToken = message.rewriteToken; + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.ifSourceGenerationMatch != null && message.hasOwnProperty("ifSourceGenerationMatch")) { + if (typeof message.ifSourceGenerationMatch === "number") + object.ifSourceGenerationMatch = options.longs === String ? String(message.ifSourceGenerationMatch) : message.ifSourceGenerationMatch; + else + object.ifSourceGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceGenerationMatch.low >>> 0, message.ifSourceGenerationMatch.high >>> 0).toNumber() : message.ifSourceGenerationMatch; + if (options.oneofs) + object._ifSourceGenerationMatch = "ifSourceGenerationMatch"; + } + if (message.ifSourceGenerationNotMatch != null && message.hasOwnProperty("ifSourceGenerationNotMatch")) { + if (typeof message.ifSourceGenerationNotMatch === "number") + object.ifSourceGenerationNotMatch = options.longs === String ? String(message.ifSourceGenerationNotMatch) : message.ifSourceGenerationNotMatch; + else + object.ifSourceGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceGenerationNotMatch.low >>> 0, message.ifSourceGenerationNotMatch.high >>> 0).toNumber() : message.ifSourceGenerationNotMatch; + if (options.oneofs) + object._ifSourceGenerationNotMatch = "ifSourceGenerationNotMatch"; + } + if (message.ifSourceMetagenerationMatch != null && message.hasOwnProperty("ifSourceMetagenerationMatch")) { + if (typeof message.ifSourceMetagenerationMatch === "number") + object.ifSourceMetagenerationMatch = options.longs === String ? String(message.ifSourceMetagenerationMatch) : message.ifSourceMetagenerationMatch; + else + object.ifSourceMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceMetagenerationMatch.low >>> 0, message.ifSourceMetagenerationMatch.high >>> 0).toNumber() : message.ifSourceMetagenerationMatch; + if (options.oneofs) + object._ifSourceMetagenerationMatch = "ifSourceMetagenerationMatch"; + } + if (message.ifSourceMetagenerationNotMatch != null && message.hasOwnProperty("ifSourceMetagenerationNotMatch")) { + if (typeof message.ifSourceMetagenerationNotMatch === "number") + object.ifSourceMetagenerationNotMatch = options.longs === String ? String(message.ifSourceMetagenerationNotMatch) : message.ifSourceMetagenerationNotMatch; + else + object.ifSourceMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceMetagenerationNotMatch.low >>> 0, message.ifSourceMetagenerationNotMatch.high >>> 0).toNumber() : message.ifSourceMetagenerationNotMatch; + if (options.oneofs) + object._ifSourceMetagenerationNotMatch = "ifSourceMetagenerationNotMatch"; + } + if (message.maxBytesRewrittenPerCall != null && message.hasOwnProperty("maxBytesRewrittenPerCall")) + if (typeof message.maxBytesRewrittenPerCall === "number") + object.maxBytesRewrittenPerCall = options.longs === String ? String(message.maxBytesRewrittenPerCall) : message.maxBytesRewrittenPerCall; + else + object.maxBytesRewrittenPerCall = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytesRewrittenPerCall) : options.longs === Number ? new $util.LongBits(message.maxBytesRewrittenPerCall.low >>> 0, message.maxBytesRewrittenPerCall.high >>> 0).toNumber() : message.maxBytesRewrittenPerCall; + if (message.copySourceEncryptionAlgorithm != null && message.hasOwnProperty("copySourceEncryptionAlgorithm")) + object.copySourceEncryptionAlgorithm = message.copySourceEncryptionAlgorithm; + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.copySourceEncryptionKeyBytes != null && message.hasOwnProperty("copySourceEncryptionKeyBytes")) + object.copySourceEncryptionKeyBytes = options.bytes === String ? $util.base64.encode(message.copySourceEncryptionKeyBytes, 0, message.copySourceEncryptionKeyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.copySourceEncryptionKeyBytes) : message.copySourceEncryptionKeyBytes; + if (message.copySourceEncryptionKeySha256Bytes != null && message.hasOwnProperty("copySourceEncryptionKeySha256Bytes")) + object.copySourceEncryptionKeySha256Bytes = options.bytes === String ? $util.base64.encode(message.copySourceEncryptionKeySha256Bytes, 0, message.copySourceEncryptionKeySha256Bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.copySourceEncryptionKeySha256Bytes) : message.copySourceEncryptionKeySha256Bytes; + if (message.destinationName != null && message.hasOwnProperty("destinationName")) + object.destinationName = message.destinationName; + if (message.destinationBucket != null && message.hasOwnProperty("destinationBucket")) + object.destinationBucket = message.destinationBucket; + if (message.destinationKmsKey != null && message.hasOwnProperty("destinationKmsKey")) + object.destinationKmsKey = message.destinationKmsKey; + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) + object.destinationPredefinedAcl = message.destinationPredefinedAcl; + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); + return object; + }; + + /** + * Converts this RewriteObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.RewriteObjectRequest + * @instance + * @returns {Object.} JSON object + */ + RewriteObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriteObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.RewriteObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriteObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.RewriteObjectRequest"; + }; + + return RewriteObjectRequest; + })(); + + v2.RewriteResponse = (function() { + + /** + * Properties of a RewriteResponse. + * @memberof google.storage.v2 + * @interface IRewriteResponse + * @property {number|Long|null} [totalBytesRewritten] RewriteResponse totalBytesRewritten + * @property {number|Long|null} [objectSize] RewriteResponse objectSize + * @property {boolean|null} [done] RewriteResponse done + * @property {string|null} [rewriteToken] RewriteResponse rewriteToken + * @property {google.storage.v2.IObject|null} [resource] RewriteResponse resource + */ + + /** + * Constructs a new RewriteResponse. + * @memberof google.storage.v2 + * @classdesc Represents a RewriteResponse. + * @implements IRewriteResponse + * @constructor + * @param {google.storage.v2.IRewriteResponse=} [properties] Properties to set + */ + function RewriteResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriteResponse totalBytesRewritten. + * @member {number|Long} totalBytesRewritten + * @memberof google.storage.v2.RewriteResponse + * @instance + */ + RewriteResponse.prototype.totalBytesRewritten = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RewriteResponse objectSize. + * @member {number|Long} objectSize + * @memberof google.storage.v2.RewriteResponse + * @instance + */ + RewriteResponse.prototype.objectSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RewriteResponse done. + * @member {boolean} done + * @memberof google.storage.v2.RewriteResponse + * @instance + */ + RewriteResponse.prototype.done = false; + + /** + * RewriteResponse rewriteToken. + * @member {string} rewriteToken + * @memberof google.storage.v2.RewriteResponse + * @instance + */ + RewriteResponse.prototype.rewriteToken = ""; + + /** + * RewriteResponse resource. + * @member {google.storage.v2.IObject|null|undefined} resource + * @memberof google.storage.v2.RewriteResponse + * @instance + */ + RewriteResponse.prototype.resource = null; + + /** + * Creates a new RewriteResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {google.storage.v2.IRewriteResponse=} [properties] Properties to set + * @returns {google.storage.v2.RewriteResponse} RewriteResponse instance + */ + RewriteResponse.create = function create(properties) { + return new RewriteResponse(properties); + }; + + /** + * Encodes the specified RewriteResponse message. Does not implicitly {@link google.storage.v2.RewriteResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {google.storage.v2.IRewriteResponse} message RewriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalBytesRewritten != null && Object.hasOwnProperty.call(message, "totalBytesRewritten")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalBytesRewritten); + if (message.objectSize != null && Object.hasOwnProperty.call(message, "objectSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.objectSize); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.rewriteToken != null && Object.hasOwnProperty.call(message, "rewriteToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rewriteToken); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.storage.v2.Object.encode(message.resource, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RewriteResponse message, length delimited. Does not implicitly {@link google.storage.v2.RewriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {google.storage.v2.IRewriteResponse} message RewriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.RewriteResponse} RewriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriteResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.RewriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalBytesRewritten = reader.int64(); + break; + } + case 2: { + message.objectSize = reader.int64(); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.rewriteToken = reader.string(); + break; + } + case 5: { + message.resource = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RewriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.RewriteResponse} RewriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriteResponse message. + * @function verify + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalBytesRewritten != null && message.hasOwnProperty("totalBytesRewritten")) + if (!$util.isInteger(message.totalBytesRewritten) && !(message.totalBytesRewritten && $util.isInteger(message.totalBytesRewritten.low) && $util.isInteger(message.totalBytesRewritten.high))) + return "totalBytesRewritten: integer|Long expected"; + if (message.objectSize != null && message.hasOwnProperty("objectSize")) + if (!$util.isInteger(message.objectSize) && !(message.objectSize && $util.isInteger(message.objectSize.low) && $util.isInteger(message.objectSize.high))) + return "objectSize: integer|Long expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) + if (!$util.isString(message.rewriteToken)) + return "rewriteToken: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.storage.v2.Object.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a RewriteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.RewriteResponse} RewriteResponse + */ + RewriteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.RewriteResponse) + return object; + var message = new $root.google.storage.v2.RewriteResponse(); + if (object.totalBytesRewritten != null) + if ($util.Long) + (message.totalBytesRewritten = $util.Long.fromValue(object.totalBytesRewritten)).unsigned = false; + else if (typeof object.totalBytesRewritten === "string") + message.totalBytesRewritten = parseInt(object.totalBytesRewritten, 10); + else if (typeof object.totalBytesRewritten === "number") + message.totalBytesRewritten = object.totalBytesRewritten; + else if (typeof object.totalBytesRewritten === "object") + message.totalBytesRewritten = new $util.LongBits(object.totalBytesRewritten.low >>> 0, object.totalBytesRewritten.high >>> 0).toNumber(); + if (object.objectSize != null) + if ($util.Long) + (message.objectSize = $util.Long.fromValue(object.objectSize)).unsigned = false; + else if (typeof object.objectSize === "string") + message.objectSize = parseInt(object.objectSize, 10); + else if (typeof object.objectSize === "number") + message.objectSize = object.objectSize; + else if (typeof object.objectSize === "object") + message.objectSize = new $util.LongBits(object.objectSize.low >>> 0, object.objectSize.high >>> 0).toNumber(); + if (object.done != null) + message.done = Boolean(object.done); + if (object.rewriteToken != null) + message.rewriteToken = String(object.rewriteToken); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.storage.v2.RewriteResponse.resource: object expected"); + message.resource = $root.google.storage.v2.Object.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a RewriteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {google.storage.v2.RewriteResponse} message RewriteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriteResponse.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.totalBytesRewritten = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBytesRewritten = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectSize = options.longs === String ? "0" : 0; + object.done = false; + object.rewriteToken = ""; + object.resource = null; + } + if (message.totalBytesRewritten != null && message.hasOwnProperty("totalBytesRewritten")) + if (typeof message.totalBytesRewritten === "number") + object.totalBytesRewritten = options.longs === String ? String(message.totalBytesRewritten) : message.totalBytesRewritten; + else + object.totalBytesRewritten = options.longs === String ? $util.Long.prototype.toString.call(message.totalBytesRewritten) : options.longs === Number ? new $util.LongBits(message.totalBytesRewritten.low >>> 0, message.totalBytesRewritten.high >>> 0).toNumber() : message.totalBytesRewritten; + if (message.objectSize != null && message.hasOwnProperty("objectSize")) + if (typeof message.objectSize === "number") + object.objectSize = options.longs === String ? String(message.objectSize) : message.objectSize; + else + object.objectSize = options.longs === String ? $util.Long.prototype.toString.call(message.objectSize) : options.longs === Number ? new $util.LongBits(message.objectSize.low >>> 0, message.objectSize.high >>> 0).toNumber() : message.objectSize; + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) + object.rewriteToken = message.rewriteToken; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.storage.v2.Object.toObject(message.resource, options); + return object; + }; + + /** + * Converts this RewriteResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.RewriteResponse + * @instance + * @returns {Object.} JSON object + */ + RewriteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriteResponse + * @function getTypeUrl + * @memberof google.storage.v2.RewriteResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.RewriteResponse"; + }; + + return RewriteResponse; + })(); + + v2.MoveObjectRequest = (function() { + + /** + * Properties of a MoveObjectRequest. + * @memberof google.storage.v2 + * @interface IMoveObjectRequest + * @property {string|null} [bucket] MoveObjectRequest bucket + * @property {string|null} [sourceObject] MoveObjectRequest sourceObject + * @property {string|null} [destinationObject] MoveObjectRequest destinationObject + * @property {number|Long|null} [ifSourceGenerationMatch] MoveObjectRequest ifSourceGenerationMatch + * @property {number|Long|null} [ifSourceGenerationNotMatch] MoveObjectRequest ifSourceGenerationNotMatch + * @property {number|Long|null} [ifSourceMetagenerationMatch] MoveObjectRequest ifSourceMetagenerationMatch + * @property {number|Long|null} [ifSourceMetagenerationNotMatch] MoveObjectRequest ifSourceMetagenerationNotMatch + * @property {number|Long|null} [ifGenerationMatch] MoveObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] MoveObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] MoveObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] MoveObjectRequest ifMetagenerationNotMatch + */ + + /** + * Constructs a new MoveObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents a MoveObjectRequest. + * @implements IMoveObjectRequest + * @constructor + * @param {google.storage.v2.IMoveObjectRequest=} [properties] Properties to set + */ + function MoveObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveObjectRequest bucket. + * @member {string} bucket + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.bucket = ""; + + /** + * MoveObjectRequest sourceObject. + * @member {string} sourceObject + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.sourceObject = ""; + + /** + * MoveObjectRequest destinationObject. + * @member {string} destinationObject + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.destinationObject = ""; + + /** + * MoveObjectRequest ifSourceGenerationMatch. + * @member {number|Long|null|undefined} ifSourceGenerationMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifSourceGenerationMatch = null; + + /** + * MoveObjectRequest ifSourceGenerationNotMatch. + * @member {number|Long|null|undefined} ifSourceGenerationNotMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifSourceGenerationNotMatch = null; + + /** + * MoveObjectRequest ifSourceMetagenerationMatch. + * @member {number|Long|null|undefined} ifSourceMetagenerationMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifSourceMetagenerationMatch = null; + + /** + * MoveObjectRequest ifSourceMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifSourceMetagenerationNotMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifSourceMetagenerationNotMatch = null; + + /** + * MoveObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifGenerationMatch = null; + + /** + * MoveObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * MoveObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * MoveObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.MoveObjectRequest + * @instance + */ + MoveObjectRequest.prototype.ifMetagenerationNotMatch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifSourceGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifSourceGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifSourceMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifSourceMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifSourceMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MoveObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MoveObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {google.storage.v2.IMoveObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.MoveObjectRequest} MoveObjectRequest instance + */ + MoveObjectRequest.create = function create(properties) { + return new MoveObjectRequest(properties); + }; + + /** + * Encodes the specified MoveObjectRequest message. Does not implicitly {@link google.storage.v2.MoveObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {google.storage.v2.IMoveObjectRequest} message MoveObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.sourceObject != null && Object.hasOwnProperty.call(message, "sourceObject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceObject); + if (message.destinationObject != null && Object.hasOwnProperty.call(message, "destinationObject")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationObject); + if (message.ifSourceGenerationMatch != null && Object.hasOwnProperty.call(message, "ifSourceGenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifSourceGenerationMatch); + if (message.ifSourceGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifSourceGenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifSourceGenerationNotMatch); + if (message.ifSourceMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifSourceMetagenerationMatch")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.ifSourceMetagenerationMatch); + if (message.ifSourceMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifSourceMetagenerationNotMatch")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ifSourceMetagenerationNotMatch); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.ifMetagenerationNotMatch); + return writer; + }; + + /** + * Encodes the specified MoveObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.MoveObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {google.storage.v2.IMoveObjectRequest} message MoveObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.MoveObjectRequest} MoveObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.MoveObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.sourceObject = reader.string(); + break; + } + case 3: { + message.destinationObject = reader.string(); + break; + } + case 4: { + message.ifSourceGenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifSourceGenerationNotMatch = reader.int64(); + break; + } + case 6: { + message.ifSourceMetagenerationMatch = reader.int64(); + break; + } + case 7: { + message.ifSourceMetagenerationNotMatch = reader.int64(); + break; + } + case 8: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 9: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 10: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 11: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.MoveObjectRequest} MoveObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveObjectRequest message. + * @function verify + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) + if (!$util.isString(message.sourceObject)) + return "sourceObject: string expected"; + if (message.destinationObject != null && message.hasOwnProperty("destinationObject")) + if (!$util.isString(message.destinationObject)) + return "destinationObject: string expected"; + if (message.ifSourceGenerationMatch != null && message.hasOwnProperty("ifSourceGenerationMatch")) { + properties._ifSourceGenerationMatch = 1; + if (!$util.isInteger(message.ifSourceGenerationMatch) && !(message.ifSourceGenerationMatch && $util.isInteger(message.ifSourceGenerationMatch.low) && $util.isInteger(message.ifSourceGenerationMatch.high))) + return "ifSourceGenerationMatch: integer|Long expected"; + } + if (message.ifSourceGenerationNotMatch != null && message.hasOwnProperty("ifSourceGenerationNotMatch")) { + properties._ifSourceGenerationNotMatch = 1; + if (!$util.isInteger(message.ifSourceGenerationNotMatch) && !(message.ifSourceGenerationNotMatch && $util.isInteger(message.ifSourceGenerationNotMatch.low) && $util.isInteger(message.ifSourceGenerationNotMatch.high))) + return "ifSourceGenerationNotMatch: integer|Long expected"; + } + if (message.ifSourceMetagenerationMatch != null && message.hasOwnProperty("ifSourceMetagenerationMatch")) { + properties._ifSourceMetagenerationMatch = 1; + if (!$util.isInteger(message.ifSourceMetagenerationMatch) && !(message.ifSourceMetagenerationMatch && $util.isInteger(message.ifSourceMetagenerationMatch.low) && $util.isInteger(message.ifSourceMetagenerationMatch.high))) + return "ifSourceMetagenerationMatch: integer|Long expected"; + } + if (message.ifSourceMetagenerationNotMatch != null && message.hasOwnProperty("ifSourceMetagenerationNotMatch")) { + properties._ifSourceMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifSourceMetagenerationNotMatch) && !(message.ifSourceMetagenerationNotMatch && $util.isInteger(message.ifSourceMetagenerationNotMatch.low) && $util.isInteger(message.ifSourceMetagenerationNotMatch.high))) + return "ifSourceMetagenerationNotMatch: integer|Long expected"; + } + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + return null; + }; + + /** + * Creates a MoveObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.MoveObjectRequest} MoveObjectRequest + */ + MoveObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.MoveObjectRequest) + return object; + var message = new $root.google.storage.v2.MoveObjectRequest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.sourceObject != null) + message.sourceObject = String(object.sourceObject); + if (object.destinationObject != null) + message.destinationObject = String(object.destinationObject); + if (object.ifSourceGenerationMatch != null) + if ($util.Long) + (message.ifSourceGenerationMatch = $util.Long.fromValue(object.ifSourceGenerationMatch)).unsigned = false; + else if (typeof object.ifSourceGenerationMatch === "string") + message.ifSourceGenerationMatch = parseInt(object.ifSourceGenerationMatch, 10); + else if (typeof object.ifSourceGenerationMatch === "number") + message.ifSourceGenerationMatch = object.ifSourceGenerationMatch; + else if (typeof object.ifSourceGenerationMatch === "object") + message.ifSourceGenerationMatch = new $util.LongBits(object.ifSourceGenerationMatch.low >>> 0, object.ifSourceGenerationMatch.high >>> 0).toNumber(); + if (object.ifSourceGenerationNotMatch != null) + if ($util.Long) + (message.ifSourceGenerationNotMatch = $util.Long.fromValue(object.ifSourceGenerationNotMatch)).unsigned = false; + else if (typeof object.ifSourceGenerationNotMatch === "string") + message.ifSourceGenerationNotMatch = parseInt(object.ifSourceGenerationNotMatch, 10); + else if (typeof object.ifSourceGenerationNotMatch === "number") + message.ifSourceGenerationNotMatch = object.ifSourceGenerationNotMatch; + else if (typeof object.ifSourceGenerationNotMatch === "object") + message.ifSourceGenerationNotMatch = new $util.LongBits(object.ifSourceGenerationNotMatch.low >>> 0, object.ifSourceGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifSourceMetagenerationMatch != null) + if ($util.Long) + (message.ifSourceMetagenerationMatch = $util.Long.fromValue(object.ifSourceMetagenerationMatch)).unsigned = false; + else if (typeof object.ifSourceMetagenerationMatch === "string") + message.ifSourceMetagenerationMatch = parseInt(object.ifSourceMetagenerationMatch, 10); + else if (typeof object.ifSourceMetagenerationMatch === "number") + message.ifSourceMetagenerationMatch = object.ifSourceMetagenerationMatch; + else if (typeof object.ifSourceMetagenerationMatch === "object") + message.ifSourceMetagenerationMatch = new $util.LongBits(object.ifSourceMetagenerationMatch.low >>> 0, object.ifSourceMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifSourceMetagenerationNotMatch != null) + if ($util.Long) + (message.ifSourceMetagenerationNotMatch = $util.Long.fromValue(object.ifSourceMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifSourceMetagenerationNotMatch === "string") + message.ifSourceMetagenerationNotMatch = parseInt(object.ifSourceMetagenerationNotMatch, 10); + else if (typeof object.ifSourceMetagenerationNotMatch === "number") + message.ifSourceMetagenerationNotMatch = object.ifSourceMetagenerationNotMatch; + else if (typeof object.ifSourceMetagenerationNotMatch === "object") + message.ifSourceMetagenerationNotMatch = new $util.LongBits(object.ifSourceMetagenerationNotMatch.low >>> 0, object.ifSourceMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a MoveObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {google.storage.v2.MoveObjectRequest} message MoveObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.sourceObject = ""; + object.destinationObject = ""; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) + object.sourceObject = message.sourceObject; + if (message.destinationObject != null && message.hasOwnProperty("destinationObject")) + object.destinationObject = message.destinationObject; + if (message.ifSourceGenerationMatch != null && message.hasOwnProperty("ifSourceGenerationMatch")) { + if (typeof message.ifSourceGenerationMatch === "number") + object.ifSourceGenerationMatch = options.longs === String ? String(message.ifSourceGenerationMatch) : message.ifSourceGenerationMatch; + else + object.ifSourceGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceGenerationMatch.low >>> 0, message.ifSourceGenerationMatch.high >>> 0).toNumber() : message.ifSourceGenerationMatch; + if (options.oneofs) + object._ifSourceGenerationMatch = "ifSourceGenerationMatch"; + } + if (message.ifSourceGenerationNotMatch != null && message.hasOwnProperty("ifSourceGenerationNotMatch")) { + if (typeof message.ifSourceGenerationNotMatch === "number") + object.ifSourceGenerationNotMatch = options.longs === String ? String(message.ifSourceGenerationNotMatch) : message.ifSourceGenerationNotMatch; + else + object.ifSourceGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceGenerationNotMatch.low >>> 0, message.ifSourceGenerationNotMatch.high >>> 0).toNumber() : message.ifSourceGenerationNotMatch; + if (options.oneofs) + object._ifSourceGenerationNotMatch = "ifSourceGenerationNotMatch"; + } + if (message.ifSourceMetagenerationMatch != null && message.hasOwnProperty("ifSourceMetagenerationMatch")) { + if (typeof message.ifSourceMetagenerationMatch === "number") + object.ifSourceMetagenerationMatch = options.longs === String ? String(message.ifSourceMetagenerationMatch) : message.ifSourceMetagenerationMatch; + else + object.ifSourceMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceMetagenerationMatch.low >>> 0, message.ifSourceMetagenerationMatch.high >>> 0).toNumber() : message.ifSourceMetagenerationMatch; + if (options.oneofs) + object._ifSourceMetagenerationMatch = "ifSourceMetagenerationMatch"; + } + if (message.ifSourceMetagenerationNotMatch != null && message.hasOwnProperty("ifSourceMetagenerationNotMatch")) { + if (typeof message.ifSourceMetagenerationNotMatch === "number") + object.ifSourceMetagenerationNotMatch = options.longs === String ? String(message.ifSourceMetagenerationNotMatch) : message.ifSourceMetagenerationNotMatch; + else + object.ifSourceMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifSourceMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifSourceMetagenerationNotMatch.low >>> 0, message.ifSourceMetagenerationNotMatch.high >>> 0).toNumber() : message.ifSourceMetagenerationNotMatch; + if (options.oneofs) + object._ifSourceMetagenerationNotMatch = "ifSourceMetagenerationNotMatch"; + } + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + return object; + }; + + /** + * Converts this MoveObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.MoveObjectRequest + * @instance + * @returns {Object.} JSON object + */ + MoveObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.MoveObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.MoveObjectRequest"; + }; + + return MoveObjectRequest; + })(); + + v2.StartResumableWriteRequest = (function() { + + /** + * Properties of a StartResumableWriteRequest. + * @memberof google.storage.v2 + * @interface IStartResumableWriteRequest + * @property {google.storage.v2.IWriteObjectSpec|null} [writeObjectSpec] StartResumableWriteRequest writeObjectSpec + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] StartResumableWriteRequest commonObjectRequestParams + * @property {google.storage.v2.IObjectChecksums|null} [objectChecksums] StartResumableWriteRequest objectChecksums + */ + + /** + * Constructs a new StartResumableWriteRequest. + * @memberof google.storage.v2 + * @classdesc Represents a StartResumableWriteRequest. + * @implements IStartResumableWriteRequest + * @constructor + * @param {google.storage.v2.IStartResumableWriteRequest=} [properties] Properties to set + */ + function StartResumableWriteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartResumableWriteRequest writeObjectSpec. + * @member {google.storage.v2.IWriteObjectSpec|null|undefined} writeObjectSpec + * @memberof google.storage.v2.StartResumableWriteRequest + * @instance + */ + StartResumableWriteRequest.prototype.writeObjectSpec = null; + + /** + * StartResumableWriteRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.StartResumableWriteRequest + * @instance + */ + StartResumableWriteRequest.prototype.commonObjectRequestParams = null; + + /** + * StartResumableWriteRequest objectChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} objectChecksums + * @memberof google.storage.v2.StartResumableWriteRequest + * @instance + */ + StartResumableWriteRequest.prototype.objectChecksums = null; + + /** + * Creates a new StartResumableWriteRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {google.storage.v2.IStartResumableWriteRequest=} [properties] Properties to set + * @returns {google.storage.v2.StartResumableWriteRequest} StartResumableWriteRequest instance + */ + StartResumableWriteRequest.create = function create(properties) { + return new StartResumableWriteRequest(properties); + }; + + /** + * Encodes the specified StartResumableWriteRequest message. Does not implicitly {@link google.storage.v2.StartResumableWriteRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {google.storage.v2.IStartResumableWriteRequest} message StartResumableWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartResumableWriteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) + $root.google.storage.v2.WriteObjectSpec.encode(message.writeObjectSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartResumableWriteRequest message, length delimited. Does not implicitly {@link google.storage.v2.StartResumableWriteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {google.storage.v2.IStartResumableWriteRequest} message StartResumableWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartResumableWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartResumableWriteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.StartResumableWriteRequest} StartResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartResumableWriteRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.StartResumableWriteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 5: { + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartResumableWriteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.StartResumableWriteRequest} StartResumableWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartResumableWriteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartResumableWriteRequest message. + * @function verify + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartResumableWriteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { + var error = $root.google.storage.v2.WriteObjectSpec.verify(message.writeObjectSpec); + if (error) + return "writeObjectSpec." + error; + } + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums); + if (error) + return "objectChecksums." + error; + } + return null; + }; + + /** + * Creates a StartResumableWriteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.StartResumableWriteRequest} StartResumableWriteRequest + */ + StartResumableWriteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.StartResumableWriteRequest) + return object; + var message = new $root.google.storage.v2.StartResumableWriteRequest(); + if (object.writeObjectSpec != null) { + if (typeof object.writeObjectSpec !== "object") + throw TypeError(".google.storage.v2.StartResumableWriteRequest.writeObjectSpec: object expected"); + message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.fromObject(object.writeObjectSpec); + } + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.StartResumableWriteRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.objectChecksums != null) { + if (typeof object.objectChecksums !== "object") + throw TypeError(".google.storage.v2.StartResumableWriteRequest.objectChecksums: object expected"); + message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums); + } + return message; + }; + + /** + * Creates a plain object from a StartResumableWriteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {google.storage.v2.StartResumableWriteRequest} message StartResumableWriteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartResumableWriteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.writeObjectSpec = null; + object.commonObjectRequestParams = null; + object.objectChecksums = null; + } + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) + object.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.toObject(message.writeObjectSpec, options); + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); + return object; + }; + + /** + * Converts this StartResumableWriteRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.StartResumableWriteRequest + * @instance + * @returns {Object.} JSON object + */ + StartResumableWriteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartResumableWriteRequest + * @function getTypeUrl + * @memberof google.storage.v2.StartResumableWriteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartResumableWriteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.StartResumableWriteRequest"; + }; + + return StartResumableWriteRequest; + })(); + + v2.StartResumableWriteResponse = (function() { + + /** + * Properties of a StartResumableWriteResponse. + * @memberof google.storage.v2 + * @interface IStartResumableWriteResponse + * @property {string|null} [uploadId] StartResumableWriteResponse uploadId + */ + + /** + * Constructs a new StartResumableWriteResponse. + * @memberof google.storage.v2 + * @classdesc Represents a StartResumableWriteResponse. + * @implements IStartResumableWriteResponse + * @constructor + * @param {google.storage.v2.IStartResumableWriteResponse=} [properties] Properties to set + */ + function StartResumableWriteResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartResumableWriteResponse uploadId. + * @member {string} uploadId + * @memberof google.storage.v2.StartResumableWriteResponse + * @instance + */ + StartResumableWriteResponse.prototype.uploadId = ""; + + /** + * Creates a new StartResumableWriteResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {google.storage.v2.IStartResumableWriteResponse=} [properties] Properties to set + * @returns {google.storage.v2.StartResumableWriteResponse} StartResumableWriteResponse instance + */ + StartResumableWriteResponse.create = function create(properties) { + return new StartResumableWriteResponse(properties); + }; + + /** + * Encodes the specified StartResumableWriteResponse message. Does not implicitly {@link google.storage.v2.StartResumableWriteResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {google.storage.v2.IStartResumableWriteResponse} message StartResumableWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartResumableWriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); + return writer; + }; + + /** + * Encodes the specified StartResumableWriteResponse message, length delimited. Does not implicitly {@link google.storage.v2.StartResumableWriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {google.storage.v2.IStartResumableWriteResponse} message StartResumableWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartResumableWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartResumableWriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.StartResumableWriteResponse} StartResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartResumableWriteResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.StartResumableWriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uploadId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartResumableWriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.StartResumableWriteResponse} StartResumableWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartResumableWriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartResumableWriteResponse message. + * @function verify + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartResumableWriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) + if (!$util.isString(message.uploadId)) + return "uploadId: string expected"; + return null; + }; + + /** + * Creates a StartResumableWriteResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.StartResumableWriteResponse} StartResumableWriteResponse + */ + StartResumableWriteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.StartResumableWriteResponse) + return object; + var message = new $root.google.storage.v2.StartResumableWriteResponse(); + if (object.uploadId != null) + message.uploadId = String(object.uploadId); + return message; + }; + + /** + * Creates a plain object from a StartResumableWriteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {google.storage.v2.StartResumableWriteResponse} message StartResumableWriteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartResumableWriteResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uploadId = ""; + if (message.uploadId != null && message.hasOwnProperty("uploadId")) + object.uploadId = message.uploadId; + return object; + }; + + /** + * Converts this StartResumableWriteResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.StartResumableWriteResponse + * @instance + * @returns {Object.} JSON object + */ + StartResumableWriteResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartResumableWriteResponse + * @function getTypeUrl + * @memberof google.storage.v2.StartResumableWriteResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartResumableWriteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.StartResumableWriteResponse"; + }; + + return StartResumableWriteResponse; + })(); + + v2.UpdateObjectRequest = (function() { + + /** + * Properties of an UpdateObjectRequest. + * @memberof google.storage.v2 + * @interface IUpdateObjectRequest + * @property {google.storage.v2.IObject|null} [object] UpdateObjectRequest object + * @property {number|Long|null} [ifGenerationMatch] UpdateObjectRequest ifGenerationMatch + * @property {number|Long|null} [ifGenerationNotMatch] UpdateObjectRequest ifGenerationNotMatch + * @property {number|Long|null} [ifMetagenerationMatch] UpdateObjectRequest ifMetagenerationMatch + * @property {number|Long|null} [ifMetagenerationNotMatch] UpdateObjectRequest ifMetagenerationNotMatch + * @property {string|null} [predefinedAcl] UpdateObjectRequest predefinedAcl + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateObjectRequest updateMask + * @property {google.storage.v2.ICommonObjectRequestParams|null} [commonObjectRequestParams] UpdateObjectRequest commonObjectRequestParams + * @property {boolean|null} [overrideUnlockedRetention] UpdateObjectRequest overrideUnlockedRetention + */ + + /** + * Constructs a new UpdateObjectRequest. + * @memberof google.storage.v2 + * @classdesc Represents an UpdateObjectRequest. + * @implements IUpdateObjectRequest + * @constructor + * @param {google.storage.v2.IUpdateObjectRequest=} [properties] Properties to set + */ + function UpdateObjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateObjectRequest object. + * @member {google.storage.v2.IObject|null|undefined} object + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.object = null; + + /** + * UpdateObjectRequest ifGenerationMatch. + * @member {number|Long|null|undefined} ifGenerationMatch + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.ifGenerationMatch = null; + + /** + * UpdateObjectRequest ifGenerationNotMatch. + * @member {number|Long|null|undefined} ifGenerationNotMatch + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.ifGenerationNotMatch = null; + + /** + * UpdateObjectRequest ifMetagenerationMatch. + * @member {number|Long|null|undefined} ifMetagenerationMatch + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.ifMetagenerationMatch = null; + + /** + * UpdateObjectRequest ifMetagenerationNotMatch. + * @member {number|Long|null|undefined} ifMetagenerationNotMatch + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.ifMetagenerationNotMatch = null; + + /** + * UpdateObjectRequest predefinedAcl. + * @member {string} predefinedAcl + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.predefinedAcl = ""; + + /** + * UpdateObjectRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.updateMask = null; + + /** + * UpdateObjectRequest commonObjectRequestParams. + * @member {google.storage.v2.ICommonObjectRequestParams|null|undefined} commonObjectRequestParams + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.commonObjectRequestParams = null; + + /** + * UpdateObjectRequest overrideUnlockedRetention. + * @member {boolean} overrideUnlockedRetention + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + */ + UpdateObjectRequest.prototype.overrideUnlockedRetention = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateObjectRequest.prototype, "_ifGenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateObjectRequest.prototype, "_ifGenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifGenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateObjectRequest.prototype, "_ifMetagenerationMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UpdateObjectRequest.prototype, "_ifMetagenerationNotMatch", { + get: $util.oneOfGetter($oneOfFields = ["ifMetagenerationNotMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateObjectRequest instance using the specified properties. + * @function create + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {google.storage.v2.IUpdateObjectRequest=} [properties] Properties to set + * @returns {google.storage.v2.UpdateObjectRequest} UpdateObjectRequest instance + */ + UpdateObjectRequest.create = function create(properties) { + return new UpdateObjectRequest(properties); + }; + + /** + * Encodes the specified UpdateObjectRequest message. Does not implicitly {@link google.storage.v2.UpdateObjectRequest.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {google.storage.v2.IUpdateObjectRequest} message UpdateObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateObjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.google.storage.v2.Object.encode(message.object, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ifGenerationMatch); + if (message.ifGenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.ifGenerationNotMatch); + if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ifMetagenerationMatch); + if (message.ifMetagenerationNotMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ifMetagenerationNotMatch); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.predefinedAcl); + if (message.overrideUnlockedRetention != null && Object.hasOwnProperty.call(message, "overrideUnlockedRetention")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.overrideUnlockedRetention); + return writer; + }; + + /** + * Encodes the specified UpdateObjectRequest message, length delimited. Does not implicitly {@link google.storage.v2.UpdateObjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {google.storage.v2.IUpdateObjectRequest} message UpdateObjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateObjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.UpdateObjectRequest} UpdateObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateObjectRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.UpdateObjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.object = $root.google.storage.v2.Object.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ifGenerationMatch = reader.int64(); + break; + } + case 3: { + message.ifGenerationNotMatch = reader.int64(); + break; + } + case 4: { + message.ifMetagenerationMatch = reader.int64(); + break; + } + case 5: { + message.ifMetagenerationNotMatch = reader.int64(); + break; + } + case 10: { + message.predefinedAcl = reader.string(); + break; + } + case 7: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.decode(reader, reader.uint32()); + break; + } + case 11: { + message.overrideUnlockedRetention = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateObjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.UpdateObjectRequest} UpdateObjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateObjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateObjectRequest message. + * @function verify + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateObjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.google.storage.v2.Object.verify(message.object); + if (error) + return "object." + error; + } + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + properties._ifGenerationMatch = 1; + if (!$util.isInteger(message.ifGenerationMatch) && !(message.ifGenerationMatch && $util.isInteger(message.ifGenerationMatch.low) && $util.isInteger(message.ifGenerationMatch.high))) + return "ifGenerationMatch: integer|Long expected"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + properties._ifGenerationNotMatch = 1; + if (!$util.isInteger(message.ifGenerationNotMatch) && !(message.ifGenerationNotMatch && $util.isInteger(message.ifGenerationNotMatch.low) && $util.isInteger(message.ifGenerationNotMatch.high))) + return "ifGenerationNotMatch: integer|Long expected"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + properties._ifMetagenerationMatch = 1; + if (!$util.isInteger(message.ifMetagenerationMatch) && !(message.ifMetagenerationMatch && $util.isInteger(message.ifMetagenerationMatch.low) && $util.isInteger(message.ifMetagenerationMatch.high))) + return "ifMetagenerationMatch: integer|Long expected"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + properties._ifMetagenerationNotMatch = 1; + if (!$util.isInteger(message.ifMetagenerationNotMatch) && !(message.ifMetagenerationNotMatch && $util.isInteger(message.ifMetagenerationNotMatch.low) && $util.isInteger(message.ifMetagenerationNotMatch.high))) + return "ifMetagenerationNotMatch: integer|Long expected"; + } + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + if (!$util.isString(message.predefinedAcl)) + return "predefinedAcl: 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.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { + var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams); + if (error) + return "commonObjectRequestParams." + error; + } + if (message.overrideUnlockedRetention != null && message.hasOwnProperty("overrideUnlockedRetention")) + if (typeof message.overrideUnlockedRetention !== "boolean") + return "overrideUnlockedRetention: boolean expected"; + return null; + }; + + /** + * Creates an UpdateObjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.UpdateObjectRequest} UpdateObjectRequest + */ + UpdateObjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.UpdateObjectRequest) + return object; + var message = new $root.google.storage.v2.UpdateObjectRequest(); + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".google.storage.v2.UpdateObjectRequest.object: object expected"); + message.object = $root.google.storage.v2.Object.fromObject(object.object); + } + if (object.ifGenerationMatch != null) + if ($util.Long) + (message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch)).unsigned = false; + else if (typeof object.ifGenerationMatch === "string") + message.ifGenerationMatch = parseInt(object.ifGenerationMatch, 10); + else if (typeof object.ifGenerationMatch === "number") + message.ifGenerationMatch = object.ifGenerationMatch; + else if (typeof object.ifGenerationMatch === "object") + message.ifGenerationMatch = new $util.LongBits(object.ifGenerationMatch.low >>> 0, object.ifGenerationMatch.high >>> 0).toNumber(); + if (object.ifGenerationNotMatch != null) + if ($util.Long) + (message.ifGenerationNotMatch = $util.Long.fromValue(object.ifGenerationNotMatch)).unsigned = false; + else if (typeof object.ifGenerationNotMatch === "string") + message.ifGenerationNotMatch = parseInt(object.ifGenerationNotMatch, 10); + else if (typeof object.ifGenerationNotMatch === "number") + message.ifGenerationNotMatch = object.ifGenerationNotMatch; + else if (typeof object.ifGenerationNotMatch === "object") + message.ifGenerationNotMatch = new $util.LongBits(object.ifGenerationNotMatch.low >>> 0, object.ifGenerationNotMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationMatch != null) + if ($util.Long) + (message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch)).unsigned = false; + else if (typeof object.ifMetagenerationMatch === "string") + message.ifMetagenerationMatch = parseInt(object.ifMetagenerationMatch, 10); + else if (typeof object.ifMetagenerationMatch === "number") + message.ifMetagenerationMatch = object.ifMetagenerationMatch; + else if (typeof object.ifMetagenerationMatch === "object") + message.ifMetagenerationMatch = new $util.LongBits(object.ifMetagenerationMatch.low >>> 0, object.ifMetagenerationMatch.high >>> 0).toNumber(); + if (object.ifMetagenerationNotMatch != null) + if ($util.Long) + (message.ifMetagenerationNotMatch = $util.Long.fromValue(object.ifMetagenerationNotMatch)).unsigned = false; + else if (typeof object.ifMetagenerationNotMatch === "string") + message.ifMetagenerationNotMatch = parseInt(object.ifMetagenerationNotMatch, 10); + else if (typeof object.ifMetagenerationNotMatch === "number") + message.ifMetagenerationNotMatch = object.ifMetagenerationNotMatch; + else if (typeof object.ifMetagenerationNotMatch === "object") + message.ifMetagenerationNotMatch = new $util.LongBits(object.ifMetagenerationNotMatch.low >>> 0, object.ifMetagenerationNotMatch.high >>> 0).toNumber(); + if (object.predefinedAcl != null) + message.predefinedAcl = String(object.predefinedAcl); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storage.v2.UpdateObjectRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.commonObjectRequestParams != null) { + if (typeof object.commonObjectRequestParams !== "object") + throw TypeError(".google.storage.v2.UpdateObjectRequest.commonObjectRequestParams: object expected"); + message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams); + } + if (object.overrideUnlockedRetention != null) + message.overrideUnlockedRetention = Boolean(object.overrideUnlockedRetention); + return message; + }; + + /** + * Creates a plain object from an UpdateObjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {google.storage.v2.UpdateObjectRequest} message UpdateObjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateObjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.object = null; + object.updateMask = null; + object.commonObjectRequestParams = null; + object.predefinedAcl = ""; + object.overrideUnlockedRetention = false; + } + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.google.storage.v2.Object.toObject(message.object, options); + if (message.ifGenerationMatch != null && message.hasOwnProperty("ifGenerationMatch")) { + if (typeof message.ifGenerationMatch === "number") + object.ifGenerationMatch = options.longs === String ? String(message.ifGenerationMatch) : message.ifGenerationMatch; + else + object.ifGenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0).toNumber() : message.ifGenerationMatch; + if (options.oneofs) + object._ifGenerationMatch = "ifGenerationMatch"; + } + if (message.ifGenerationNotMatch != null && message.hasOwnProperty("ifGenerationNotMatch")) { + if (typeof message.ifGenerationNotMatch === "number") + object.ifGenerationNotMatch = options.longs === String ? String(message.ifGenerationNotMatch) : message.ifGenerationNotMatch; + else + object.ifGenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifGenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0).toNumber() : message.ifGenerationNotMatch; + if (options.oneofs) + object._ifGenerationNotMatch = "ifGenerationNotMatch"; + } + if (message.ifMetagenerationMatch != null && message.hasOwnProperty("ifMetagenerationMatch")) { + if (typeof message.ifMetagenerationMatch === "number") + object.ifMetagenerationMatch = options.longs === String ? String(message.ifMetagenerationMatch) : message.ifMetagenerationMatch; + else + object.ifMetagenerationMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0).toNumber() : message.ifMetagenerationMatch; + if (options.oneofs) + object._ifMetagenerationMatch = "ifMetagenerationMatch"; + } + if (message.ifMetagenerationNotMatch != null && message.hasOwnProperty("ifMetagenerationNotMatch")) { + if (typeof message.ifMetagenerationNotMatch === "number") + object.ifMetagenerationNotMatch = options.longs === String ? String(message.ifMetagenerationNotMatch) : message.ifMetagenerationNotMatch; + else + object.ifMetagenerationNotMatch = options.longs === String ? $util.Long.prototype.toString.call(message.ifMetagenerationNotMatch) : options.longs === Number ? new $util.LongBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0).toNumber() : message.ifMetagenerationNotMatch; + if (options.oneofs) + object._ifMetagenerationNotMatch = "ifMetagenerationNotMatch"; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) + object.predefinedAcl = message.predefinedAcl; + if (message.overrideUnlockedRetention != null && message.hasOwnProperty("overrideUnlockedRetention")) + object.overrideUnlockedRetention = message.overrideUnlockedRetention; + return object; + }; + + /** + * Converts this UpdateObjectRequest to JSON. + * @function toJSON + * @memberof google.storage.v2.UpdateObjectRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateObjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateObjectRequest + * @function getTypeUrl + * @memberof google.storage.v2.UpdateObjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateObjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.UpdateObjectRequest"; + }; + + return UpdateObjectRequest; + })(); + + v2.CommonObjectRequestParams = (function() { + + /** + * Properties of a CommonObjectRequestParams. + * @memberof google.storage.v2 + * @interface ICommonObjectRequestParams + * @property {string|null} [encryptionAlgorithm] CommonObjectRequestParams encryptionAlgorithm + * @property {Uint8Array|null} [encryptionKeyBytes] CommonObjectRequestParams encryptionKeyBytes + * @property {Uint8Array|null} [encryptionKeySha256Bytes] CommonObjectRequestParams encryptionKeySha256Bytes + */ + + /** + * Constructs a new CommonObjectRequestParams. + * @memberof google.storage.v2 + * @classdesc Represents a CommonObjectRequestParams. + * @implements ICommonObjectRequestParams + * @constructor + * @param {google.storage.v2.ICommonObjectRequestParams=} [properties] Properties to set + */ + function CommonObjectRequestParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonObjectRequestParams encryptionAlgorithm. + * @member {string} encryptionAlgorithm + * @memberof google.storage.v2.CommonObjectRequestParams + * @instance + */ + CommonObjectRequestParams.prototype.encryptionAlgorithm = ""; + + /** + * CommonObjectRequestParams encryptionKeyBytes. + * @member {Uint8Array} encryptionKeyBytes + * @memberof google.storage.v2.CommonObjectRequestParams + * @instance + */ + CommonObjectRequestParams.prototype.encryptionKeyBytes = $util.newBuffer([]); + + /** + * CommonObjectRequestParams encryptionKeySha256Bytes. + * @member {Uint8Array} encryptionKeySha256Bytes + * @memberof google.storage.v2.CommonObjectRequestParams + * @instance + */ + CommonObjectRequestParams.prototype.encryptionKeySha256Bytes = $util.newBuffer([]); + + /** + * Creates a new CommonObjectRequestParams instance using the specified properties. + * @function create + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {google.storage.v2.ICommonObjectRequestParams=} [properties] Properties to set + * @returns {google.storage.v2.CommonObjectRequestParams} CommonObjectRequestParams instance + */ + CommonObjectRequestParams.create = function create(properties) { + return new CommonObjectRequestParams(properties); + }; + + /** + * Encodes the specified CommonObjectRequestParams message. Does not implicitly {@link google.storage.v2.CommonObjectRequestParams.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {google.storage.v2.ICommonObjectRequestParams} message CommonObjectRequestParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonObjectRequestParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionAlgorithm != null && Object.hasOwnProperty.call(message, "encryptionAlgorithm")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encryptionAlgorithm); + if (message.encryptionKeyBytes != null && Object.hasOwnProperty.call(message, "encryptionKeyBytes")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.encryptionKeyBytes); + if (message.encryptionKeySha256Bytes != null && Object.hasOwnProperty.call(message, "encryptionKeySha256Bytes")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.encryptionKeySha256Bytes); + return writer; + }; + + /** + * Encodes the specified CommonObjectRequestParams message, length delimited. Does not implicitly {@link google.storage.v2.CommonObjectRequestParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {google.storage.v2.ICommonObjectRequestParams} message CommonObjectRequestParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonObjectRequestParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonObjectRequestParams message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.CommonObjectRequestParams} CommonObjectRequestParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonObjectRequestParams.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.CommonObjectRequestParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionAlgorithm = reader.string(); + break; + } + case 4: { + message.encryptionKeyBytes = reader.bytes(); + break; + } + case 5: { + message.encryptionKeySha256Bytes = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonObjectRequestParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.CommonObjectRequestParams} CommonObjectRequestParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonObjectRequestParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonObjectRequestParams message. + * @function verify + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonObjectRequestParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) + if (!$util.isString(message.encryptionAlgorithm)) + return "encryptionAlgorithm: string expected"; + if (message.encryptionKeyBytes != null && message.hasOwnProperty("encryptionKeyBytes")) + if (!(message.encryptionKeyBytes && typeof message.encryptionKeyBytes.length === "number" || $util.isString(message.encryptionKeyBytes))) + return "encryptionKeyBytes: buffer expected"; + if (message.encryptionKeySha256Bytes != null && message.hasOwnProperty("encryptionKeySha256Bytes")) + if (!(message.encryptionKeySha256Bytes && typeof message.encryptionKeySha256Bytes.length === "number" || $util.isString(message.encryptionKeySha256Bytes))) + return "encryptionKeySha256Bytes: buffer expected"; + return null; + }; + + /** + * Creates a CommonObjectRequestParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.CommonObjectRequestParams} CommonObjectRequestParams + */ + CommonObjectRequestParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.CommonObjectRequestParams) + return object; + var message = new $root.google.storage.v2.CommonObjectRequestParams(); + if (object.encryptionAlgorithm != null) + message.encryptionAlgorithm = String(object.encryptionAlgorithm); + if (object.encryptionKeyBytes != null) + if (typeof object.encryptionKeyBytes === "string") + $util.base64.decode(object.encryptionKeyBytes, message.encryptionKeyBytes = $util.newBuffer($util.base64.length(object.encryptionKeyBytes)), 0); + else if (object.encryptionKeyBytes.length >= 0) + message.encryptionKeyBytes = object.encryptionKeyBytes; + if (object.encryptionKeySha256Bytes != null) + if (typeof object.encryptionKeySha256Bytes === "string") + $util.base64.decode(object.encryptionKeySha256Bytes, message.encryptionKeySha256Bytes = $util.newBuffer($util.base64.length(object.encryptionKeySha256Bytes)), 0); + else if (object.encryptionKeySha256Bytes.length >= 0) + message.encryptionKeySha256Bytes = object.encryptionKeySha256Bytes; + return message; + }; + + /** + * Creates a plain object from a CommonObjectRequestParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {google.storage.v2.CommonObjectRequestParams} message CommonObjectRequestParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonObjectRequestParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encryptionAlgorithm = ""; + if (options.bytes === String) + object.encryptionKeyBytes = ""; + else { + object.encryptionKeyBytes = []; + if (options.bytes !== Array) + object.encryptionKeyBytes = $util.newBuffer(object.encryptionKeyBytes); + } + if (options.bytes === String) + object.encryptionKeySha256Bytes = ""; + else { + object.encryptionKeySha256Bytes = []; + if (options.bytes !== Array) + object.encryptionKeySha256Bytes = $util.newBuffer(object.encryptionKeySha256Bytes); + } + } + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) + object.encryptionAlgorithm = message.encryptionAlgorithm; + if (message.encryptionKeyBytes != null && message.hasOwnProperty("encryptionKeyBytes")) + object.encryptionKeyBytes = options.bytes === String ? $util.base64.encode(message.encryptionKeyBytes, 0, message.encryptionKeyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptionKeyBytes) : message.encryptionKeyBytes; + if (message.encryptionKeySha256Bytes != null && message.hasOwnProperty("encryptionKeySha256Bytes")) + object.encryptionKeySha256Bytes = options.bytes === String ? $util.base64.encode(message.encryptionKeySha256Bytes, 0, message.encryptionKeySha256Bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptionKeySha256Bytes) : message.encryptionKeySha256Bytes; + return object; + }; + + /** + * Converts this CommonObjectRequestParams to JSON. + * @function toJSON + * @memberof google.storage.v2.CommonObjectRequestParams + * @instance + * @returns {Object.} JSON object + */ + CommonObjectRequestParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonObjectRequestParams + * @function getTypeUrl + * @memberof google.storage.v2.CommonObjectRequestParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonObjectRequestParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.CommonObjectRequestParams"; + }; + + return CommonObjectRequestParams; + })(); + + v2.ServiceConstants = (function() { + + /** + * Properties of a ServiceConstants. + * @memberof google.storage.v2 + * @interface IServiceConstants + */ + + /** + * Constructs a new ServiceConstants. + * @memberof google.storage.v2 + * @classdesc Represents a ServiceConstants. + * @implements IServiceConstants + * @constructor + * @param {google.storage.v2.IServiceConstants=} [properties] Properties to set + */ + function ServiceConstants(properties) { + if (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 ServiceConstants instance using the specified properties. + * @function create + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {google.storage.v2.IServiceConstants=} [properties] Properties to set + * @returns {google.storage.v2.ServiceConstants} ServiceConstants instance + */ + ServiceConstants.create = function create(properties) { + return new ServiceConstants(properties); + }; + + /** + * Encodes the specified ServiceConstants message. Does not implicitly {@link google.storage.v2.ServiceConstants.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {google.storage.v2.IServiceConstants} message ServiceConstants message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceConstants.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ServiceConstants message, length delimited. Does not implicitly {@link google.storage.v2.ServiceConstants.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {google.storage.v2.IServiceConstants} message ServiceConstants message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceConstants.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceConstants message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ServiceConstants} ServiceConstants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceConstants.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ServiceConstants(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceConstants message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ServiceConstants} ServiceConstants + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceConstants.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceConstants message. + * @function verify + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceConstants.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ServiceConstants message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ServiceConstants} ServiceConstants + */ + ServiceConstants.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ServiceConstants) + return object; + return new $root.google.storage.v2.ServiceConstants(); + }; + + /** + * Creates a plain object from a ServiceConstants message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {google.storage.v2.ServiceConstants} message ServiceConstants + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceConstants.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ServiceConstants to JSON. + * @function toJSON + * @memberof google.storage.v2.ServiceConstants + * @instance + * @returns {Object.} JSON object + */ + ServiceConstants.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceConstants + * @function getTypeUrl + * @memberof google.storage.v2.ServiceConstants + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceConstants.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ServiceConstants"; + }; + + /** + * Values enum. + * @name google.storage.v2.ServiceConstants.Values + * @enum {number} + * @property {number} VALUES_UNSPECIFIED=0 VALUES_UNSPECIFIED value + * @property {number} MAX_READ_CHUNK_BYTES=2097152 MAX_READ_CHUNK_BYTES value + * @property {number} MAX_WRITE_CHUNK_BYTES=2097152 MAX_WRITE_CHUNK_BYTES value + * @property {number} MAX_OBJECT_SIZE_MB=5242880 MAX_OBJECT_SIZE_MB value + * @property {number} MAX_CUSTOM_METADATA_FIELD_NAME_BYTES=1024 MAX_CUSTOM_METADATA_FIELD_NAME_BYTES value + * @property {number} MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES=4096 MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES value + * @property {number} MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES=8192 MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES value + * @property {number} MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES=20480 MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES value + * @property {number} MAX_NOTIFICATION_CONFIGS_PER_BUCKET=100 MAX_NOTIFICATION_CONFIGS_PER_BUCKET value + * @property {number} MAX_LIFECYCLE_RULES_PER_BUCKET=100 MAX_LIFECYCLE_RULES_PER_BUCKET value + * @property {number} MAX_NOTIFICATION_CUSTOM_ATTRIBUTES=5 MAX_NOTIFICATION_CUSTOM_ATTRIBUTES value + * @property {number} MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH=256 MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH value + * @property {number} MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH=1024 MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH value + * @property {number} MAX_LABELS_ENTRIES_COUNT=64 MAX_LABELS_ENTRIES_COUNT value + * @property {number} MAX_LABELS_KEY_VALUE_LENGTH=63 MAX_LABELS_KEY_VALUE_LENGTH value + * @property {number} MAX_LABELS_KEY_VALUE_BYTES=128 MAX_LABELS_KEY_VALUE_BYTES value + * @property {number} MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST=1000 MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST value + * @property {number} SPLIT_TOKEN_MAX_VALID_DAYS=14 SPLIT_TOKEN_MAX_VALID_DAYS value + */ + ServiceConstants.Values = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUES_UNSPECIFIED"] = 0; + values[valuesById[2097152] = "MAX_READ_CHUNK_BYTES"] = 2097152; + values["MAX_WRITE_CHUNK_BYTES"] = 2097152; + values[valuesById[5242880] = "MAX_OBJECT_SIZE_MB"] = 5242880; + values[valuesById[1024] = "MAX_CUSTOM_METADATA_FIELD_NAME_BYTES"] = 1024; + values[valuesById[4096] = "MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES"] = 4096; + values[valuesById[8192] = "MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES"] = 8192; + values[valuesById[20480] = "MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES"] = 20480; + values[valuesById[100] = "MAX_NOTIFICATION_CONFIGS_PER_BUCKET"] = 100; + values["MAX_LIFECYCLE_RULES_PER_BUCKET"] = 100; + values[valuesById[5] = "MAX_NOTIFICATION_CUSTOM_ATTRIBUTES"] = 5; + values[valuesById[256] = "MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH"] = 256; + values["MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH"] = 1024; + values[valuesById[64] = "MAX_LABELS_ENTRIES_COUNT"] = 64; + values[valuesById[63] = "MAX_LABELS_KEY_VALUE_LENGTH"] = 63; + values[valuesById[128] = "MAX_LABELS_KEY_VALUE_BYTES"] = 128; + values[valuesById[1000] = "MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST"] = 1000; + values[valuesById[14] = "SPLIT_TOKEN_MAX_VALID_DAYS"] = 14; + return values; + })(); + + return ServiceConstants; + })(); + + v2.Bucket = (function() { + + /** + * Properties of a Bucket. + * @memberof google.storage.v2 + * @interface IBucket + * @property {string|null} [name] Bucket name + * @property {string|null} [bucketId] Bucket bucketId + * @property {string|null} [etag] Bucket etag + * @property {string|null} [project] Bucket project + * @property {number|Long|null} [metageneration] Bucket metageneration + * @property {string|null} [location] Bucket location + * @property {string|null} [locationType] Bucket locationType + * @property {string|null} [storageClass] Bucket storageClass + * @property {string|null} [rpo] Bucket rpo + * @property {Array.|null} [acl] Bucket acl + * @property {Array.|null} [defaultObjectAcl] Bucket defaultObjectAcl + * @property {google.storage.v2.Bucket.ILifecycle|null} [lifecycle] Bucket lifecycle + * @property {google.protobuf.ITimestamp|null} [createTime] Bucket createTime + * @property {Array.|null} [cors] Bucket cors + * @property {google.protobuf.ITimestamp|null} [updateTime] Bucket updateTime + * @property {boolean|null} [defaultEventBasedHold] Bucket defaultEventBasedHold + * @property {Object.|null} [labels] Bucket labels + * @property {google.storage.v2.Bucket.IWebsite|null} [website] Bucket website + * @property {google.storage.v2.Bucket.IVersioning|null} [versioning] Bucket versioning + * @property {google.storage.v2.Bucket.ILogging|null} [logging] Bucket logging + * @property {google.storage.v2.IOwner|null} [owner] Bucket owner + * @property {google.storage.v2.Bucket.IEncryption|null} [encryption] Bucket encryption + * @property {google.storage.v2.Bucket.IBilling|null} [billing] Bucket billing + * @property {google.storage.v2.Bucket.IRetentionPolicy|null} [retentionPolicy] Bucket retentionPolicy + * @property {google.storage.v2.Bucket.IIamConfig|null} [iamConfig] Bucket iamConfig + * @property {boolean|null} [satisfiesPzs] Bucket satisfiesPzs + * @property {google.storage.v2.Bucket.ICustomPlacementConfig|null} [customPlacementConfig] Bucket customPlacementConfig + * @property {google.storage.v2.Bucket.IAutoclass|null} [autoclass] Bucket autoclass + * @property {google.storage.v2.Bucket.IHierarchicalNamespace|null} [hierarchicalNamespace] Bucket hierarchicalNamespace + * @property {google.storage.v2.Bucket.ISoftDeletePolicy|null} [softDeletePolicy] Bucket softDeletePolicy + * @property {google.storage.v2.Bucket.IObjectRetention|null} [objectRetention] Bucket objectRetention + * @property {google.storage.v2.Bucket.IIpFilter|null} [ipFilter] Bucket ipFilter + */ + + /** + * Constructs a new Bucket. + * @memberof google.storage.v2 + * @classdesc Represents a Bucket. + * @implements IBucket + * @constructor + * @param {google.storage.v2.IBucket=} [properties] Properties to set + */ + function Bucket(properties) { + this.acl = []; + this.defaultObjectAcl = []; + this.cors = []; + 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]]; + } + + /** + * Bucket name. + * @member {string} name + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.name = ""; + + /** + * Bucket bucketId. + * @member {string} bucketId + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.bucketId = ""; + + /** + * Bucket etag. + * @member {string} etag + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.etag = ""; + + /** + * Bucket project. + * @member {string} project + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.project = ""; + + /** + * Bucket metageneration. + * @member {number|Long} metageneration + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.metageneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bucket location. + * @member {string} location + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.location = ""; + + /** + * Bucket locationType. + * @member {string} locationType + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.locationType = ""; + + /** + * Bucket storageClass. + * @member {string} storageClass + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.storageClass = ""; + + /** + * Bucket rpo. + * @member {string} rpo + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.rpo = ""; + + /** + * Bucket acl. + * @member {Array.} acl + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.acl = $util.emptyArray; + + /** + * Bucket defaultObjectAcl. + * @member {Array.} defaultObjectAcl + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.defaultObjectAcl = $util.emptyArray; + + /** + * Bucket lifecycle. + * @member {google.storage.v2.Bucket.ILifecycle|null|undefined} lifecycle + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.lifecycle = null; + + /** + * Bucket createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.createTime = null; + + /** + * Bucket cors. + * @member {Array.} cors + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.cors = $util.emptyArray; + + /** + * Bucket updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.updateTime = null; + + /** + * Bucket defaultEventBasedHold. + * @member {boolean} defaultEventBasedHold + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.defaultEventBasedHold = false; + + /** + * Bucket labels. + * @member {Object.} labels + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.labels = $util.emptyObject; + + /** + * Bucket website. + * @member {google.storage.v2.Bucket.IWebsite|null|undefined} website + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.website = null; + + /** + * Bucket versioning. + * @member {google.storage.v2.Bucket.IVersioning|null|undefined} versioning + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.versioning = null; + + /** + * Bucket logging. + * @member {google.storage.v2.Bucket.ILogging|null|undefined} logging + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.logging = null; + + /** + * Bucket owner. + * @member {google.storage.v2.IOwner|null|undefined} owner + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.owner = null; + + /** + * Bucket encryption. + * @member {google.storage.v2.Bucket.IEncryption|null|undefined} encryption + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.encryption = null; + + /** + * Bucket billing. + * @member {google.storage.v2.Bucket.IBilling|null|undefined} billing + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.billing = null; + + /** + * Bucket retentionPolicy. + * @member {google.storage.v2.Bucket.IRetentionPolicy|null|undefined} retentionPolicy + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.retentionPolicy = null; + + /** + * Bucket iamConfig. + * @member {google.storage.v2.Bucket.IIamConfig|null|undefined} iamConfig + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.iamConfig = null; + + /** + * Bucket satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.satisfiesPzs = false; + + /** + * Bucket customPlacementConfig. + * @member {google.storage.v2.Bucket.ICustomPlacementConfig|null|undefined} customPlacementConfig + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.customPlacementConfig = null; + + /** + * Bucket autoclass. + * @member {google.storage.v2.Bucket.IAutoclass|null|undefined} autoclass + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.autoclass = null; + + /** + * Bucket hierarchicalNamespace. + * @member {google.storage.v2.Bucket.IHierarchicalNamespace|null|undefined} hierarchicalNamespace + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.hierarchicalNamespace = null; + + /** + * Bucket softDeletePolicy. + * @member {google.storage.v2.Bucket.ISoftDeletePolicy|null|undefined} softDeletePolicy + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.softDeletePolicy = null; + + /** + * Bucket objectRetention. + * @member {google.storage.v2.Bucket.IObjectRetention|null|undefined} objectRetention + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.objectRetention = null; + + /** + * Bucket ipFilter. + * @member {google.storage.v2.Bucket.IIpFilter|null|undefined} ipFilter + * @memberof google.storage.v2.Bucket + * @instance + */ + Bucket.prototype.ipFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bucket.prototype, "_ipFilter", { + get: $util.oneOfGetter($oneOfFields = ["ipFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bucket instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket + * @static + * @param {google.storage.v2.IBucket=} [properties] Properties to set + * @returns {google.storage.v2.Bucket} Bucket instance + */ + Bucket.create = function create(properties) { + return new Bucket(properties); + }; + + /** + * Encodes the specified Bucket message. Does not implicitly {@link google.storage.v2.Bucket.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket + * @static + * @param {google.storage.v2.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encode = function encode(message, writer) { + 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.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucketId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.metageneration); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.location); + if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.locationType); + if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.storageClass); + if (message.acl != null && message.acl.length) + for (var i = 0; i < message.acl.length; ++i) + $root.google.storage.v2.BucketAccessControl.encode(message.acl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.defaultObjectAcl != null && message.defaultObjectAcl.length) + for (var i = 0; i < message.defaultObjectAcl.length; ++i) + $root.google.storage.v2.ObjectAccessControl.encode(message.defaultObjectAcl[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lifecycle != null && Object.hasOwnProperty.call(message, "lifecycle")) + $root.google.storage.v2.Bucket.Lifecycle.encode(message.lifecycle, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.cors != null && message.cors.length) + for (var i = 0; i < message.cors.length; ++i) + $root.google.storage.v2.Bucket.Cors.encode(message.cors[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.defaultEventBasedHold != null && Object.hasOwnProperty.call(message, "defaultEventBasedHold")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.defaultEventBasedHold); + 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 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.website != null && Object.hasOwnProperty.call(message, "website")) + $root.google.storage.v2.Bucket.Website.encode(message.website, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.versioning != null && Object.hasOwnProperty.call(message, "versioning")) + $root.google.storage.v2.Bucket.Versioning.encode(message.versioning, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) + $root.google.storage.v2.Bucket.Logging.encode(message.logging, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.google.storage.v2.Owner.encode(message.owner, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryption != null && Object.hasOwnProperty.call(message, "encryption")) + $root.google.storage.v2.Bucket.Encryption.encode(message.encryption, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.billing != null && Object.hasOwnProperty.call(message, "billing")) + $root.google.storage.v2.Bucket.Billing.encode(message.billing, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.retentionPolicy != null && Object.hasOwnProperty.call(message, "retentionPolicy")) + $root.google.storage.v2.Bucket.RetentionPolicy.encode(message.retentionPolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.iamConfig != null && Object.hasOwnProperty.call(message, "iamConfig")) + $root.google.storage.v2.Bucket.IamConfig.encode(message.iamConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzs); + if (message.customPlacementConfig != null && Object.hasOwnProperty.call(message, "customPlacementConfig")) + $root.google.storage.v2.Bucket.CustomPlacementConfig.encode(message.customPlacementConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rpo != null && Object.hasOwnProperty.call(message, "rpo")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.rpo); + if (message.autoclass != null && Object.hasOwnProperty.call(message, "autoclass")) + $root.google.storage.v2.Bucket.Autoclass.encode(message.autoclass, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.etag); + if (message.softDeletePolicy != null && Object.hasOwnProperty.call(message, "softDeletePolicy")) + $root.google.storage.v2.Bucket.SoftDeletePolicy.encode(message.softDeletePolicy, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.hierarchicalNamespace != null && Object.hasOwnProperty.call(message, "hierarchicalNamespace")) + $root.google.storage.v2.Bucket.HierarchicalNamespace.encode(message.hierarchicalNamespace, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.objectRetention != null && Object.hasOwnProperty.call(message, "objectRetention")) + $root.google.storage.v2.Bucket.ObjectRetention.encode(message.objectRetention, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.ipFilter != null && Object.hasOwnProperty.call(message, "ipFilter")) + $root.google.storage.v2.Bucket.IpFilter.encode(message.ipFilter, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket + * @static + * @param {google.storage.v2.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bucket message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.bucketId = reader.string(); + break; + } + case 29: { + message.etag = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 4: { + message.metageneration = reader.int64(); + break; + } + case 5: { + message.location = reader.string(); + break; + } + case 6: { + message.locationType = reader.string(); + break; + } + case 7: { + message.storageClass = reader.string(); + break; + } + case 27: { + message.rpo = reader.string(); + break; + } + case 8: { + if (!(message.acl && message.acl.length)) + message.acl = []; + message.acl.push($root.google.storage.v2.BucketAccessControl.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.defaultObjectAcl && message.defaultObjectAcl.length)) + message.defaultObjectAcl = []; + message.defaultObjectAcl.push($root.google.storage.v2.ObjectAccessControl.decode(reader, reader.uint32())); + break; + } + case 10: { + message.lifecycle = $root.google.storage.v2.Bucket.Lifecycle.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.cors && message.cors.length)) + message.cors = []; + message.cors.push($root.google.storage.v2.Bucket.Cors.decode(reader, reader.uint32())); + break; + } + case 13: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.defaultEventBasedHold = reader.bool(); + break; + } + case 15: { + 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 16: { + message.website = $root.google.storage.v2.Bucket.Website.decode(reader, reader.uint32()); + break; + } + case 17: { + message.versioning = $root.google.storage.v2.Bucket.Versioning.decode(reader, reader.uint32()); + break; + } + case 18: { + message.logging = $root.google.storage.v2.Bucket.Logging.decode(reader, reader.uint32()); + break; + } + case 19: { + message.owner = $root.google.storage.v2.Owner.decode(reader, reader.uint32()); + break; + } + case 20: { + message.encryption = $root.google.storage.v2.Bucket.Encryption.decode(reader, reader.uint32()); + break; + } + case 21: { + message.billing = $root.google.storage.v2.Bucket.Billing.decode(reader, reader.uint32()); + break; + } + case 22: { + message.retentionPolicy = $root.google.storage.v2.Bucket.RetentionPolicy.decode(reader, reader.uint32()); + break; + } + case 23: { + message.iamConfig = $root.google.storage.v2.Bucket.IamConfig.decode(reader, reader.uint32()); + break; + } + case 25: { + message.satisfiesPzs = reader.bool(); + break; + } + case 26: { + message.customPlacementConfig = $root.google.storage.v2.Bucket.CustomPlacementConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + message.autoclass = $root.google.storage.v2.Bucket.Autoclass.decode(reader, reader.uint32()); + break; + } + case 32: { + message.hierarchicalNamespace = $root.google.storage.v2.Bucket.HierarchicalNamespace.decode(reader, reader.uint32()); + break; + } + case 31: { + message.softDeletePolicy = $root.google.storage.v2.Bucket.SoftDeletePolicy.decode(reader, reader.uint32()); + break; + } + case 33: { + message.objectRetention = $root.google.storage.v2.Bucket.ObjectRetention.decode(reader, reader.uint32()); + break; + } + case 38: { + message.ipFilter = $root.google.storage.v2.Bucket.IpFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bucket message. + * @function verify + * @memberof google.storage.v2.Bucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bucket.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.bucketId != null && message.hasOwnProperty("bucketId")) + if (!$util.isString(message.bucketId)) + return "bucketId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.metageneration != null && message.hasOwnProperty("metageneration")) + if (!$util.isInteger(message.metageneration) && !(message.metageneration && $util.isInteger(message.metageneration.low) && $util.isInteger(message.metageneration.high))) + return "metageneration: integer|Long expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.locationType != null && message.hasOwnProperty("locationType")) + if (!$util.isString(message.locationType)) + return "locationType: string expected"; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + if (!$util.isString(message.storageClass)) + return "storageClass: string expected"; + if (message.rpo != null && message.hasOwnProperty("rpo")) + if (!$util.isString(message.rpo)) + return "rpo: string expected"; + if (message.acl != null && message.hasOwnProperty("acl")) { + if (!Array.isArray(message.acl)) + return "acl: array expected"; + for (var i = 0; i < message.acl.length; ++i) { + var error = $root.google.storage.v2.BucketAccessControl.verify(message.acl[i]); + if (error) + return "acl." + error; + } + } + if (message.defaultObjectAcl != null && message.hasOwnProperty("defaultObjectAcl")) { + if (!Array.isArray(message.defaultObjectAcl)) + return "defaultObjectAcl: array expected"; + for (var i = 0; i < message.defaultObjectAcl.length; ++i) { + var error = $root.google.storage.v2.ObjectAccessControl.verify(message.defaultObjectAcl[i]); + if (error) + return "defaultObjectAcl." + error; + } + } + if (message.lifecycle != null && message.hasOwnProperty("lifecycle")) { + var error = $root.google.storage.v2.Bucket.Lifecycle.verify(message.lifecycle); + if (error) + return "lifecycle." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.cors != null && message.hasOwnProperty("cors")) { + if (!Array.isArray(message.cors)) + return "cors: array expected"; + for (var i = 0; i < message.cors.length; ++i) { + var error = $root.google.storage.v2.Bucket.Cors.verify(message.cors[i]); + if (error) + return "cors." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.defaultEventBasedHold != null && message.hasOwnProperty("defaultEventBasedHold")) + if (typeof message.defaultEventBasedHold !== "boolean") + return "defaultEventBasedHold: boolean 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.website != null && message.hasOwnProperty("website")) { + var error = $root.google.storage.v2.Bucket.Website.verify(message.website); + if (error) + return "website." + error; + } + if (message.versioning != null && message.hasOwnProperty("versioning")) { + var error = $root.google.storage.v2.Bucket.Versioning.verify(message.versioning); + if (error) + return "versioning." + error; + } + if (message.logging != null && message.hasOwnProperty("logging")) { + var error = $root.google.storage.v2.Bucket.Logging.verify(message.logging); + if (error) + return "logging." + error; + } + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.google.storage.v2.Owner.verify(message.owner); + if (error) + return "owner." + error; + } + if (message.encryption != null && message.hasOwnProperty("encryption")) { + var error = $root.google.storage.v2.Bucket.Encryption.verify(message.encryption); + if (error) + return "encryption." + error; + } + if (message.billing != null && message.hasOwnProperty("billing")) { + var error = $root.google.storage.v2.Bucket.Billing.verify(message.billing); + if (error) + return "billing." + error; + } + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) { + var error = $root.google.storage.v2.Bucket.RetentionPolicy.verify(message.retentionPolicy); + if (error) + return "retentionPolicy." + error; + } + if (message.iamConfig != null && message.hasOwnProperty("iamConfig")) { + var error = $root.google.storage.v2.Bucket.IamConfig.verify(message.iamConfig); + if (error) + return "iamConfig." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.customPlacementConfig != null && message.hasOwnProperty("customPlacementConfig")) { + var error = $root.google.storage.v2.Bucket.CustomPlacementConfig.verify(message.customPlacementConfig); + if (error) + return "customPlacementConfig." + error; + } + if (message.autoclass != null && message.hasOwnProperty("autoclass")) { + var error = $root.google.storage.v2.Bucket.Autoclass.verify(message.autoclass); + if (error) + return "autoclass." + error; + } + if (message.hierarchicalNamespace != null && message.hasOwnProperty("hierarchicalNamespace")) { + var error = $root.google.storage.v2.Bucket.HierarchicalNamespace.verify(message.hierarchicalNamespace); + if (error) + return "hierarchicalNamespace." + error; + } + if (message.softDeletePolicy != null && message.hasOwnProperty("softDeletePolicy")) { + var error = $root.google.storage.v2.Bucket.SoftDeletePolicy.verify(message.softDeletePolicy); + if (error) + return "softDeletePolicy." + error; + } + if (message.objectRetention != null && message.hasOwnProperty("objectRetention")) { + var error = $root.google.storage.v2.Bucket.ObjectRetention.verify(message.objectRetention); + if (error) + return "objectRetention." + error; + } + if (message.ipFilter != null && message.hasOwnProperty("ipFilter")) { + properties._ipFilter = 1; + { + var error = $root.google.storage.v2.Bucket.IpFilter.verify(message.ipFilter); + if (error) + return "ipFilter." + error; + } + } + return null; + }; + + /** + * Creates a Bucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket} Bucket + */ + Bucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket) + return object; + var message = new $root.google.storage.v2.Bucket(); + if (object.name != null) + message.name = String(object.name); + if (object.bucketId != null) + message.bucketId = String(object.bucketId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.project != null) + message.project = String(object.project); + if (object.metageneration != null) + if ($util.Long) + (message.metageneration = $util.Long.fromValue(object.metageneration)).unsigned = false; + else if (typeof object.metageneration === "string") + message.metageneration = parseInt(object.metageneration, 10); + else if (typeof object.metageneration === "number") + message.metageneration = object.metageneration; + else if (typeof object.metageneration === "object") + message.metageneration = new $util.LongBits(object.metageneration.low >>> 0, object.metageneration.high >>> 0).toNumber(); + if (object.location != null) + message.location = String(object.location); + if (object.locationType != null) + message.locationType = String(object.locationType); + if (object.storageClass != null) + message.storageClass = String(object.storageClass); + if (object.rpo != null) + message.rpo = String(object.rpo); + if (object.acl) { + if (!Array.isArray(object.acl)) + throw TypeError(".google.storage.v2.Bucket.acl: array expected"); + message.acl = []; + for (var i = 0; i < object.acl.length; ++i) { + if (typeof object.acl[i] !== "object") + throw TypeError(".google.storage.v2.Bucket.acl: object expected"); + message.acl[i] = $root.google.storage.v2.BucketAccessControl.fromObject(object.acl[i]); + } + } + if (object.defaultObjectAcl) { + if (!Array.isArray(object.defaultObjectAcl)) + throw TypeError(".google.storage.v2.Bucket.defaultObjectAcl: array expected"); + message.defaultObjectAcl = []; + for (var i = 0; i < object.defaultObjectAcl.length; ++i) { + if (typeof object.defaultObjectAcl[i] !== "object") + throw TypeError(".google.storage.v2.Bucket.defaultObjectAcl: object expected"); + message.defaultObjectAcl[i] = $root.google.storage.v2.ObjectAccessControl.fromObject(object.defaultObjectAcl[i]); + } + } + if (object.lifecycle != null) { + if (typeof object.lifecycle !== "object") + throw TypeError(".google.storage.v2.Bucket.lifecycle: object expected"); + message.lifecycle = $root.google.storage.v2.Bucket.Lifecycle.fromObject(object.lifecycle); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.v2.Bucket.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.cors) { + if (!Array.isArray(object.cors)) + throw TypeError(".google.storage.v2.Bucket.cors: array expected"); + message.cors = []; + for (var i = 0; i < object.cors.length; ++i) { + if (typeof object.cors[i] !== "object") + throw TypeError(".google.storage.v2.Bucket.cors: object expected"); + message.cors[i] = $root.google.storage.v2.Bucket.Cors.fromObject(object.cors[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.v2.Bucket.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.defaultEventBasedHold != null) + message.defaultEventBasedHold = Boolean(object.defaultEventBasedHold); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.storage.v2.Bucket.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.website != null) { + if (typeof object.website !== "object") + throw TypeError(".google.storage.v2.Bucket.website: object expected"); + message.website = $root.google.storage.v2.Bucket.Website.fromObject(object.website); + } + if (object.versioning != null) { + if (typeof object.versioning !== "object") + throw TypeError(".google.storage.v2.Bucket.versioning: object expected"); + message.versioning = $root.google.storage.v2.Bucket.Versioning.fromObject(object.versioning); + } + if (object.logging != null) { + if (typeof object.logging !== "object") + throw TypeError(".google.storage.v2.Bucket.logging: object expected"); + message.logging = $root.google.storage.v2.Bucket.Logging.fromObject(object.logging); + } + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".google.storage.v2.Bucket.owner: object expected"); + message.owner = $root.google.storage.v2.Owner.fromObject(object.owner); + } + if (object.encryption != null) { + if (typeof object.encryption !== "object") + throw TypeError(".google.storage.v2.Bucket.encryption: object expected"); + message.encryption = $root.google.storage.v2.Bucket.Encryption.fromObject(object.encryption); + } + if (object.billing != null) { + if (typeof object.billing !== "object") + throw TypeError(".google.storage.v2.Bucket.billing: object expected"); + message.billing = $root.google.storage.v2.Bucket.Billing.fromObject(object.billing); + } + if (object.retentionPolicy != null) { + if (typeof object.retentionPolicy !== "object") + throw TypeError(".google.storage.v2.Bucket.retentionPolicy: object expected"); + message.retentionPolicy = $root.google.storage.v2.Bucket.RetentionPolicy.fromObject(object.retentionPolicy); + } + if (object.iamConfig != null) { + if (typeof object.iamConfig !== "object") + throw TypeError(".google.storage.v2.Bucket.iamConfig: object expected"); + message.iamConfig = $root.google.storage.v2.Bucket.IamConfig.fromObject(object.iamConfig); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.customPlacementConfig != null) { + if (typeof object.customPlacementConfig !== "object") + throw TypeError(".google.storage.v2.Bucket.customPlacementConfig: object expected"); + message.customPlacementConfig = $root.google.storage.v2.Bucket.CustomPlacementConfig.fromObject(object.customPlacementConfig); + } + if (object.autoclass != null) { + if (typeof object.autoclass !== "object") + throw TypeError(".google.storage.v2.Bucket.autoclass: object expected"); + message.autoclass = $root.google.storage.v2.Bucket.Autoclass.fromObject(object.autoclass); + } + if (object.hierarchicalNamespace != null) { + if (typeof object.hierarchicalNamespace !== "object") + throw TypeError(".google.storage.v2.Bucket.hierarchicalNamespace: object expected"); + message.hierarchicalNamespace = $root.google.storage.v2.Bucket.HierarchicalNamespace.fromObject(object.hierarchicalNamespace); + } + if (object.softDeletePolicy != null) { + if (typeof object.softDeletePolicy !== "object") + throw TypeError(".google.storage.v2.Bucket.softDeletePolicy: object expected"); + message.softDeletePolicy = $root.google.storage.v2.Bucket.SoftDeletePolicy.fromObject(object.softDeletePolicy); + } + if (object.objectRetention != null) { + if (typeof object.objectRetention !== "object") + throw TypeError(".google.storage.v2.Bucket.objectRetention: object expected"); + message.objectRetention = $root.google.storage.v2.Bucket.ObjectRetention.fromObject(object.objectRetention); + } + if (object.ipFilter != null) { + if (typeof object.ipFilter !== "object") + throw TypeError(".google.storage.v2.Bucket.ipFilter: object expected"); + message.ipFilter = $root.google.storage.v2.Bucket.IpFilter.fromObject(object.ipFilter); + } + return message; + }; + + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket + * @static + * @param {google.storage.v2.Bucket} message Bucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.acl = []; + object.defaultObjectAcl = []; + object.cors = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.bucketId = ""; + object.project = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.metageneration = options.longs === String ? "0" : 0; + object.location = ""; + object.locationType = ""; + object.storageClass = ""; + object.lifecycle = null; + object.createTime = null; + object.updateTime = null; + object.defaultEventBasedHold = false; + object.website = null; + object.versioning = null; + object.logging = null; + object.owner = null; + object.encryption = null; + object.billing = null; + object.retentionPolicy = null; + object.iamConfig = null; + object.satisfiesPzs = false; + object.customPlacementConfig = null; + object.rpo = ""; + object.autoclass = null; + object.etag = ""; + object.softDeletePolicy = null; + object.hierarchicalNamespace = null; + object.objectRetention = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.bucketId != null && message.hasOwnProperty("bucketId")) + object.bucketId = message.bucketId; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.metageneration != null && message.hasOwnProperty("metageneration")) + if (typeof message.metageneration === "number") + object.metageneration = options.longs === String ? String(message.metageneration) : message.metageneration; + else + object.metageneration = options.longs === String ? $util.Long.prototype.toString.call(message.metageneration) : options.longs === Number ? new $util.LongBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0).toNumber() : message.metageneration; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.locationType != null && message.hasOwnProperty("locationType")) + object.locationType = message.locationType; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + object.storageClass = message.storageClass; + if (message.acl && message.acl.length) { + object.acl = []; + for (var j = 0; j < message.acl.length; ++j) + object.acl[j] = $root.google.storage.v2.BucketAccessControl.toObject(message.acl[j], options); + } + if (message.defaultObjectAcl && message.defaultObjectAcl.length) { + object.defaultObjectAcl = []; + for (var j = 0; j < message.defaultObjectAcl.length; ++j) + object.defaultObjectAcl[j] = $root.google.storage.v2.ObjectAccessControl.toObject(message.defaultObjectAcl[j], options); + } + if (message.lifecycle != null && message.hasOwnProperty("lifecycle")) + object.lifecycle = $root.google.storage.v2.Bucket.Lifecycle.toObject(message.lifecycle, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.cors && message.cors.length) { + object.cors = []; + for (var j = 0; j < message.cors.length; ++j) + object.cors[j] = $root.google.storage.v2.Bucket.Cors.toObject(message.cors[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.defaultEventBasedHold != null && message.hasOwnProperty("defaultEventBasedHold")) + object.defaultEventBasedHold = message.defaultEventBasedHold; + 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.website != null && message.hasOwnProperty("website")) + object.website = $root.google.storage.v2.Bucket.Website.toObject(message.website, options); + if (message.versioning != null && message.hasOwnProperty("versioning")) + object.versioning = $root.google.storage.v2.Bucket.Versioning.toObject(message.versioning, options); + if (message.logging != null && message.hasOwnProperty("logging")) + object.logging = $root.google.storage.v2.Bucket.Logging.toObject(message.logging, options); + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.google.storage.v2.Owner.toObject(message.owner, options); + if (message.encryption != null && message.hasOwnProperty("encryption")) + object.encryption = $root.google.storage.v2.Bucket.Encryption.toObject(message.encryption, options); + if (message.billing != null && message.hasOwnProperty("billing")) + object.billing = $root.google.storage.v2.Bucket.Billing.toObject(message.billing, options); + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) + object.retentionPolicy = $root.google.storage.v2.Bucket.RetentionPolicy.toObject(message.retentionPolicy, options); + if (message.iamConfig != null && message.hasOwnProperty("iamConfig")) + object.iamConfig = $root.google.storage.v2.Bucket.IamConfig.toObject(message.iamConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.customPlacementConfig != null && message.hasOwnProperty("customPlacementConfig")) + object.customPlacementConfig = $root.google.storage.v2.Bucket.CustomPlacementConfig.toObject(message.customPlacementConfig, options); + if (message.rpo != null && message.hasOwnProperty("rpo")) + object.rpo = message.rpo; + if (message.autoclass != null && message.hasOwnProperty("autoclass")) + object.autoclass = $root.google.storage.v2.Bucket.Autoclass.toObject(message.autoclass, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.softDeletePolicy != null && message.hasOwnProperty("softDeletePolicy")) + object.softDeletePolicy = $root.google.storage.v2.Bucket.SoftDeletePolicy.toObject(message.softDeletePolicy, options); + if (message.hierarchicalNamespace != null && message.hasOwnProperty("hierarchicalNamespace")) + object.hierarchicalNamespace = $root.google.storage.v2.Bucket.HierarchicalNamespace.toObject(message.hierarchicalNamespace, options); + if (message.objectRetention != null && message.hasOwnProperty("objectRetention")) + object.objectRetention = $root.google.storage.v2.Bucket.ObjectRetention.toObject(message.objectRetention, options); + if (message.ipFilter != null && message.hasOwnProperty("ipFilter")) { + object.ipFilter = $root.google.storage.v2.Bucket.IpFilter.toObject(message.ipFilter, options); + if (options.oneofs) + object._ipFilter = "ipFilter"; + } + return object; + }; + + /** + * Converts this Bucket to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket + * @instance + * @returns {Object.} JSON object + */ + Bucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bucket + * @function getTypeUrl + * @memberof google.storage.v2.Bucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket"; + }; + + Bucket.Billing = (function() { + + /** + * Properties of a Billing. + * @memberof google.storage.v2.Bucket + * @interface IBilling + * @property {boolean|null} [requesterPays] Billing requesterPays + */ + + /** + * Constructs a new Billing. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a Billing. + * @implements IBilling + * @constructor + * @param {google.storage.v2.Bucket.IBilling=} [properties] Properties to set + */ + function Billing(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Billing requesterPays. + * @member {boolean} requesterPays + * @memberof google.storage.v2.Bucket.Billing + * @instance + */ + Billing.prototype.requesterPays = false; + + /** + * Creates a new Billing instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {google.storage.v2.Bucket.IBilling=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Billing} Billing instance + */ + Billing.create = function create(properties) { + return new Billing(properties); + }; + + /** + * Encodes the specified Billing message. Does not implicitly {@link google.storage.v2.Bucket.Billing.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {google.storage.v2.Bucket.IBilling} message Billing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Billing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requesterPays != null && Object.hasOwnProperty.call(message, "requesterPays")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requesterPays); + return writer; + }; + + /** + * Encodes the specified Billing message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Billing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {google.storage.v2.Bucket.IBilling} message Billing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Billing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Billing message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Billing} Billing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Billing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Billing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requesterPays = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Billing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Billing} Billing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Billing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Billing message. + * @function verify + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Billing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requesterPays != null && message.hasOwnProperty("requesterPays")) + if (typeof message.requesterPays !== "boolean") + return "requesterPays: boolean expected"; + return null; + }; + + /** + * Creates a Billing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Billing} Billing + */ + Billing.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Billing) + return object; + var message = new $root.google.storage.v2.Bucket.Billing(); + if (object.requesterPays != null) + message.requesterPays = Boolean(object.requesterPays); + return message; + }; + + /** + * Creates a plain object from a Billing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {google.storage.v2.Bucket.Billing} message Billing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Billing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requesterPays = false; + if (message.requesterPays != null && message.hasOwnProperty("requesterPays")) + object.requesterPays = message.requesterPays; + return object; + }; + + /** + * Converts this Billing to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Billing + * @instance + * @returns {Object.} JSON object + */ + Billing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Billing + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Billing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Billing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Billing"; + }; + + return Billing; + })(); + + Bucket.Cors = (function() { + + /** + * Properties of a Cors. + * @memberof google.storage.v2.Bucket + * @interface ICors + * @property {Array.|null} [origin] Cors origin + * @property {Array.|null} [method] Cors method + * @property {Array.|null} [responseHeader] Cors responseHeader + * @property {number|null} [maxAgeSeconds] Cors maxAgeSeconds + */ + + /** + * Constructs a new Cors. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a Cors. + * @implements ICors + * @constructor + * @param {google.storage.v2.Bucket.ICors=} [properties] Properties to set + */ + function Cors(properties) { + this.origin = []; + this.method = []; + this.responseHeader = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cors origin. + * @member {Array.} origin + * @memberof google.storage.v2.Bucket.Cors + * @instance + */ + Cors.prototype.origin = $util.emptyArray; + + /** + * Cors method. + * @member {Array.} method + * @memberof google.storage.v2.Bucket.Cors + * @instance + */ + Cors.prototype.method = $util.emptyArray; + + /** + * Cors responseHeader. + * @member {Array.} responseHeader + * @memberof google.storage.v2.Bucket.Cors + * @instance + */ + Cors.prototype.responseHeader = $util.emptyArray; + + /** + * Cors maxAgeSeconds. + * @member {number} maxAgeSeconds + * @memberof google.storage.v2.Bucket.Cors + * @instance + */ + Cors.prototype.maxAgeSeconds = 0; + + /** + * Creates a new Cors instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {google.storage.v2.Bucket.ICors=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Cors} Cors instance + */ + Cors.create = function create(properties) { + return new Cors(properties); + }; + + /** + * Encodes the specified Cors message. Does not implicitly {@link google.storage.v2.Bucket.Cors.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {google.storage.v2.Bucket.ICors} message Cors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origin != null && message.origin.length) + for (var i = 0; i < message.origin.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.origin[i]); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.method[i]); + if (message.responseHeader != null && message.responseHeader.length) + for (var i = 0; i < message.responseHeader.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.responseHeader[i]); + if (message.maxAgeSeconds != null && Object.hasOwnProperty.call(message, "maxAgeSeconds")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAgeSeconds); + return writer; + }; + + /** + * Encodes the specified Cors message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Cors.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {google.storage.v2.Bucket.ICors} message Cors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cors message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Cors} Cors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cors.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Cors(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.origin && message.origin.length)) + message.origin = []; + message.origin.push(reader.string()); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push(reader.string()); + break; + } + case 3: { + if (!(message.responseHeader && message.responseHeader.length)) + message.responseHeader = []; + message.responseHeader.push(reader.string()); + break; + } + case 4: { + message.maxAgeSeconds = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Cors} Cors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cors message. + * @function verify + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origin != null && message.hasOwnProperty("origin")) { + if (!Array.isArray(message.origin)) + return "origin: array expected"; + for (var i = 0; i < message.origin.length; ++i) + if (!$util.isString(message.origin[i])) + return "origin: 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) + if (!$util.isString(message.method[i])) + return "method: string[] expected"; + } + if (message.responseHeader != null && message.hasOwnProperty("responseHeader")) { + if (!Array.isArray(message.responseHeader)) + return "responseHeader: array expected"; + for (var i = 0; i < message.responseHeader.length; ++i) + if (!$util.isString(message.responseHeader[i])) + return "responseHeader: string[] expected"; + } + if (message.maxAgeSeconds != null && message.hasOwnProperty("maxAgeSeconds")) + if (!$util.isInteger(message.maxAgeSeconds)) + return "maxAgeSeconds: integer expected"; + return null; + }; + + /** + * Creates a Cors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Cors} Cors + */ + Cors.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Cors) + return object; + var message = new $root.google.storage.v2.Bucket.Cors(); + if (object.origin) { + if (!Array.isArray(object.origin)) + throw TypeError(".google.storage.v2.Bucket.Cors.origin: array expected"); + message.origin = []; + for (var i = 0; i < object.origin.length; ++i) + message.origin[i] = String(object.origin[i]); + } + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.storage.v2.Bucket.Cors.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) + message.method[i] = String(object.method[i]); + } + if (object.responseHeader) { + if (!Array.isArray(object.responseHeader)) + throw TypeError(".google.storage.v2.Bucket.Cors.responseHeader: array expected"); + message.responseHeader = []; + for (var i = 0; i < object.responseHeader.length; ++i) + message.responseHeader[i] = String(object.responseHeader[i]); + } + if (object.maxAgeSeconds != null) + message.maxAgeSeconds = object.maxAgeSeconds | 0; + return message; + }; + + /** + * Creates a plain object from a Cors message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {google.storage.v2.Bucket.Cors} message Cors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cors.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.origin = []; + object.method = []; + object.responseHeader = []; + } + if (options.defaults) + object.maxAgeSeconds = 0; + if (message.origin && message.origin.length) { + object.origin = []; + for (var j = 0; j < message.origin.length; ++j) + object.origin[j] = message.origin[j]; + } + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = message.method[j]; + } + if (message.responseHeader && message.responseHeader.length) { + object.responseHeader = []; + for (var j = 0; j < message.responseHeader.length; ++j) + object.responseHeader[j] = message.responseHeader[j]; + } + if (message.maxAgeSeconds != null && message.hasOwnProperty("maxAgeSeconds")) + object.maxAgeSeconds = message.maxAgeSeconds; + return object; + }; + + /** + * Converts this Cors to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Cors + * @instance + * @returns {Object.} JSON object + */ + Cors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cors + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Cors + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cors.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Cors"; + }; + + return Cors; + })(); + + Bucket.Encryption = (function() { + + /** + * Properties of an Encryption. + * @memberof google.storage.v2.Bucket + * @interface IEncryption + * @property {string|null} [defaultKmsKey] Encryption defaultKmsKey + * @property {google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig|null} [googleManagedEncryptionEnforcementConfig] Encryption googleManagedEncryptionEnforcementConfig + * @property {google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig|null} [customerManagedEncryptionEnforcementConfig] Encryption customerManagedEncryptionEnforcementConfig + * @property {google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig|null} [customerSuppliedEncryptionEnforcementConfig] Encryption customerSuppliedEncryptionEnforcementConfig + */ + + /** + * Constructs a new Encryption. + * @memberof google.storage.v2.Bucket + * @classdesc Represents an Encryption. + * @implements IEncryption + * @constructor + * @param {google.storage.v2.Bucket.IEncryption=} [properties] Properties to set + */ + function Encryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Encryption defaultKmsKey. + * @member {string} defaultKmsKey + * @memberof google.storage.v2.Bucket.Encryption + * @instance + */ + Encryption.prototype.defaultKmsKey = ""; + + /** + * Encryption googleManagedEncryptionEnforcementConfig. + * @member {google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig|null|undefined} googleManagedEncryptionEnforcementConfig + * @memberof google.storage.v2.Bucket.Encryption + * @instance + */ + Encryption.prototype.googleManagedEncryptionEnforcementConfig = null; + + /** + * Encryption customerManagedEncryptionEnforcementConfig. + * @member {google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig|null|undefined} customerManagedEncryptionEnforcementConfig + * @memberof google.storage.v2.Bucket.Encryption + * @instance + */ + Encryption.prototype.customerManagedEncryptionEnforcementConfig = null; + + /** + * Encryption customerSuppliedEncryptionEnforcementConfig. + * @member {google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig|null|undefined} customerSuppliedEncryptionEnforcementConfig + * @memberof google.storage.v2.Bucket.Encryption + * @instance + */ + Encryption.prototype.customerSuppliedEncryptionEnforcementConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Encryption.prototype, "_googleManagedEncryptionEnforcementConfig", { + get: $util.oneOfGetter($oneOfFields = ["googleManagedEncryptionEnforcementConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Encryption.prototype, "_customerManagedEncryptionEnforcementConfig", { + get: $util.oneOfGetter($oneOfFields = ["customerManagedEncryptionEnforcementConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Encryption.prototype, "_customerSuppliedEncryptionEnforcementConfig", { + get: $util.oneOfGetter($oneOfFields = ["customerSuppliedEncryptionEnforcementConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Encryption instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {google.storage.v2.Bucket.IEncryption=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Encryption} Encryption instance + */ + Encryption.create = function create(properties) { + return new Encryption(properties); + }; + + /** + * Encodes the specified Encryption message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {google.storage.v2.Bucket.IEncryption} message Encryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encryption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultKmsKey != null && Object.hasOwnProperty.call(message, "defaultKmsKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultKmsKey); + if (message.googleManagedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "googleManagedEncryptionEnforcementConfig")) + $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.encode(message.googleManagedEncryptionEnforcementConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customerManagedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "customerManagedEncryptionEnforcementConfig")) + $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.encode(message.customerManagedEncryptionEnforcementConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.customerSuppliedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "customerSuppliedEncryptionEnforcementConfig")) + $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.encode(message.customerSuppliedEncryptionEnforcementConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Encryption message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {google.storage.v2.Bucket.IEncryption} message Encryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Encryption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Encryption message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Encryption} Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encryption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Encryption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultKmsKey = reader.string(); + break; + } + case 2: { + message.googleManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.customerManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.customerSuppliedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Encryption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Encryption} Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Encryption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Encryption message. + * @function verify + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Encryption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.defaultKmsKey != null && message.hasOwnProperty("defaultKmsKey")) + if (!$util.isString(message.defaultKmsKey)) + return "defaultKmsKey: string expected"; + if (message.googleManagedEncryptionEnforcementConfig != null && message.hasOwnProperty("googleManagedEncryptionEnforcementConfig")) { + properties._googleManagedEncryptionEnforcementConfig = 1; + { + var error = $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.verify(message.googleManagedEncryptionEnforcementConfig); + if (error) + return "googleManagedEncryptionEnforcementConfig." + error; + } + } + if (message.customerManagedEncryptionEnforcementConfig != null && message.hasOwnProperty("customerManagedEncryptionEnforcementConfig")) { + properties._customerManagedEncryptionEnforcementConfig = 1; + { + var error = $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.verify(message.customerManagedEncryptionEnforcementConfig); + if (error) + return "customerManagedEncryptionEnforcementConfig." + error; + } + } + if (message.customerSuppliedEncryptionEnforcementConfig != null && message.hasOwnProperty("customerSuppliedEncryptionEnforcementConfig")) { + properties._customerSuppliedEncryptionEnforcementConfig = 1; + { + var error = $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.verify(message.customerSuppliedEncryptionEnforcementConfig); + if (error) + return "customerSuppliedEncryptionEnforcementConfig." + error; + } + } + return null; + }; + + /** + * Creates an Encryption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Encryption} Encryption + */ + Encryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Encryption) + return object; + var message = new $root.google.storage.v2.Bucket.Encryption(); + if (object.defaultKmsKey != null) + message.defaultKmsKey = String(object.defaultKmsKey); + if (object.googleManagedEncryptionEnforcementConfig != null) { + if (typeof object.googleManagedEncryptionEnforcementConfig !== "object") + throw TypeError(".google.storage.v2.Bucket.Encryption.googleManagedEncryptionEnforcementConfig: object expected"); + message.googleManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.fromObject(object.googleManagedEncryptionEnforcementConfig); + } + if (object.customerManagedEncryptionEnforcementConfig != null) { + if (typeof object.customerManagedEncryptionEnforcementConfig !== "object") + throw TypeError(".google.storage.v2.Bucket.Encryption.customerManagedEncryptionEnforcementConfig: object expected"); + message.customerManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.fromObject(object.customerManagedEncryptionEnforcementConfig); + } + if (object.customerSuppliedEncryptionEnforcementConfig != null) { + if (typeof object.customerSuppliedEncryptionEnforcementConfig !== "object") + throw TypeError(".google.storage.v2.Bucket.Encryption.customerSuppliedEncryptionEnforcementConfig: object expected"); + message.customerSuppliedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.fromObject(object.customerSuppliedEncryptionEnforcementConfig); + } + return message; + }; + + /** + * Creates a plain object from an Encryption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {google.storage.v2.Bucket.Encryption} message Encryption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Encryption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.defaultKmsKey = ""; + if (message.defaultKmsKey != null && message.hasOwnProperty("defaultKmsKey")) + object.defaultKmsKey = message.defaultKmsKey; + if (message.googleManagedEncryptionEnforcementConfig != null && message.hasOwnProperty("googleManagedEncryptionEnforcementConfig")) { + object.googleManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.toObject(message.googleManagedEncryptionEnforcementConfig, options); + if (options.oneofs) + object._googleManagedEncryptionEnforcementConfig = "googleManagedEncryptionEnforcementConfig"; + } + if (message.customerManagedEncryptionEnforcementConfig != null && message.hasOwnProperty("customerManagedEncryptionEnforcementConfig")) { + object.customerManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.toObject(message.customerManagedEncryptionEnforcementConfig, options); + if (options.oneofs) + object._customerManagedEncryptionEnforcementConfig = "customerManagedEncryptionEnforcementConfig"; + } + if (message.customerSuppliedEncryptionEnforcementConfig != null && message.hasOwnProperty("customerSuppliedEncryptionEnforcementConfig")) { + object.customerSuppliedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.toObject(message.customerSuppliedEncryptionEnforcementConfig, options); + if (options.oneofs) + object._customerSuppliedEncryptionEnforcementConfig = "customerSuppliedEncryptionEnforcementConfig"; + } + return object; + }; + + /** + * Converts this Encryption to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Encryption + * @instance + * @returns {Object.} JSON object + */ + Encryption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Encryption + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Encryption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Encryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Encryption"; + }; + + Encryption.GoogleManagedEncryptionEnforcementConfig = (function() { + + /** + * Properties of a GoogleManagedEncryptionEnforcementConfig. + * @memberof google.storage.v2.Bucket.Encryption + * @interface IGoogleManagedEncryptionEnforcementConfig + * @property {string|null} [restrictionMode] GoogleManagedEncryptionEnforcementConfig restrictionMode + * @property {google.protobuf.ITimestamp|null} [effectiveTime] GoogleManagedEncryptionEnforcementConfig effectiveTime + */ + + /** + * Constructs a new GoogleManagedEncryptionEnforcementConfig. + * @memberof google.storage.v2.Bucket.Encryption + * @classdesc Represents a GoogleManagedEncryptionEnforcementConfig. + * @implements IGoogleManagedEncryptionEnforcementConfig + * @constructor + * @param {google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig=} [properties] Properties to set + */ + function GoogleManagedEncryptionEnforcementConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleManagedEncryptionEnforcementConfig restrictionMode. + * @member {string|null|undefined} restrictionMode + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @instance + */ + GoogleManagedEncryptionEnforcementConfig.prototype.restrictionMode = null; + + /** + * GoogleManagedEncryptionEnforcementConfig effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @instance + */ + GoogleManagedEncryptionEnforcementConfig.prototype.effectiveTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GoogleManagedEncryptionEnforcementConfig.prototype, "_restrictionMode", { + get: $util.oneOfGetter($oneOfFields = ["restrictionMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GoogleManagedEncryptionEnforcementConfig.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GoogleManagedEncryptionEnforcementConfig instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig} GoogleManagedEncryptionEnforcementConfig instance + */ + GoogleManagedEncryptionEnforcementConfig.create = function create(properties) { + return new GoogleManagedEncryptionEnforcementConfig(properties); + }; + + /** + * Encodes the specified GoogleManagedEncryptionEnforcementConfig message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig} message GoogleManagedEncryptionEnforcementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleManagedEncryptionEnforcementConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictionMode != null && Object.hasOwnProperty.call(message, "restrictionMode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictionMode); + return writer; + }; + + /** + * Encodes the specified GoogleManagedEncryptionEnforcementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.IGoogleManagedEncryptionEnforcementConfig} message GoogleManagedEncryptionEnforcementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleManagedEncryptionEnforcementConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleManagedEncryptionEnforcementConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig} GoogleManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleManagedEncryptionEnforcementConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.restrictionMode = reader.string(); + break; + } + case 2: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleManagedEncryptionEnforcementConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig} GoogleManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleManagedEncryptionEnforcementConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleManagedEncryptionEnforcementConfig message. + * @function verify + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleManagedEncryptionEnforcementConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { + properties._restrictionMode = 1; + if (!$util.isString(message.restrictionMode)) + return "restrictionMode: string expected"; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + return null; + }; + + /** + * Creates a GoogleManagedEncryptionEnforcementConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig} GoogleManagedEncryptionEnforcementConfig + */ + GoogleManagedEncryptionEnforcementConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig) + return object; + var message = new $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig(); + if (object.restrictionMode != null) + message.restrictionMode = String(object.restrictionMode); + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + return message; + }; + + /** + * Creates a plain object from a GoogleManagedEncryptionEnforcementConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig} message GoogleManagedEncryptionEnforcementConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleManagedEncryptionEnforcementConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { + object.restrictionMode = message.restrictionMode; + if (options.oneofs) + object._restrictionMode = "restrictionMode"; + } + return object; + }; + + /** + * Converts this GoogleManagedEncryptionEnforcementConfig to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @instance + * @returns {Object.} JSON object + */ + GoogleManagedEncryptionEnforcementConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleManagedEncryptionEnforcementConfig + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleManagedEncryptionEnforcementConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig"; + }; + + return GoogleManagedEncryptionEnforcementConfig; + })(); + + Encryption.CustomerManagedEncryptionEnforcementConfig = (function() { + + /** + * Properties of a CustomerManagedEncryptionEnforcementConfig. + * @memberof google.storage.v2.Bucket.Encryption + * @interface ICustomerManagedEncryptionEnforcementConfig + * @property {string|null} [restrictionMode] CustomerManagedEncryptionEnforcementConfig restrictionMode + * @property {google.protobuf.ITimestamp|null} [effectiveTime] CustomerManagedEncryptionEnforcementConfig effectiveTime + */ + + /** + * Constructs a new CustomerManagedEncryptionEnforcementConfig. + * @memberof google.storage.v2.Bucket.Encryption + * @classdesc Represents a CustomerManagedEncryptionEnforcementConfig. + * @implements ICustomerManagedEncryptionEnforcementConfig + * @constructor + * @param {google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig=} [properties] Properties to set + */ + function CustomerManagedEncryptionEnforcementConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerManagedEncryptionEnforcementConfig restrictionMode. + * @member {string|null|undefined} restrictionMode + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @instance + */ + CustomerManagedEncryptionEnforcementConfig.prototype.restrictionMode = null; + + /** + * CustomerManagedEncryptionEnforcementConfig effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @instance + */ + CustomerManagedEncryptionEnforcementConfig.prototype.effectiveTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomerManagedEncryptionEnforcementConfig.prototype, "_restrictionMode", { + get: $util.oneOfGetter($oneOfFields = ["restrictionMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomerManagedEncryptionEnforcementConfig.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerManagedEncryptionEnforcementConfig instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig} CustomerManagedEncryptionEnforcementConfig instance + */ + CustomerManagedEncryptionEnforcementConfig.create = function create(properties) { + return new CustomerManagedEncryptionEnforcementConfig(properties); + }; + + /** + * Encodes the specified CustomerManagedEncryptionEnforcementConfig message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig} message CustomerManagedEncryptionEnforcementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerManagedEncryptionEnforcementConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictionMode != null && Object.hasOwnProperty.call(message, "restrictionMode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictionMode); + return writer; + }; + + /** + * Encodes the specified CustomerManagedEncryptionEnforcementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.ICustomerManagedEncryptionEnforcementConfig} message CustomerManagedEncryptionEnforcementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerManagedEncryptionEnforcementConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerManagedEncryptionEnforcementConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig} CustomerManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerManagedEncryptionEnforcementConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.restrictionMode = reader.string(); + break; + } + case 2: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerManagedEncryptionEnforcementConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig} CustomerManagedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerManagedEncryptionEnforcementConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerManagedEncryptionEnforcementConfig message. + * @function verify + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerManagedEncryptionEnforcementConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { + properties._restrictionMode = 1; + if (!$util.isString(message.restrictionMode)) + return "restrictionMode: string expected"; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + return null; + }; + + /** + * Creates a CustomerManagedEncryptionEnforcementConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig} CustomerManagedEncryptionEnforcementConfig + */ + CustomerManagedEncryptionEnforcementConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig) + return object; + var message = new $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig(); + if (object.restrictionMode != null) + message.restrictionMode = String(object.restrictionMode); + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + return message; + }; + + /** + * Creates a plain object from a CustomerManagedEncryptionEnforcementConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig} message CustomerManagedEncryptionEnforcementConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerManagedEncryptionEnforcementConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { + object.restrictionMode = message.restrictionMode; + if (options.oneofs) + object._restrictionMode = "restrictionMode"; + } + return object; + }; + + /** + * Converts this CustomerManagedEncryptionEnforcementConfig to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @instance + * @returns {Object.} JSON object + */ + CustomerManagedEncryptionEnforcementConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerManagedEncryptionEnforcementConfig + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerManagedEncryptionEnforcementConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig"; + }; + + return CustomerManagedEncryptionEnforcementConfig; + })(); + + Encryption.CustomerSuppliedEncryptionEnforcementConfig = (function() { + + /** + * Properties of a CustomerSuppliedEncryptionEnforcementConfig. + * @memberof google.storage.v2.Bucket.Encryption + * @interface ICustomerSuppliedEncryptionEnforcementConfig + * @property {string|null} [restrictionMode] CustomerSuppliedEncryptionEnforcementConfig restrictionMode + * @property {google.protobuf.ITimestamp|null} [effectiveTime] CustomerSuppliedEncryptionEnforcementConfig effectiveTime + */ + + /** + * Constructs a new CustomerSuppliedEncryptionEnforcementConfig. + * @memberof google.storage.v2.Bucket.Encryption + * @classdesc Represents a CustomerSuppliedEncryptionEnforcementConfig. + * @implements ICustomerSuppliedEncryptionEnforcementConfig + * @constructor + * @param {google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig=} [properties] Properties to set + */ + function CustomerSuppliedEncryptionEnforcementConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerSuppliedEncryptionEnforcementConfig restrictionMode. + * @member {string|null|undefined} restrictionMode + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @instance + */ + CustomerSuppliedEncryptionEnforcementConfig.prototype.restrictionMode = null; + + /** + * CustomerSuppliedEncryptionEnforcementConfig effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @instance + */ + CustomerSuppliedEncryptionEnforcementConfig.prototype.effectiveTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomerSuppliedEncryptionEnforcementConfig.prototype, "_restrictionMode", { + get: $util.oneOfGetter($oneOfFields = ["restrictionMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomerSuppliedEncryptionEnforcementConfig.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerSuppliedEncryptionEnforcementConfig instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig} CustomerSuppliedEncryptionEnforcementConfig instance + */ + CustomerSuppliedEncryptionEnforcementConfig.create = function create(properties) { + return new CustomerSuppliedEncryptionEnforcementConfig(properties); + }; + + /** + * Encodes the specified CustomerSuppliedEncryptionEnforcementConfig message. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig} message CustomerSuppliedEncryptionEnforcementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerSuppliedEncryptionEnforcementConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictionMode != null && Object.hasOwnProperty.call(message, "restrictionMode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictionMode); + return writer; + }; + + /** + * Encodes the specified CustomerSuppliedEncryptionEnforcementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.ICustomerSuppliedEncryptionEnforcementConfig} message CustomerSuppliedEncryptionEnforcementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerSuppliedEncryptionEnforcementConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerSuppliedEncryptionEnforcementConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig} CustomerSuppliedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerSuppliedEncryptionEnforcementConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.restrictionMode = reader.string(); + break; + } + case 2: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerSuppliedEncryptionEnforcementConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig} CustomerSuppliedEncryptionEnforcementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerSuppliedEncryptionEnforcementConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerSuppliedEncryptionEnforcementConfig message. + * @function verify + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerSuppliedEncryptionEnforcementConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { + properties._restrictionMode = 1; + if (!$util.isString(message.restrictionMode)) + return "restrictionMode: string expected"; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + return null; + }; + + /** + * Creates a CustomerSuppliedEncryptionEnforcementConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig} CustomerSuppliedEncryptionEnforcementConfig + */ + CustomerSuppliedEncryptionEnforcementConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig) + return object; + var message = new $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig(); + if (object.restrictionMode != null) + message.restrictionMode = String(object.restrictionMode); + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + return message; + }; + + /** + * Creates a plain object from a CustomerSuppliedEncryptionEnforcementConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig} message CustomerSuppliedEncryptionEnforcementConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerSuppliedEncryptionEnforcementConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { + object.restrictionMode = message.restrictionMode; + if (options.oneofs) + object._restrictionMode = "restrictionMode"; + } + return object; + }; + + /** + * Converts this CustomerSuppliedEncryptionEnforcementConfig to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @instance + * @returns {Object.} JSON object + */ + CustomerSuppliedEncryptionEnforcementConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerSuppliedEncryptionEnforcementConfig + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerSuppliedEncryptionEnforcementConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig"; + }; + + return CustomerSuppliedEncryptionEnforcementConfig; + })(); + + return Encryption; + })(); + + Bucket.IamConfig = (function() { + + /** + * Properties of an IamConfig. + * @memberof google.storage.v2.Bucket + * @interface IIamConfig + * @property {google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess|null} [uniformBucketLevelAccess] IamConfig uniformBucketLevelAccess + * @property {string|null} [publicAccessPrevention] IamConfig publicAccessPrevention + */ + + /** + * Constructs a new IamConfig. + * @memberof google.storage.v2.Bucket + * @classdesc Represents an IamConfig. + * @implements IIamConfig + * @constructor + * @param {google.storage.v2.Bucket.IIamConfig=} [properties] Properties to set + */ + function IamConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IamConfig uniformBucketLevelAccess. + * @member {google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess|null|undefined} uniformBucketLevelAccess + * @memberof google.storage.v2.Bucket.IamConfig + * @instance + */ + IamConfig.prototype.uniformBucketLevelAccess = null; + + /** + * IamConfig publicAccessPrevention. + * @member {string} publicAccessPrevention + * @memberof google.storage.v2.Bucket.IamConfig + * @instance + */ + IamConfig.prototype.publicAccessPrevention = ""; + + /** + * Creates a new IamConfig instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {google.storage.v2.Bucket.IIamConfig=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.IamConfig} IamConfig instance + */ + IamConfig.create = function create(properties) { + return new IamConfig(properties); + }; + + /** + * Encodes the specified IamConfig message. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {google.storage.v2.Bucket.IIamConfig} message IamConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uniformBucketLevelAccess != null && Object.hasOwnProperty.call(message, "uniformBucketLevelAccess")) + $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.encode(message.uniformBucketLevelAccess, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.publicAccessPrevention != null && Object.hasOwnProperty.call(message, "publicAccessPrevention")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicAccessPrevention); + return writer; + }; + + /** + * Encodes the specified IamConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {google.storage.v2.Bucket.IIamConfig} message IamConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.IamConfig} IamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.IamConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uniformBucketLevelAccess = $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.decode(reader, reader.uint32()); + break; + } + case 3: { + message.publicAccessPrevention = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.IamConfig} IamConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamConfig message. + * @function verify + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uniformBucketLevelAccess != null && message.hasOwnProperty("uniformBucketLevelAccess")) { + var error = $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.verify(message.uniformBucketLevelAccess); + if (error) + return "uniformBucketLevelAccess." + error; + } + if (message.publicAccessPrevention != null && message.hasOwnProperty("publicAccessPrevention")) + if (!$util.isString(message.publicAccessPrevention)) + return "publicAccessPrevention: string expected"; + return null; + }; + + /** + * Creates an IamConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.IamConfig} IamConfig + */ + IamConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.IamConfig) + return object; + var message = new $root.google.storage.v2.Bucket.IamConfig(); + if (object.uniformBucketLevelAccess != null) { + if (typeof object.uniformBucketLevelAccess !== "object") + throw TypeError(".google.storage.v2.Bucket.IamConfig.uniformBucketLevelAccess: object expected"); + message.uniformBucketLevelAccess = $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.fromObject(object.uniformBucketLevelAccess); + } + if (object.publicAccessPrevention != null) + message.publicAccessPrevention = String(object.publicAccessPrevention); + return message; + }; + + /** + * Creates a plain object from an IamConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {google.storage.v2.Bucket.IamConfig} message IamConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uniformBucketLevelAccess = null; + object.publicAccessPrevention = ""; + } + if (message.uniformBucketLevelAccess != null && message.hasOwnProperty("uniformBucketLevelAccess")) + object.uniformBucketLevelAccess = $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.toObject(message.uniformBucketLevelAccess, options); + if (message.publicAccessPrevention != null && message.hasOwnProperty("publicAccessPrevention")) + object.publicAccessPrevention = message.publicAccessPrevention; + return object; + }; + + /** + * Converts this IamConfig to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.IamConfig + * @instance + * @returns {Object.} JSON object + */ + IamConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamConfig + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.IamConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.IamConfig"; + }; + + IamConfig.UniformBucketLevelAccess = (function() { + + /** + * Properties of an UniformBucketLevelAccess. + * @memberof google.storage.v2.Bucket.IamConfig + * @interface IUniformBucketLevelAccess + * @property {boolean|null} [enabled] UniformBucketLevelAccess enabled + * @property {google.protobuf.ITimestamp|null} [lockTime] UniformBucketLevelAccess lockTime + */ + + /** + * Constructs a new UniformBucketLevelAccess. + * @memberof google.storage.v2.Bucket.IamConfig + * @classdesc Represents an UniformBucketLevelAccess. + * @implements IUniformBucketLevelAccess + * @constructor + * @param {google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess=} [properties] Properties to set + */ + function UniformBucketLevelAccess(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UniformBucketLevelAccess enabled. + * @member {boolean} enabled + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @instance + */ + UniformBucketLevelAccess.prototype.enabled = false; + + /** + * UniformBucketLevelAccess lockTime. + * @member {google.protobuf.ITimestamp|null|undefined} lockTime + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @instance + */ + UniformBucketLevelAccess.prototype.lockTime = null; + + /** + * Creates a new UniformBucketLevelAccess instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} UniformBucketLevelAccess instance + */ + UniformBucketLevelAccess.create = function create(properties) { + return new UniformBucketLevelAccess(properties); + }; + + /** + * Encodes the specified UniformBucketLevelAccess message. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess} message UniformBucketLevelAccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UniformBucketLevelAccess.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.lockTime != null && Object.hasOwnProperty.call(message, "lockTime")) + $root.google.protobuf.Timestamp.encode(message.lockTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UniformBucketLevelAccess message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {google.storage.v2.Bucket.IamConfig.IUniformBucketLevelAccess} message UniformBucketLevelAccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UniformBucketLevelAccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UniformBucketLevelAccess message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} UniformBucketLevelAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UniformBucketLevelAccess.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.lockTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UniformBucketLevelAccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} UniformBucketLevelAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UniformBucketLevelAccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UniformBucketLevelAccess message. + * @function verify + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UniformBucketLevelAccess.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.lockTime != null && message.hasOwnProperty("lockTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lockTime); + if (error) + return "lockTime." + error; + } + return null; + }; + + /** + * Creates an UniformBucketLevelAccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} UniformBucketLevelAccess + */ + UniformBucketLevelAccess.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) + return object; + var message = new $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.lockTime != null) { + if (typeof object.lockTime !== "object") + throw TypeError(".google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.lockTime: object expected"); + message.lockTime = $root.google.protobuf.Timestamp.fromObject(object.lockTime); + } + return message; + }; + + /** + * Creates a plain object from an UniformBucketLevelAccess message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess} message UniformBucketLevelAccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UniformBucketLevelAccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.lockTime = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.lockTime != null && message.hasOwnProperty("lockTime")) + object.lockTime = $root.google.protobuf.Timestamp.toObject(message.lockTime, options); + return object; + }; + + /** + * Converts this UniformBucketLevelAccess to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @instance + * @returns {Object.} JSON object + */ + UniformBucketLevelAccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UniformBucketLevelAccess + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UniformBucketLevelAccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess"; + }; + + return UniformBucketLevelAccess; + })(); + + return IamConfig; + })(); + + Bucket.Lifecycle = (function() { + + /** + * Properties of a Lifecycle. + * @memberof google.storage.v2.Bucket + * @interface ILifecycle + * @property {Array.|null} [rule] Lifecycle rule + */ + + /** + * Constructs a new Lifecycle. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a Lifecycle. + * @implements ILifecycle + * @constructor + * @param {google.storage.v2.Bucket.ILifecycle=} [properties] Properties to set + */ + function Lifecycle(properties) { + this.rule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Lifecycle rule. + * @member {Array.} rule + * @memberof google.storage.v2.Bucket.Lifecycle + * @instance + */ + Lifecycle.prototype.rule = $util.emptyArray; + + /** + * Creates a new Lifecycle instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {google.storage.v2.Bucket.ILifecycle=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Lifecycle} Lifecycle instance + */ + Lifecycle.create = function create(properties) { + return new Lifecycle(properties); + }; + + /** + * Encodes the specified Lifecycle message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {google.storage.v2.Bucket.ILifecycle} message Lifecycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Lifecycle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rule != null && message.rule.length) + for (var i = 0; i < message.rule.length; ++i) + $root.google.storage.v2.Bucket.Lifecycle.Rule.encode(message.rule[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Lifecycle message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {google.storage.v2.Bucket.ILifecycle} message Lifecycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Lifecycle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Lifecycle message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Lifecycle} Lifecycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Lifecycle.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Lifecycle(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rule && message.rule.length)) + message.rule = []; + message.rule.push($root.google.storage.v2.Bucket.Lifecycle.Rule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Lifecycle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Lifecycle} Lifecycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Lifecycle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Lifecycle message. + * @function verify + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Lifecycle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rule != null && message.hasOwnProperty("rule")) { + if (!Array.isArray(message.rule)) + return "rule: array expected"; + for (var i = 0; i < message.rule.length; ++i) { + var error = $root.google.storage.v2.Bucket.Lifecycle.Rule.verify(message.rule[i]); + if (error) + return "rule." + error; + } + } + return null; + }; + + /** + * Creates a Lifecycle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Lifecycle} Lifecycle + */ + Lifecycle.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Lifecycle) + return object; + var message = new $root.google.storage.v2.Bucket.Lifecycle(); + if (object.rule) { + if (!Array.isArray(object.rule)) + throw TypeError(".google.storage.v2.Bucket.Lifecycle.rule: array expected"); + message.rule = []; + for (var i = 0; i < object.rule.length; ++i) { + if (typeof object.rule[i] !== "object") + throw TypeError(".google.storage.v2.Bucket.Lifecycle.rule: object expected"); + message.rule[i] = $root.google.storage.v2.Bucket.Lifecycle.Rule.fromObject(object.rule[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Lifecycle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {google.storage.v2.Bucket.Lifecycle} message Lifecycle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Lifecycle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rule = []; + if (message.rule && message.rule.length) { + object.rule = []; + for (var j = 0; j < message.rule.length; ++j) + object.rule[j] = $root.google.storage.v2.Bucket.Lifecycle.Rule.toObject(message.rule[j], options); + } + return object; + }; + + /** + * Converts this Lifecycle to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Lifecycle + * @instance + * @returns {Object.} JSON object + */ + Lifecycle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Lifecycle + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Lifecycle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Lifecycle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Lifecycle"; + }; + + Lifecycle.Rule = (function() { + + /** + * Properties of a Rule. + * @memberof google.storage.v2.Bucket.Lifecycle + * @interface IRule + * @property {google.storage.v2.Bucket.Lifecycle.Rule.IAction|null} [action] Rule action + * @property {google.storage.v2.Bucket.Lifecycle.Rule.ICondition|null} [condition] Rule condition + */ + + /** + * Constructs a new Rule. + * @memberof google.storage.v2.Bucket.Lifecycle + * @classdesc Represents a Rule. + * @implements IRule + * @constructor + * @param {google.storage.v2.Bucket.Lifecycle.IRule=} [properties] Properties to set + */ + function Rule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Rule action. + * @member {google.storage.v2.Bucket.Lifecycle.Rule.IAction|null|undefined} action + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @instance + */ + Rule.prototype.action = null; + + /** + * Rule condition. + * @member {google.storage.v2.Bucket.Lifecycle.Rule.ICondition|null|undefined} condition + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @instance + */ + Rule.prototype.condition = null; + + /** + * Creates a new Rule instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {google.storage.v2.Bucket.Lifecycle.IRule=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Lifecycle.Rule} Rule instance + */ + Rule.create = function create(properties) { + return new Rule(properties); + }; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {google.storage.v2.Bucket.Lifecycle.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.encode(message.action, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.encode(message.condition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {google.storage.v2.Bucket.Lifecycle.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Lifecycle.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Lifecycle.Rule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.decode(reader, reader.uint32()); + break; + } + case 2: { + message.condition = $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Lifecycle.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rule message. + * @function verify + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.verify(message.action); + if (error) + return "action." + error; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Lifecycle.Rule} Rule + */ + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Lifecycle.Rule) + return object; + var message = new $root.google.storage.v2.Bucket.Lifecycle.Rule(); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.action: object expected"); + message.action = $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.fromObject(object.action); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.condition: object expected"); + message.condition = $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule} message Rule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = null; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.toObject(message.action, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Rule to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @instance + * @returns {Object.} JSON object + */ + Rule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rule + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Lifecycle.Rule"; + }; + + Rule.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @interface IAction + * @property {string|null} [type] Action type + * @property {string|null} [storageClass] Action storageClass + */ + + /** + * Constructs a new Action. + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.storage.v2.Bucket.Lifecycle.Rule.IAction=} [properties] Properties to set + */ + function Action(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action type. + * @member {string} type + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @instance + */ + Action.prototype.type = ""; + + /** + * Action storageClass. + * @member {string} storageClass + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @instance + */ + Action.prototype.storageClass = ""; + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.IAction=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Action.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.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.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.storageClass); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Lifecycle.Rule.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.storageClass = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.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.storageClass != null && message.hasOwnProperty("storageClass")) + if (!$util.isString(message.storageClass)) + return "storageClass: string expected"; + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Lifecycle.Rule.Action) + return object; + var message = new $root.google.storage.v2.Bucket.Lifecycle.Rule.Action(); + if (object.type != null) + message.type = String(object.type); + if (object.storageClass != null) + message.storageClass = String(object.storageClass); + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.storageClass = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + object.storageClass = message.storageClass; + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Lifecycle.Rule.Action"; + }; + + return Action; + })(); + + Rule.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @interface ICondition + * @property {number|null} [ageDays] Condition ageDays + * @property {google.type.IDate|null} [createdBefore] Condition createdBefore + * @property {boolean|null} [isLive] Condition isLive + * @property {number|null} [numNewerVersions] Condition numNewerVersions + * @property {Array.|null} [matchesStorageClass] Condition matchesStorageClass + * @property {number|null} [daysSinceCustomTime] Condition daysSinceCustomTime + * @property {google.type.IDate|null} [customTimeBefore] Condition customTimeBefore + * @property {number|null} [daysSinceNoncurrentTime] Condition daysSinceNoncurrentTime + * @property {google.type.IDate|null} [noncurrentTimeBefore] Condition noncurrentTimeBefore + * @property {Array.|null} [matchesPrefix] Condition matchesPrefix + * @property {Array.|null} [matchesSuffix] Condition matchesSuffix + */ + + /** + * Constructs a new Condition. + * @memberof google.storage.v2.Bucket.Lifecycle.Rule + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.storage.v2.Bucket.Lifecycle.Rule.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.matchesStorageClass = []; + this.matchesPrefix = []; + this.matchesSuffix = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Condition ageDays. + * @member {number|null|undefined} ageDays + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.ageDays = null; + + /** + * Condition createdBefore. + * @member {google.type.IDate|null|undefined} createdBefore + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.createdBefore = null; + + /** + * Condition isLive. + * @member {boolean|null|undefined} isLive + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.isLive = null; + + /** + * Condition numNewerVersions. + * @member {number|null|undefined} numNewerVersions + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.numNewerVersions = null; + + /** + * Condition matchesStorageClass. + * @member {Array.} matchesStorageClass + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.matchesStorageClass = $util.emptyArray; + + /** + * Condition daysSinceCustomTime. + * @member {number|null|undefined} daysSinceCustomTime + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.daysSinceCustomTime = null; + + /** + * Condition customTimeBefore. + * @member {google.type.IDate|null|undefined} customTimeBefore + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.customTimeBefore = null; + + /** + * Condition daysSinceNoncurrentTime. + * @member {number|null|undefined} daysSinceNoncurrentTime + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.daysSinceNoncurrentTime = null; + + /** + * Condition noncurrentTimeBefore. + * @member {google.type.IDate|null|undefined} noncurrentTimeBefore + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.noncurrentTimeBefore = null; + + /** + * Condition matchesPrefix. + * @member {Array.} matchesPrefix + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.matchesPrefix = $util.emptyArray; + + /** + * Condition matchesSuffix. + * @member {Array.} matchesSuffix + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + */ + Condition.prototype.matchesSuffix = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Condition.prototype, "_ageDays", { + get: $util.oneOfGetter($oneOfFields = ["ageDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Condition.prototype, "_isLive", { + get: $util.oneOfGetter($oneOfFields = ["isLive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Condition.prototype, "_numNewerVersions", { + get: $util.oneOfGetter($oneOfFields = ["numNewerVersions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Condition.prototype, "_daysSinceCustomTime", { + get: $util.oneOfGetter($oneOfFields = ["daysSinceCustomTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Condition.prototype, "_daysSinceNoncurrentTime", { + get: $util.oneOfGetter($oneOfFields = ["daysSinceNoncurrentTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.ICondition=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Condition.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ageDays != null && Object.hasOwnProperty.call(message, "ageDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ageDays); + if (message.createdBefore != null && Object.hasOwnProperty.call(message, "createdBefore")) + $root.google.type.Date.encode(message.createdBefore, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isLive); + if (message.numNewerVersions != null && Object.hasOwnProperty.call(message, "numNewerVersions")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.numNewerVersions); + if (message.matchesStorageClass != null && message.matchesStorageClass.length) + for (var i = 0; i < message.matchesStorageClass.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.matchesStorageClass[i]); + if (message.daysSinceCustomTime != null && Object.hasOwnProperty.call(message, "daysSinceCustomTime")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.daysSinceCustomTime); + if (message.customTimeBefore != null && Object.hasOwnProperty.call(message, "customTimeBefore")) + $root.google.type.Date.encode(message.customTimeBefore, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.daysSinceNoncurrentTime != null && Object.hasOwnProperty.call(message, "daysSinceNoncurrentTime")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.daysSinceNoncurrentTime); + if (message.noncurrentTimeBefore != null && Object.hasOwnProperty.call(message, "noncurrentTimeBefore")) + $root.google.type.Date.encode(message.noncurrentTimeBefore, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.matchesPrefix != null && message.matchesPrefix.length) + for (var i = 0; i < message.matchesPrefix.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.matchesPrefix[i]); + if (message.matchesSuffix != null && message.matchesSuffix.length) + for (var i = 0; i < message.matchesSuffix.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.matchesSuffix[i]); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Lifecycle.Rule.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ageDays = reader.int32(); + break; + } + case 2: { + message.createdBefore = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 3: { + message.isLive = reader.bool(); + break; + } + case 4: { + message.numNewerVersions = reader.int32(); + break; + } + case 5: { + if (!(message.matchesStorageClass && message.matchesStorageClass.length)) + message.matchesStorageClass = []; + message.matchesStorageClass.push(reader.string()); + break; + } + case 7: { + message.daysSinceCustomTime = reader.int32(); + break; + } + case 8: { + message.customTimeBefore = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 9: { + message.daysSinceNoncurrentTime = reader.int32(); + break; + } + case 10: { + message.noncurrentTimeBefore = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.matchesPrefix && message.matchesPrefix.length)) + message.matchesPrefix = []; + message.matchesPrefix.push(reader.string()); + break; + } + case 12: { + if (!(message.matchesSuffix && message.matchesSuffix.length)) + message.matchesSuffix = []; + message.matchesSuffix.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ageDays != null && message.hasOwnProperty("ageDays")) { + properties._ageDays = 1; + if (!$util.isInteger(message.ageDays)) + return "ageDays: integer expected"; + } + if (message.createdBefore != null && message.hasOwnProperty("createdBefore")) { + var error = $root.google.type.Date.verify(message.createdBefore); + if (error) + return "createdBefore." + error; + } + if (message.isLive != null && message.hasOwnProperty("isLive")) { + properties._isLive = 1; + if (typeof message.isLive !== "boolean") + return "isLive: boolean expected"; + } + if (message.numNewerVersions != null && message.hasOwnProperty("numNewerVersions")) { + properties._numNewerVersions = 1; + if (!$util.isInteger(message.numNewerVersions)) + return "numNewerVersions: integer expected"; + } + if (message.matchesStorageClass != null && message.hasOwnProperty("matchesStorageClass")) { + if (!Array.isArray(message.matchesStorageClass)) + return "matchesStorageClass: array expected"; + for (var i = 0; i < message.matchesStorageClass.length; ++i) + if (!$util.isString(message.matchesStorageClass[i])) + return "matchesStorageClass: string[] expected"; + } + if (message.daysSinceCustomTime != null && message.hasOwnProperty("daysSinceCustomTime")) { + properties._daysSinceCustomTime = 1; + if (!$util.isInteger(message.daysSinceCustomTime)) + return "daysSinceCustomTime: integer expected"; + } + if (message.customTimeBefore != null && message.hasOwnProperty("customTimeBefore")) { + var error = $root.google.type.Date.verify(message.customTimeBefore); + if (error) + return "customTimeBefore." + error; + } + if (message.daysSinceNoncurrentTime != null && message.hasOwnProperty("daysSinceNoncurrentTime")) { + properties._daysSinceNoncurrentTime = 1; + if (!$util.isInteger(message.daysSinceNoncurrentTime)) + return "daysSinceNoncurrentTime: integer expected"; + } + if (message.noncurrentTimeBefore != null && message.hasOwnProperty("noncurrentTimeBefore")) { + var error = $root.google.type.Date.verify(message.noncurrentTimeBefore); + if (error) + return "noncurrentTimeBefore." + error; + } + if (message.matchesPrefix != null && message.hasOwnProperty("matchesPrefix")) { + if (!Array.isArray(message.matchesPrefix)) + return "matchesPrefix: array expected"; + for (var i = 0; i < message.matchesPrefix.length; ++i) + if (!$util.isString(message.matchesPrefix[i])) + return "matchesPrefix: string[] expected"; + } + if (message.matchesSuffix != null && message.hasOwnProperty("matchesSuffix")) { + if (!Array.isArray(message.matchesSuffix)) + return "matchesSuffix: array expected"; + for (var i = 0; i < message.matchesSuffix.length; ++i) + if (!$util.isString(message.matchesSuffix[i])) + return "matchesSuffix: string[] expected"; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Lifecycle.Rule.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition) + return object; + var message = new $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition(); + if (object.ageDays != null) + message.ageDays = object.ageDays | 0; + if (object.createdBefore != null) { + if (typeof object.createdBefore !== "object") + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition.createdBefore: object expected"); + message.createdBefore = $root.google.type.Date.fromObject(object.createdBefore); + } + if (object.isLive != null) + message.isLive = Boolean(object.isLive); + if (object.numNewerVersions != null) + message.numNewerVersions = object.numNewerVersions | 0; + if (object.matchesStorageClass) { + if (!Array.isArray(object.matchesStorageClass)) + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition.matchesStorageClass: array expected"); + message.matchesStorageClass = []; + for (var i = 0; i < object.matchesStorageClass.length; ++i) + message.matchesStorageClass[i] = String(object.matchesStorageClass[i]); + } + if (object.daysSinceCustomTime != null) + message.daysSinceCustomTime = object.daysSinceCustomTime | 0; + if (object.customTimeBefore != null) { + if (typeof object.customTimeBefore !== "object") + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition.customTimeBefore: object expected"); + message.customTimeBefore = $root.google.type.Date.fromObject(object.customTimeBefore); + } + if (object.daysSinceNoncurrentTime != null) + message.daysSinceNoncurrentTime = object.daysSinceNoncurrentTime | 0; + if (object.noncurrentTimeBefore != null) { + if (typeof object.noncurrentTimeBefore !== "object") + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition.noncurrentTimeBefore: object expected"); + message.noncurrentTimeBefore = $root.google.type.Date.fromObject(object.noncurrentTimeBefore); + } + if (object.matchesPrefix) { + if (!Array.isArray(object.matchesPrefix)) + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition.matchesPrefix: array expected"); + message.matchesPrefix = []; + for (var i = 0; i < object.matchesPrefix.length; ++i) + message.matchesPrefix[i] = String(object.matchesPrefix[i]); + } + if (object.matchesSuffix) { + if (!Array.isArray(object.matchesSuffix)) + throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition.matchesSuffix: array expected"); + message.matchesSuffix = []; + for (var i = 0; i < object.matchesSuffix.length; ++i) + message.matchesSuffix[i] = String(object.matchesSuffix[i]); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {google.storage.v2.Bucket.Lifecycle.Rule.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.matchesStorageClass = []; + object.matchesPrefix = []; + object.matchesSuffix = []; + } + if (options.defaults) { + object.createdBefore = null; + object.customTimeBefore = null; + object.noncurrentTimeBefore = null; + } + if (message.ageDays != null && message.hasOwnProperty("ageDays")) { + object.ageDays = message.ageDays; + if (options.oneofs) + object._ageDays = "ageDays"; + } + if (message.createdBefore != null && message.hasOwnProperty("createdBefore")) + object.createdBefore = $root.google.type.Date.toObject(message.createdBefore, options); + if (message.isLive != null && message.hasOwnProperty("isLive")) { + object.isLive = message.isLive; + if (options.oneofs) + object._isLive = "isLive"; + } + if (message.numNewerVersions != null && message.hasOwnProperty("numNewerVersions")) { + object.numNewerVersions = message.numNewerVersions; + if (options.oneofs) + object._numNewerVersions = "numNewerVersions"; + } + if (message.matchesStorageClass && message.matchesStorageClass.length) { + object.matchesStorageClass = []; + for (var j = 0; j < message.matchesStorageClass.length; ++j) + object.matchesStorageClass[j] = message.matchesStorageClass[j]; + } + if (message.daysSinceCustomTime != null && message.hasOwnProperty("daysSinceCustomTime")) { + object.daysSinceCustomTime = message.daysSinceCustomTime; + if (options.oneofs) + object._daysSinceCustomTime = "daysSinceCustomTime"; + } + if (message.customTimeBefore != null && message.hasOwnProperty("customTimeBefore")) + object.customTimeBefore = $root.google.type.Date.toObject(message.customTimeBefore, options); + if (message.daysSinceNoncurrentTime != null && message.hasOwnProperty("daysSinceNoncurrentTime")) { + object.daysSinceNoncurrentTime = message.daysSinceNoncurrentTime; + if (options.oneofs) + object._daysSinceNoncurrentTime = "daysSinceNoncurrentTime"; + } + if (message.noncurrentTimeBefore != null && message.hasOwnProperty("noncurrentTimeBefore")) + object.noncurrentTimeBefore = $root.google.type.Date.toObject(message.noncurrentTimeBefore, options); + if (message.matchesPrefix && message.matchesPrefix.length) { + object.matchesPrefix = []; + for (var j = 0; j < message.matchesPrefix.length; ++j) + object.matchesPrefix[j] = message.matchesPrefix[j]; + } + if (message.matchesSuffix && message.matchesSuffix.length) { + object.matchesSuffix = []; + for (var j = 0; j < message.matchesSuffix.length; ++j) + object.matchesSuffix[j] = message.matchesSuffix[j]; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Lifecycle.Rule.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Lifecycle.Rule.Condition"; + }; + + return Condition; + })(); + + return Rule; + })(); + + return Lifecycle; + })(); + + Bucket.Logging = (function() { + + /** + * Properties of a Logging. + * @memberof google.storage.v2.Bucket + * @interface ILogging + * @property {string|null} [logBucket] Logging logBucket + * @property {string|null} [logObjectPrefix] Logging logObjectPrefix + */ + + /** + * Constructs a new Logging. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a Logging. + * @implements ILogging + * @constructor + * @param {google.storage.v2.Bucket.ILogging=} [properties] Properties to set + */ + function Logging(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Logging logBucket. + * @member {string} logBucket + * @memberof google.storage.v2.Bucket.Logging + * @instance + */ + Logging.prototype.logBucket = ""; + + /** + * Logging logObjectPrefix. + * @member {string} logObjectPrefix + * @memberof google.storage.v2.Bucket.Logging + * @instance + */ + Logging.prototype.logObjectPrefix = ""; + + /** + * Creates a new Logging instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {google.storage.v2.Bucket.ILogging=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Logging} Logging instance + */ + Logging.create = function create(properties) { + return new Logging(properties); + }; + + /** + * Encodes the specified Logging message. Does not implicitly {@link google.storage.v2.Bucket.Logging.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {google.storage.v2.Bucket.ILogging} message Logging message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Logging.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logBucket != null && Object.hasOwnProperty.call(message, "logBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.logBucket); + if (message.logObjectPrefix != null && Object.hasOwnProperty.call(message, "logObjectPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logObjectPrefix); + return writer; + }; + + /** + * Encodes the specified Logging message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Logging.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {google.storage.v2.Bucket.ILogging} message Logging message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Logging.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Logging message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Logging} Logging + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Logging.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Logging(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logBucket = reader.string(); + break; + } + case 2: { + message.logObjectPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Logging message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Logging} Logging + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Logging.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Logging message. + * @function verify + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Logging.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logBucket != null && message.hasOwnProperty("logBucket")) + if (!$util.isString(message.logBucket)) + return "logBucket: string expected"; + if (message.logObjectPrefix != null && message.hasOwnProperty("logObjectPrefix")) + if (!$util.isString(message.logObjectPrefix)) + return "logObjectPrefix: string expected"; + return null; + }; + + /** + * Creates a Logging message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Logging} Logging + */ + Logging.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Logging) + return object; + var message = new $root.google.storage.v2.Bucket.Logging(); + if (object.logBucket != null) + message.logBucket = String(object.logBucket); + if (object.logObjectPrefix != null) + message.logObjectPrefix = String(object.logObjectPrefix); + return message; + }; + + /** + * Creates a plain object from a Logging message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {google.storage.v2.Bucket.Logging} message Logging + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Logging.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.logBucket = ""; + object.logObjectPrefix = ""; + } + if (message.logBucket != null && message.hasOwnProperty("logBucket")) + object.logBucket = message.logBucket; + if (message.logObjectPrefix != null && message.hasOwnProperty("logObjectPrefix")) + object.logObjectPrefix = message.logObjectPrefix; + return object; + }; + + /** + * Converts this Logging to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Logging + * @instance + * @returns {Object.} JSON object + */ + Logging.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Logging + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Logging + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Logging.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Logging"; + }; + + return Logging; + })(); + + Bucket.ObjectRetention = (function() { + + /** + * Properties of an ObjectRetention. + * @memberof google.storage.v2.Bucket + * @interface IObjectRetention + * @property {boolean|null} [enabled] ObjectRetention enabled + */ + + /** + * Constructs a new ObjectRetention. + * @memberof google.storage.v2.Bucket + * @classdesc Represents an ObjectRetention. + * @implements IObjectRetention + * @constructor + * @param {google.storage.v2.Bucket.IObjectRetention=} [properties] Properties to set + */ + function ObjectRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectRetention enabled. + * @member {boolean} enabled + * @memberof google.storage.v2.Bucket.ObjectRetention + * @instance + */ + ObjectRetention.prototype.enabled = false; + + /** + * Creates a new ObjectRetention instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {google.storage.v2.Bucket.IObjectRetention=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.ObjectRetention} ObjectRetention instance + */ + ObjectRetention.create = function create(properties) { + return new ObjectRetention(properties); + }; + + /** + * Encodes the specified ObjectRetention message. Does not implicitly {@link google.storage.v2.Bucket.ObjectRetention.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {google.storage.v2.Bucket.IObjectRetention} message ObjectRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectRetention.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); + return writer; + }; + + /** + * Encodes the specified ObjectRetention message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.ObjectRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {google.storage.v2.Bucket.IObjectRetention} message ObjectRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectRetention message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.ObjectRetention} ObjectRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.ObjectRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.ObjectRetention} ObjectRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectRetention message. + * @function verify + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectRetention.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"; + return null; + }; + + /** + * Creates an ObjectRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.ObjectRetention} ObjectRetention + */ + ObjectRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.ObjectRetention) + return object; + var message = new $root.google.storage.v2.Bucket.ObjectRetention(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from an ObjectRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {google.storage.v2.Bucket.ObjectRetention} message ObjectRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this ObjectRetention to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.ObjectRetention + * @instance + * @returns {Object.} JSON object + */ + ObjectRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectRetention + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.ObjectRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.ObjectRetention"; + }; + + return ObjectRetention; + })(); + + Bucket.RetentionPolicy = (function() { + + /** + * Properties of a RetentionPolicy. + * @memberof google.storage.v2.Bucket + * @interface IRetentionPolicy + * @property {google.protobuf.ITimestamp|null} [effectiveTime] RetentionPolicy effectiveTime + * @property {boolean|null} [isLocked] RetentionPolicy isLocked + * @property {google.protobuf.IDuration|null} [retentionDuration] RetentionPolicy retentionDuration + */ + + /** + * Constructs a new RetentionPolicy. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a RetentionPolicy. + * @implements IRetentionPolicy + * @constructor + * @param {google.storage.v2.Bucket.IRetentionPolicy=} [properties] Properties to set + */ + function RetentionPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetentionPolicy effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @instance + */ + RetentionPolicy.prototype.effectiveTime = null; + + /** + * RetentionPolicy isLocked. + * @member {boolean} isLocked + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @instance + */ + RetentionPolicy.prototype.isLocked = false; + + /** + * RetentionPolicy retentionDuration. + * @member {google.protobuf.IDuration|null|undefined} retentionDuration + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @instance + */ + RetentionPolicy.prototype.retentionDuration = null; + + /** + * Creates a new RetentionPolicy instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {google.storage.v2.Bucket.IRetentionPolicy=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.RetentionPolicy} RetentionPolicy instance + */ + RetentionPolicy.create = function create(properties) { + return new RetentionPolicy(properties); + }; + + /** + * Encodes the specified RetentionPolicy message. Does not implicitly {@link google.storage.v2.Bucket.RetentionPolicy.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {google.storage.v2.Bucket.IRetentionPolicy} message RetentionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetentionPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.isLocked != null && Object.hasOwnProperty.call(message, "isLocked")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isLocked); + if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) + $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetentionPolicy message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.RetentionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {google.storage.v2.Bucket.IRetentionPolicy} message RetentionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetentionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.RetentionPolicy} RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetentionPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.RetentionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.isLocked = reader.bool(); + break; + } + case 4: { + message.retentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetentionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.RetentionPolicy} RetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetentionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetentionPolicy message. + * @function verify + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetentionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + if (message.isLocked != null && message.hasOwnProperty("isLocked")) + if (typeof message.isLocked !== "boolean") + return "isLocked: boolean expected"; + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.retentionDuration); + if (error) + return "retentionDuration." + error; + } + return null; + }; + + /** + * Creates a RetentionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.RetentionPolicy} RetentionPolicy + */ + RetentionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.RetentionPolicy) + return object; + var message = new $root.google.storage.v2.Bucket.RetentionPolicy(); + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.storage.v2.Bucket.RetentionPolicy.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + if (object.isLocked != null) + message.isLocked = Boolean(object.isLocked); + if (object.retentionDuration != null) { + if (typeof object.retentionDuration !== "object") + throw TypeError(".google.storage.v2.Bucket.RetentionPolicy.retentionDuration: object expected"); + message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration); + } + return message; + }; + + /** + * Creates a plain object from a RetentionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {google.storage.v2.Bucket.RetentionPolicy} message RetentionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetentionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.effectiveTime = null; + object.isLocked = false; + object.retentionDuration = null; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (message.isLocked != null && message.hasOwnProperty("isLocked")) + object.isLocked = message.isLocked; + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) + object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); + return object; + }; + + /** + * Converts this RetentionPolicy to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @instance + * @returns {Object.} JSON object + */ + RetentionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetentionPolicy + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.RetentionPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetentionPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.RetentionPolicy"; + }; + + return RetentionPolicy; + })(); + + Bucket.SoftDeletePolicy = (function() { + + /** + * Properties of a SoftDeletePolicy. + * @memberof google.storage.v2.Bucket + * @interface ISoftDeletePolicy + * @property {google.protobuf.IDuration|null} [retentionDuration] SoftDeletePolicy retentionDuration + * @property {google.protobuf.ITimestamp|null} [effectiveTime] SoftDeletePolicy effectiveTime + */ + + /** + * Constructs a new SoftDeletePolicy. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a SoftDeletePolicy. + * @implements ISoftDeletePolicy + * @constructor + * @param {google.storage.v2.Bucket.ISoftDeletePolicy=} [properties] Properties to set + */ + function SoftDeletePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoftDeletePolicy retentionDuration. + * @member {google.protobuf.IDuration|null|undefined} retentionDuration + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @instance + */ + SoftDeletePolicy.prototype.retentionDuration = null; + + /** + * SoftDeletePolicy effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @instance + */ + SoftDeletePolicy.prototype.effectiveTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SoftDeletePolicy.prototype, "_retentionDuration", { + get: $util.oneOfGetter($oneOfFields = ["retentionDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SoftDeletePolicy.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SoftDeletePolicy instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {google.storage.v2.Bucket.ISoftDeletePolicy=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.SoftDeletePolicy} SoftDeletePolicy instance + */ + SoftDeletePolicy.create = function create(properties) { + return new SoftDeletePolicy(properties); + }; + + /** + * Encodes the specified SoftDeletePolicy message. Does not implicitly {@link google.storage.v2.Bucket.SoftDeletePolicy.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {google.storage.v2.Bucket.ISoftDeletePolicy} message SoftDeletePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftDeletePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) + $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftDeletePolicy message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.SoftDeletePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {google.storage.v2.Bucket.ISoftDeletePolicy} message SoftDeletePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftDeletePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftDeletePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.SoftDeletePolicy} SoftDeletePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftDeletePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.SoftDeletePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftDeletePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.SoftDeletePolicy} SoftDeletePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftDeletePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftDeletePolicy message. + * @function verify + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftDeletePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { + properties._retentionDuration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.retentionDuration); + if (error) + return "retentionDuration." + error; + } + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + return null; + }; + + /** + * Creates a SoftDeletePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.SoftDeletePolicy} SoftDeletePolicy + */ + SoftDeletePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.SoftDeletePolicy) + return object; + var message = new $root.google.storage.v2.Bucket.SoftDeletePolicy(); + if (object.retentionDuration != null) { + if (typeof object.retentionDuration !== "object") + throw TypeError(".google.storage.v2.Bucket.SoftDeletePolicy.retentionDuration: object expected"); + message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration); + } + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.storage.v2.Bucket.SoftDeletePolicy.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + return message; + }; + + /** + * Creates a plain object from a SoftDeletePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {google.storage.v2.Bucket.SoftDeletePolicy} message SoftDeletePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftDeletePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { + object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); + if (options.oneofs) + object._retentionDuration = "retentionDuration"; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + return object; + }; + + /** + * Converts this SoftDeletePolicy to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @instance + * @returns {Object.} JSON object + */ + SoftDeletePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftDeletePolicy + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.SoftDeletePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftDeletePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.SoftDeletePolicy"; + }; + + return SoftDeletePolicy; + })(); + + Bucket.Versioning = (function() { + + /** + * Properties of a Versioning. + * @memberof google.storage.v2.Bucket + * @interface IVersioning + * @property {boolean|null} [enabled] Versioning enabled + */ + + /** + * Constructs a new Versioning. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a Versioning. + * @implements IVersioning + * @constructor + * @param {google.storage.v2.Bucket.IVersioning=} [properties] Properties to set + */ + function Versioning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Versioning enabled. + * @member {boolean} enabled + * @memberof google.storage.v2.Bucket.Versioning + * @instance + */ + Versioning.prototype.enabled = false; + + /** + * Creates a new Versioning instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {google.storage.v2.Bucket.IVersioning=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Versioning} Versioning instance + */ + Versioning.create = function create(properties) { + return new Versioning(properties); + }; + + /** + * Encodes the specified Versioning message. Does not implicitly {@link google.storage.v2.Bucket.Versioning.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {google.storage.v2.Bucket.IVersioning} message Versioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versioning.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); + return writer; + }; + + /** + * Encodes the specified Versioning message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Versioning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {google.storage.v2.Bucket.IVersioning} message Versioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versioning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Versioning message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Versioning} Versioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versioning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Versioning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Versioning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Versioning} Versioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versioning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Versioning message. + * @function verify + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Versioning.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"; + return null; + }; + + /** + * Creates a Versioning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Versioning} Versioning + */ + Versioning.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Versioning) + return object; + var message = new $root.google.storage.v2.Bucket.Versioning(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a Versioning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {google.storage.v2.Bucket.Versioning} message Versioning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Versioning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this Versioning to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Versioning + * @instance + * @returns {Object.} JSON object + */ + Versioning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Versioning + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Versioning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Versioning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Versioning"; + }; + + return Versioning; + })(); + + Bucket.Website = (function() { + + /** + * Properties of a Website. + * @memberof google.storage.v2.Bucket + * @interface IWebsite + * @property {string|null} [mainPageSuffix] Website mainPageSuffix + * @property {string|null} [notFoundPage] Website notFoundPage + */ + + /** + * Constructs a new Website. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a Website. + * @implements IWebsite + * @constructor + * @param {google.storage.v2.Bucket.IWebsite=} [properties] Properties to set + */ + function Website(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Website mainPageSuffix. + * @member {string} mainPageSuffix + * @memberof google.storage.v2.Bucket.Website + * @instance + */ + Website.prototype.mainPageSuffix = ""; + + /** + * Website notFoundPage. + * @member {string} notFoundPage + * @memberof google.storage.v2.Bucket.Website + * @instance + */ + Website.prototype.notFoundPage = ""; + + /** + * Creates a new Website instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {google.storage.v2.Bucket.IWebsite=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Website} Website instance + */ + Website.create = function create(properties) { + return new Website(properties); + }; + + /** + * Encodes the specified Website message. Does not implicitly {@link google.storage.v2.Bucket.Website.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {google.storage.v2.Bucket.IWebsite} message Website message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Website.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPageSuffix != null && Object.hasOwnProperty.call(message, "mainPageSuffix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPageSuffix); + if (message.notFoundPage != null && Object.hasOwnProperty.call(message, "notFoundPage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.notFoundPage); + return writer; + }; + + /** + * Encodes the specified Website message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Website.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {google.storage.v2.Bucket.IWebsite} message Website message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Website.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Website message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Website} Website + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Website.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Website(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainPageSuffix = reader.string(); + break; + } + case 2: { + message.notFoundPage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Website message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Website} Website + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Website.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Website message. + * @function verify + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Website.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainPageSuffix != null && message.hasOwnProperty("mainPageSuffix")) + if (!$util.isString(message.mainPageSuffix)) + return "mainPageSuffix: string expected"; + if (message.notFoundPage != null && message.hasOwnProperty("notFoundPage")) + if (!$util.isString(message.notFoundPage)) + return "notFoundPage: string expected"; + return null; + }; + + /** + * Creates a Website message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Website} Website + */ + Website.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Website) + return object; + var message = new $root.google.storage.v2.Bucket.Website(); + if (object.mainPageSuffix != null) + message.mainPageSuffix = String(object.mainPageSuffix); + if (object.notFoundPage != null) + message.notFoundPage = String(object.notFoundPage); + return message; + }; + + /** + * Creates a plain object from a Website message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {google.storage.v2.Bucket.Website} message Website + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Website.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mainPageSuffix = ""; + object.notFoundPage = ""; + } + if (message.mainPageSuffix != null && message.hasOwnProperty("mainPageSuffix")) + object.mainPageSuffix = message.mainPageSuffix; + if (message.notFoundPage != null && message.hasOwnProperty("notFoundPage")) + object.notFoundPage = message.notFoundPage; + return object; + }; + + /** + * Converts this Website to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Website + * @instance + * @returns {Object.} JSON object + */ + Website.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Website + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Website + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Website.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Website"; + }; + + return Website; + })(); + + Bucket.CustomPlacementConfig = (function() { + + /** + * Properties of a CustomPlacementConfig. + * @memberof google.storage.v2.Bucket + * @interface ICustomPlacementConfig + * @property {Array.|null} [dataLocations] CustomPlacementConfig dataLocations + */ + + /** + * Constructs a new CustomPlacementConfig. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a CustomPlacementConfig. + * @implements ICustomPlacementConfig + * @constructor + * @param {google.storage.v2.Bucket.ICustomPlacementConfig=} [properties] Properties to set + */ + function CustomPlacementConfig(properties) { + this.dataLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomPlacementConfig dataLocations. + * @member {Array.} dataLocations + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @instance + */ + CustomPlacementConfig.prototype.dataLocations = $util.emptyArray; + + /** + * Creates a new CustomPlacementConfig instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {google.storage.v2.Bucket.ICustomPlacementConfig=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.CustomPlacementConfig} CustomPlacementConfig instance + */ + CustomPlacementConfig.create = function create(properties) { + return new CustomPlacementConfig(properties); + }; + + /** + * Encodes the specified CustomPlacementConfig message. Does not implicitly {@link google.storage.v2.Bucket.CustomPlacementConfig.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {google.storage.v2.Bucket.ICustomPlacementConfig} message CustomPlacementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomPlacementConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataLocations != null && message.dataLocations.length) + for (var i = 0; i < message.dataLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataLocations[i]); + return writer; + }; + + /** + * Encodes the specified CustomPlacementConfig message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.CustomPlacementConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {google.storage.v2.Bucket.ICustomPlacementConfig} message CustomPlacementConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomPlacementConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.CustomPlacementConfig} CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomPlacementConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.CustomPlacementConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataLocations && message.dataLocations.length)) + message.dataLocations = []; + message.dataLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomPlacementConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.CustomPlacementConfig} CustomPlacementConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomPlacementConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomPlacementConfig message. + * @function verify + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomPlacementConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataLocations != null && message.hasOwnProperty("dataLocations")) { + if (!Array.isArray(message.dataLocations)) + return "dataLocations: array expected"; + for (var i = 0; i < message.dataLocations.length; ++i) + if (!$util.isString(message.dataLocations[i])) + return "dataLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a CustomPlacementConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.CustomPlacementConfig} CustomPlacementConfig + */ + CustomPlacementConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.CustomPlacementConfig) + return object; + var message = new $root.google.storage.v2.Bucket.CustomPlacementConfig(); + if (object.dataLocations) { + if (!Array.isArray(object.dataLocations)) + throw TypeError(".google.storage.v2.Bucket.CustomPlacementConfig.dataLocations: array expected"); + message.dataLocations = []; + for (var i = 0; i < object.dataLocations.length; ++i) + message.dataLocations[i] = String(object.dataLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a CustomPlacementConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {google.storage.v2.Bucket.CustomPlacementConfig} message CustomPlacementConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomPlacementConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataLocations = []; + if (message.dataLocations && message.dataLocations.length) { + object.dataLocations = []; + for (var j = 0; j < message.dataLocations.length; ++j) + object.dataLocations[j] = message.dataLocations[j]; + } + return object; + }; + + /** + * Converts this CustomPlacementConfig to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @instance + * @returns {Object.} JSON object + */ + CustomPlacementConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomPlacementConfig + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.CustomPlacementConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomPlacementConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.CustomPlacementConfig"; + }; + + return CustomPlacementConfig; + })(); + + Bucket.Autoclass = (function() { + + /** + * Properties of an Autoclass. + * @memberof google.storage.v2.Bucket + * @interface IAutoclass + * @property {boolean|null} [enabled] Autoclass enabled + * @property {google.protobuf.ITimestamp|null} [toggleTime] Autoclass toggleTime + * @property {string|null} [terminalStorageClass] Autoclass terminalStorageClass + * @property {google.protobuf.ITimestamp|null} [terminalStorageClassUpdateTime] Autoclass terminalStorageClassUpdateTime + */ + + /** + * Constructs a new Autoclass. + * @memberof google.storage.v2.Bucket + * @classdesc Represents an Autoclass. + * @implements IAutoclass + * @constructor + * @param {google.storage.v2.Bucket.IAutoclass=} [properties] Properties to set + */ + function Autoclass(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Autoclass enabled. + * @member {boolean} enabled + * @memberof google.storage.v2.Bucket.Autoclass + * @instance + */ + Autoclass.prototype.enabled = false; + + /** + * Autoclass toggleTime. + * @member {google.protobuf.ITimestamp|null|undefined} toggleTime + * @memberof google.storage.v2.Bucket.Autoclass + * @instance + */ + Autoclass.prototype.toggleTime = null; + + /** + * Autoclass terminalStorageClass. + * @member {string|null|undefined} terminalStorageClass + * @memberof google.storage.v2.Bucket.Autoclass + * @instance + */ + Autoclass.prototype.terminalStorageClass = null; + + /** + * Autoclass terminalStorageClassUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} terminalStorageClassUpdateTime + * @memberof google.storage.v2.Bucket.Autoclass + * @instance + */ + Autoclass.prototype.terminalStorageClassUpdateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Autoclass.prototype, "_terminalStorageClass", { + get: $util.oneOfGetter($oneOfFields = ["terminalStorageClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Autoclass.prototype, "_terminalStorageClassUpdateTime", { + get: $util.oneOfGetter($oneOfFields = ["terminalStorageClassUpdateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Autoclass instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {google.storage.v2.Bucket.IAutoclass=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.Autoclass} Autoclass instance + */ + Autoclass.create = function create(properties) { + return new Autoclass(properties); + }; + + /** + * Encodes the specified Autoclass message. Does not implicitly {@link google.storage.v2.Bucket.Autoclass.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {google.storage.v2.Bucket.IAutoclass} message Autoclass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Autoclass.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.toggleTime != null && Object.hasOwnProperty.call(message, "toggleTime")) + $root.google.protobuf.Timestamp.encode(message.toggleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.terminalStorageClass != null && Object.hasOwnProperty.call(message, "terminalStorageClass")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.terminalStorageClass); + if (message.terminalStorageClassUpdateTime != null && Object.hasOwnProperty.call(message, "terminalStorageClassUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.terminalStorageClassUpdateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Autoclass message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.Autoclass.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {google.storage.v2.Bucket.IAutoclass} message Autoclass message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Autoclass.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Autoclass message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.Autoclass} Autoclass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Autoclass.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.Autoclass(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.toggleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.terminalStorageClass = reader.string(); + break; + } + case 4: { + message.terminalStorageClassUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Autoclass message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.Autoclass} Autoclass + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Autoclass.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Autoclass message. + * @function verify + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Autoclass.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.toggleTime != null && message.hasOwnProperty("toggleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.toggleTime); + if (error) + return "toggleTime." + error; + } + if (message.terminalStorageClass != null && message.hasOwnProperty("terminalStorageClass")) { + properties._terminalStorageClass = 1; + if (!$util.isString(message.terminalStorageClass)) + return "terminalStorageClass: string expected"; + } + if (message.terminalStorageClassUpdateTime != null && message.hasOwnProperty("terminalStorageClassUpdateTime")) { + properties._terminalStorageClassUpdateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.terminalStorageClassUpdateTime); + if (error) + return "terminalStorageClassUpdateTime." + error; + } + } + return null; + }; + + /** + * Creates an Autoclass message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.Autoclass} Autoclass + */ + Autoclass.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.Autoclass) + return object; + var message = new $root.google.storage.v2.Bucket.Autoclass(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.toggleTime != null) { + if (typeof object.toggleTime !== "object") + throw TypeError(".google.storage.v2.Bucket.Autoclass.toggleTime: object expected"); + message.toggleTime = $root.google.protobuf.Timestamp.fromObject(object.toggleTime); + } + if (object.terminalStorageClass != null) + message.terminalStorageClass = String(object.terminalStorageClass); + if (object.terminalStorageClassUpdateTime != null) { + if (typeof object.terminalStorageClassUpdateTime !== "object") + throw TypeError(".google.storage.v2.Bucket.Autoclass.terminalStorageClassUpdateTime: object expected"); + message.terminalStorageClassUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.terminalStorageClassUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from an Autoclass message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {google.storage.v2.Bucket.Autoclass} message Autoclass + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Autoclass.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.toggleTime = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.toggleTime != null && message.hasOwnProperty("toggleTime")) + object.toggleTime = $root.google.protobuf.Timestamp.toObject(message.toggleTime, options); + if (message.terminalStorageClass != null && message.hasOwnProperty("terminalStorageClass")) { + object.terminalStorageClass = message.terminalStorageClass; + if (options.oneofs) + object._terminalStorageClass = "terminalStorageClass"; + } + if (message.terminalStorageClassUpdateTime != null && message.hasOwnProperty("terminalStorageClassUpdateTime")) { + object.terminalStorageClassUpdateTime = $root.google.protobuf.Timestamp.toObject(message.terminalStorageClassUpdateTime, options); + if (options.oneofs) + object._terminalStorageClassUpdateTime = "terminalStorageClassUpdateTime"; + } + return object; + }; + + /** + * Converts this Autoclass to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.Autoclass + * @instance + * @returns {Object.} JSON object + */ + Autoclass.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Autoclass + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.Autoclass + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Autoclass.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.Autoclass"; + }; + + return Autoclass; + })(); + + Bucket.IpFilter = (function() { + + /** + * Properties of an IpFilter. + * @memberof google.storage.v2.Bucket + * @interface IIpFilter + * @property {string|null} [mode] IpFilter mode + * @property {google.storage.v2.Bucket.IpFilter.IPublicNetworkSource|null} [publicNetworkSource] IpFilter publicNetworkSource + * @property {Array.|null} [vpcNetworkSources] IpFilter vpcNetworkSources + * @property {boolean|null} [allowCrossOrgVpcs] IpFilter allowCrossOrgVpcs + * @property {boolean|null} [allowAllServiceAgentAccess] IpFilter allowAllServiceAgentAccess + */ + + /** + * Constructs a new IpFilter. + * @memberof google.storage.v2.Bucket + * @classdesc Represents an IpFilter. + * @implements IIpFilter + * @constructor + * @param {google.storage.v2.Bucket.IIpFilter=} [properties] Properties to set + */ + function IpFilter(properties) { + this.vpcNetworkSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IpFilter mode. + * @member {string|null|undefined} mode + * @memberof google.storage.v2.Bucket.IpFilter + * @instance + */ + IpFilter.prototype.mode = null; + + /** + * IpFilter publicNetworkSource. + * @member {google.storage.v2.Bucket.IpFilter.IPublicNetworkSource|null|undefined} publicNetworkSource + * @memberof google.storage.v2.Bucket.IpFilter + * @instance + */ + IpFilter.prototype.publicNetworkSource = null; + + /** + * IpFilter vpcNetworkSources. + * @member {Array.} vpcNetworkSources + * @memberof google.storage.v2.Bucket.IpFilter + * @instance + */ + IpFilter.prototype.vpcNetworkSources = $util.emptyArray; + + /** + * IpFilter allowCrossOrgVpcs. + * @member {boolean} allowCrossOrgVpcs + * @memberof google.storage.v2.Bucket.IpFilter + * @instance + */ + IpFilter.prototype.allowCrossOrgVpcs = false; + + /** + * IpFilter allowAllServiceAgentAccess. + * @member {boolean|null|undefined} allowAllServiceAgentAccess + * @memberof google.storage.v2.Bucket.IpFilter + * @instance + */ + IpFilter.prototype.allowAllServiceAgentAccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IpFilter.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IpFilter.prototype, "_publicNetworkSource", { + get: $util.oneOfGetter($oneOfFields = ["publicNetworkSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IpFilter.prototype, "_allowAllServiceAgentAccess", { + get: $util.oneOfGetter($oneOfFields = ["allowAllServiceAgentAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IpFilter instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {google.storage.v2.Bucket.IIpFilter=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.IpFilter} IpFilter instance + */ + IpFilter.create = function create(properties) { + return new IpFilter(properties); + }; + + /** + * Encodes the specified IpFilter message. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {google.storage.v2.Bucket.IIpFilter} message IpFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mode); + if (message.publicNetworkSource != null && Object.hasOwnProperty.call(message, "publicNetworkSource")) + $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.encode(message.publicNetworkSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.vpcNetworkSources != null && message.vpcNetworkSources.length) + for (var i = 0; i < message.vpcNetworkSources.length; ++i) + $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource.encode(message.vpcNetworkSources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowCrossOrgVpcs != null && Object.hasOwnProperty.call(message, "allowCrossOrgVpcs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowCrossOrgVpcs); + if (message.allowAllServiceAgentAccess != null && Object.hasOwnProperty.call(message, "allowAllServiceAgentAccess")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowAllServiceAgentAccess); + return writer; + }; + + /** + * Encodes the specified IpFilter message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {google.storage.v2.Bucket.IIpFilter} message IpFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IpFilter message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.IpFilter} IpFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.IpFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mode = reader.string(); + break; + } + case 2: { + message.publicNetworkSource = $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.vpcNetworkSources && message.vpcNetworkSources.length)) + message.vpcNetworkSources = []; + message.vpcNetworkSources.push($root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource.decode(reader, reader.uint32())); + break; + } + case 4: { + message.allowCrossOrgVpcs = reader.bool(); + break; + } + case 5: { + message.allowAllServiceAgentAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IpFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.IpFilter} IpFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IpFilter message. + * @function verify + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IpFilter.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; + if (!$util.isString(message.mode)) + return "mode: string expected"; + } + if (message.publicNetworkSource != null && message.hasOwnProperty("publicNetworkSource")) { + properties._publicNetworkSource = 1; + { + var error = $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.verify(message.publicNetworkSource); + if (error) + return "publicNetworkSource." + error; + } + } + if (message.vpcNetworkSources != null && message.hasOwnProperty("vpcNetworkSources")) { + if (!Array.isArray(message.vpcNetworkSources)) + return "vpcNetworkSources: array expected"; + for (var i = 0; i < message.vpcNetworkSources.length; ++i) { + var error = $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource.verify(message.vpcNetworkSources[i]); + if (error) + return "vpcNetworkSources." + error; + } + } + if (message.allowCrossOrgVpcs != null && message.hasOwnProperty("allowCrossOrgVpcs")) + if (typeof message.allowCrossOrgVpcs !== "boolean") + return "allowCrossOrgVpcs: boolean expected"; + if (message.allowAllServiceAgentAccess != null && message.hasOwnProperty("allowAllServiceAgentAccess")) { + properties._allowAllServiceAgentAccess = 1; + if (typeof message.allowAllServiceAgentAccess !== "boolean") + return "allowAllServiceAgentAccess: boolean expected"; + } + return null; + }; + + /** + * Creates an IpFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.IpFilter} IpFilter + */ + IpFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.IpFilter) + return object; + var message = new $root.google.storage.v2.Bucket.IpFilter(); + if (object.mode != null) + message.mode = String(object.mode); + if (object.publicNetworkSource != null) { + if (typeof object.publicNetworkSource !== "object") + throw TypeError(".google.storage.v2.Bucket.IpFilter.publicNetworkSource: object expected"); + message.publicNetworkSource = $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.fromObject(object.publicNetworkSource); + } + if (object.vpcNetworkSources) { + if (!Array.isArray(object.vpcNetworkSources)) + throw TypeError(".google.storage.v2.Bucket.IpFilter.vpcNetworkSources: array expected"); + message.vpcNetworkSources = []; + for (var i = 0; i < object.vpcNetworkSources.length; ++i) { + if (typeof object.vpcNetworkSources[i] !== "object") + throw TypeError(".google.storage.v2.Bucket.IpFilter.vpcNetworkSources: object expected"); + message.vpcNetworkSources[i] = $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource.fromObject(object.vpcNetworkSources[i]); + } + } + if (object.allowCrossOrgVpcs != null) + message.allowCrossOrgVpcs = Boolean(object.allowCrossOrgVpcs); + if (object.allowAllServiceAgentAccess != null) + message.allowAllServiceAgentAccess = Boolean(object.allowAllServiceAgentAccess); + return message; + }; + + /** + * Creates a plain object from an IpFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {google.storage.v2.Bucket.IpFilter} message IpFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IpFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vpcNetworkSources = []; + if (options.defaults) + object.allowCrossOrgVpcs = false; + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.publicNetworkSource != null && message.hasOwnProperty("publicNetworkSource")) { + object.publicNetworkSource = $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.toObject(message.publicNetworkSource, options); + if (options.oneofs) + object._publicNetworkSource = "publicNetworkSource"; + } + if (message.vpcNetworkSources && message.vpcNetworkSources.length) { + object.vpcNetworkSources = []; + for (var j = 0; j < message.vpcNetworkSources.length; ++j) + object.vpcNetworkSources[j] = $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource.toObject(message.vpcNetworkSources[j], options); + } + if (message.allowCrossOrgVpcs != null && message.hasOwnProperty("allowCrossOrgVpcs")) + object.allowCrossOrgVpcs = message.allowCrossOrgVpcs; + if (message.allowAllServiceAgentAccess != null && message.hasOwnProperty("allowAllServiceAgentAccess")) { + object.allowAllServiceAgentAccess = message.allowAllServiceAgentAccess; + if (options.oneofs) + object._allowAllServiceAgentAccess = "allowAllServiceAgentAccess"; + } + return object; + }; + + /** + * Converts this IpFilter to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.IpFilter + * @instance + * @returns {Object.} JSON object + */ + IpFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IpFilter + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.IpFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IpFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.IpFilter"; + }; + + IpFilter.PublicNetworkSource = (function() { + + /** + * Properties of a PublicNetworkSource. + * @memberof google.storage.v2.Bucket.IpFilter + * @interface IPublicNetworkSource + * @property {Array.|null} [allowedIpCidrRanges] PublicNetworkSource allowedIpCidrRanges + */ + + /** + * Constructs a new PublicNetworkSource. + * @memberof google.storage.v2.Bucket.IpFilter + * @classdesc Represents a PublicNetworkSource. + * @implements IPublicNetworkSource + * @constructor + * @param {google.storage.v2.Bucket.IpFilter.IPublicNetworkSource=} [properties] Properties to set + */ + function PublicNetworkSource(properties) { + this.allowedIpCidrRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicNetworkSource allowedIpCidrRanges. + * @member {Array.} allowedIpCidrRanges + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @instance + */ + PublicNetworkSource.prototype.allowedIpCidrRanges = $util.emptyArray; + + /** + * Creates a new PublicNetworkSource instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.IPublicNetworkSource=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.IpFilter.PublicNetworkSource} PublicNetworkSource instance + */ + PublicNetworkSource.create = function create(properties) { + return new PublicNetworkSource(properties); + }; + + /** + * Encodes the specified PublicNetworkSource message. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.PublicNetworkSource.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.IPublicNetworkSource} message PublicNetworkSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicNetworkSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedIpCidrRanges != null && message.allowedIpCidrRanges.length) + for (var i = 0; i < message.allowedIpCidrRanges.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedIpCidrRanges[i]); + return writer; + }; + + /** + * Encodes the specified PublicNetworkSource message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.PublicNetworkSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.IPublicNetworkSource} message PublicNetworkSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicNetworkSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicNetworkSource message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.IpFilter.PublicNetworkSource} PublicNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicNetworkSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedIpCidrRanges && message.allowedIpCidrRanges.length)) + message.allowedIpCidrRanges = []; + message.allowedIpCidrRanges.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicNetworkSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.IpFilter.PublicNetworkSource} PublicNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicNetworkSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicNetworkSource message. + * @function verify + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicNetworkSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedIpCidrRanges != null && message.hasOwnProperty("allowedIpCidrRanges")) { + if (!Array.isArray(message.allowedIpCidrRanges)) + return "allowedIpCidrRanges: array expected"; + for (var i = 0; i < message.allowedIpCidrRanges.length; ++i) + if (!$util.isString(message.allowedIpCidrRanges[i])) + return "allowedIpCidrRanges: string[] expected"; + } + return null; + }; + + /** + * Creates a PublicNetworkSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.IpFilter.PublicNetworkSource} PublicNetworkSource + */ + PublicNetworkSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource) + return object; + var message = new $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource(); + if (object.allowedIpCidrRanges) { + if (!Array.isArray(object.allowedIpCidrRanges)) + throw TypeError(".google.storage.v2.Bucket.IpFilter.PublicNetworkSource.allowedIpCidrRanges: array expected"); + message.allowedIpCidrRanges = []; + for (var i = 0; i < object.allowedIpCidrRanges.length; ++i) + message.allowedIpCidrRanges[i] = String(object.allowedIpCidrRanges[i]); + } + return message; + }; + + /** + * Creates a plain object from a PublicNetworkSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.PublicNetworkSource} message PublicNetworkSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicNetworkSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedIpCidrRanges = []; + if (message.allowedIpCidrRanges && message.allowedIpCidrRanges.length) { + object.allowedIpCidrRanges = []; + for (var j = 0; j < message.allowedIpCidrRanges.length; ++j) + object.allowedIpCidrRanges[j] = message.allowedIpCidrRanges[j]; + } + return object; + }; + + /** + * Converts this PublicNetworkSource to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @instance + * @returns {Object.} JSON object + */ + PublicNetworkSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublicNetworkSource + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.IpFilter.PublicNetworkSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublicNetworkSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.IpFilter.PublicNetworkSource"; + }; + + return PublicNetworkSource; + })(); + + IpFilter.VpcNetworkSource = (function() { + + /** + * Properties of a VpcNetworkSource. + * @memberof google.storage.v2.Bucket.IpFilter + * @interface IVpcNetworkSource + * @property {string|null} [network] VpcNetworkSource network + * @property {Array.|null} [allowedIpCidrRanges] VpcNetworkSource allowedIpCidrRanges + */ + + /** + * Constructs a new VpcNetworkSource. + * @memberof google.storage.v2.Bucket.IpFilter + * @classdesc Represents a VpcNetworkSource. + * @implements IVpcNetworkSource + * @constructor + * @param {google.storage.v2.Bucket.IpFilter.IVpcNetworkSource=} [properties] Properties to set + */ + function VpcNetworkSource(properties) { + this.allowedIpCidrRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpcNetworkSource network. + * @member {string|null|undefined} network + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @instance + */ + VpcNetworkSource.prototype.network = null; + + /** + * VpcNetworkSource allowedIpCidrRanges. + * @member {Array.} allowedIpCidrRanges + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @instance + */ + VpcNetworkSource.prototype.allowedIpCidrRanges = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(VpcNetworkSource.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpcNetworkSource instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.IVpcNetworkSource=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.IpFilter.VpcNetworkSource} VpcNetworkSource instance + */ + VpcNetworkSource.create = function create(properties) { + return new VpcNetworkSource(properties); + }; + + /** + * Encodes the specified VpcNetworkSource message. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.VpcNetworkSource.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.IVpcNetworkSource} message VpcNetworkSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcNetworkSource.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.allowedIpCidrRanges != null && message.allowedIpCidrRanges.length) + for (var i = 0; i < message.allowedIpCidrRanges.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedIpCidrRanges[i]); + return writer; + }; + + /** + * Encodes the specified VpcNetworkSource message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.IpFilter.VpcNetworkSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.IVpcNetworkSource} message VpcNetworkSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcNetworkSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcNetworkSource message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.IpFilter.VpcNetworkSource} VpcNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcNetworkSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + if (!(message.allowedIpCidrRanges && message.allowedIpCidrRanges.length)) + message.allowedIpCidrRanges = []; + message.allowedIpCidrRanges.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcNetworkSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.IpFilter.VpcNetworkSource} VpcNetworkSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcNetworkSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcNetworkSource message. + * @function verify + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcNetworkSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.allowedIpCidrRanges != null && message.hasOwnProperty("allowedIpCidrRanges")) { + if (!Array.isArray(message.allowedIpCidrRanges)) + return "allowedIpCidrRanges: array expected"; + for (var i = 0; i < message.allowedIpCidrRanges.length; ++i) + if (!$util.isString(message.allowedIpCidrRanges[i])) + return "allowedIpCidrRanges: string[] expected"; + } + return null; + }; + + /** + * Creates a VpcNetworkSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.IpFilter.VpcNetworkSource} VpcNetworkSource + */ + VpcNetworkSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource) + return object; + var message = new $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource(); + if (object.network != null) + message.network = String(object.network); + if (object.allowedIpCidrRanges) { + if (!Array.isArray(object.allowedIpCidrRanges)) + throw TypeError(".google.storage.v2.Bucket.IpFilter.VpcNetworkSource.allowedIpCidrRanges: array expected"); + message.allowedIpCidrRanges = []; + for (var i = 0; i < object.allowedIpCidrRanges.length; ++i) + message.allowedIpCidrRanges[i] = String(object.allowedIpCidrRanges[i]); + } + return message; + }; + + /** + * Creates a plain object from a VpcNetworkSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {google.storage.v2.Bucket.IpFilter.VpcNetworkSource} message VpcNetworkSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcNetworkSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedIpCidrRanges = []; + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.allowedIpCidrRanges && message.allowedIpCidrRanges.length) { + object.allowedIpCidrRanges = []; + for (var j = 0; j < message.allowedIpCidrRanges.length; ++j) + object.allowedIpCidrRanges[j] = message.allowedIpCidrRanges[j]; + } + return object; + }; + + /** + * Converts this VpcNetworkSource to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @instance + * @returns {Object.} JSON object + */ + VpcNetworkSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcNetworkSource + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.IpFilter.VpcNetworkSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcNetworkSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.IpFilter.VpcNetworkSource"; + }; + + return VpcNetworkSource; + })(); + + return IpFilter; + })(); + + Bucket.HierarchicalNamespace = (function() { + + /** + * Properties of a HierarchicalNamespace. + * @memberof google.storage.v2.Bucket + * @interface IHierarchicalNamespace + * @property {boolean|null} [enabled] HierarchicalNamespace enabled + */ + + /** + * Constructs a new HierarchicalNamespace. + * @memberof google.storage.v2.Bucket + * @classdesc Represents a HierarchicalNamespace. + * @implements IHierarchicalNamespace + * @constructor + * @param {google.storage.v2.Bucket.IHierarchicalNamespace=} [properties] Properties to set + */ + function HierarchicalNamespace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HierarchicalNamespace enabled. + * @member {boolean} enabled + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @instance + */ + HierarchicalNamespace.prototype.enabled = false; + + /** + * Creates a new HierarchicalNamespace instance using the specified properties. + * @function create + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {google.storage.v2.Bucket.IHierarchicalNamespace=} [properties] Properties to set + * @returns {google.storage.v2.Bucket.HierarchicalNamespace} HierarchicalNamespace instance + */ + HierarchicalNamespace.create = function create(properties) { + return new HierarchicalNamespace(properties); + }; + + /** + * Encodes the specified HierarchicalNamespace message. Does not implicitly {@link google.storage.v2.Bucket.HierarchicalNamespace.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {google.storage.v2.Bucket.IHierarchicalNamespace} message HierarchicalNamespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HierarchicalNamespace.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); + return writer; + }; + + /** + * Encodes the specified HierarchicalNamespace message, length delimited. Does not implicitly {@link google.storage.v2.Bucket.HierarchicalNamespace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {google.storage.v2.Bucket.IHierarchicalNamespace} message HierarchicalNamespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HierarchicalNamespace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Bucket.HierarchicalNamespace} HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HierarchicalNamespace.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Bucket.HierarchicalNamespace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HierarchicalNamespace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Bucket.HierarchicalNamespace} HierarchicalNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HierarchicalNamespace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HierarchicalNamespace message. + * @function verify + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HierarchicalNamespace.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"; + return null; + }; + + /** + * Creates a HierarchicalNamespace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Bucket.HierarchicalNamespace} HierarchicalNamespace + */ + HierarchicalNamespace.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Bucket.HierarchicalNamespace) + return object; + var message = new $root.google.storage.v2.Bucket.HierarchicalNamespace(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a HierarchicalNamespace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {google.storage.v2.Bucket.HierarchicalNamespace} message HierarchicalNamespace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HierarchicalNamespace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this HierarchicalNamespace to JSON. + * @function toJSON + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @instance + * @returns {Object.} JSON object + */ + HierarchicalNamespace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HierarchicalNamespace + * @function getTypeUrl + * @memberof google.storage.v2.Bucket.HierarchicalNamespace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HierarchicalNamespace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Bucket.HierarchicalNamespace"; + }; + + return HierarchicalNamespace; + })(); + + return Bucket; + })(); + + v2.BucketAccessControl = (function() { + + /** + * Properties of a BucketAccessControl. + * @memberof google.storage.v2 + * @interface IBucketAccessControl + * @property {string|null} [role] BucketAccessControl role + * @property {string|null} [id] BucketAccessControl id + * @property {string|null} [entity] BucketAccessControl entity + * @property {string|null} [entityAlt] BucketAccessControl entityAlt + * @property {string|null} [entityId] BucketAccessControl entityId + * @property {string|null} [etag] BucketAccessControl etag + * @property {string|null} [email] BucketAccessControl email + * @property {string|null} [domain] BucketAccessControl domain + * @property {google.storage.v2.IProjectTeam|null} [projectTeam] BucketAccessControl projectTeam + */ + + /** + * Constructs a new BucketAccessControl. + * @memberof google.storage.v2 + * @classdesc Represents a BucketAccessControl. + * @implements IBucketAccessControl + * @constructor + * @param {google.storage.v2.IBucketAccessControl=} [properties] Properties to set + */ + function BucketAccessControl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BucketAccessControl role. + * @member {string} role + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.role = ""; + + /** + * BucketAccessControl id. + * @member {string} id + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.id = ""; + + /** + * BucketAccessControl entity. + * @member {string} entity + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.entity = ""; + + /** + * BucketAccessControl entityAlt. + * @member {string} entityAlt + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.entityAlt = ""; + + /** + * BucketAccessControl entityId. + * @member {string} entityId + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.entityId = ""; + + /** + * BucketAccessControl etag. + * @member {string} etag + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.etag = ""; + + /** + * BucketAccessControl email. + * @member {string} email + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.email = ""; + + /** + * BucketAccessControl domain. + * @member {string} domain + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.domain = ""; + + /** + * BucketAccessControl projectTeam. + * @member {google.storage.v2.IProjectTeam|null|undefined} projectTeam + * @memberof google.storage.v2.BucketAccessControl + * @instance + */ + BucketAccessControl.prototype.projectTeam = null; + + /** + * Creates a new BucketAccessControl instance using the specified properties. + * @function create + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {google.storage.v2.IBucketAccessControl=} [properties] Properties to set + * @returns {google.storage.v2.BucketAccessControl} BucketAccessControl instance + */ + BucketAccessControl.create = function create(properties) { + return new BucketAccessControl(properties); + }; + + /** + * Encodes the specified BucketAccessControl message. Does not implicitly {@link google.storage.v2.BucketAccessControl.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {google.storage.v2.IBucketAccessControl} message BucketAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketAccessControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entity); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.entityId); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.email); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.domain); + if (message.projectTeam != null && Object.hasOwnProperty.call(message, "projectTeam")) + $root.google.storage.v2.ProjectTeam.encode(message.projectTeam, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + if (message.entityAlt != null && Object.hasOwnProperty.call(message, "entityAlt")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.entityAlt); + return writer; + }; + + /** + * Encodes the specified BucketAccessControl message, length delimited. Does not implicitly {@link google.storage.v2.BucketAccessControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {google.storage.v2.IBucketAccessControl} message BucketAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BucketAccessControl message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.BucketAccessControl} BucketAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketAccessControl.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.BucketAccessControl(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.entity = reader.string(); + break; + } + case 9: { + message.entityAlt = reader.string(); + break; + } + case 4: { + message.entityId = reader.string(); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + case 5: { + message.email = reader.string(); + break; + } + case 6: { + message.domain = reader.string(); + break; + } + case 7: { + message.projectTeam = $root.google.storage.v2.ProjectTeam.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BucketAccessControl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.BucketAccessControl} BucketAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketAccessControl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BucketAccessControl message. + * @function verify + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BucketAccessControl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) + if (!$util.isString(message.entityAlt)) + return "entityAlt: string expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.projectTeam != null && message.hasOwnProperty("projectTeam")) { + var error = $root.google.storage.v2.ProjectTeam.verify(message.projectTeam); + if (error) + return "projectTeam." + error; + } + return null; + }; + + /** + * Creates a BucketAccessControl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.BucketAccessControl} BucketAccessControl + */ + BucketAccessControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.BucketAccessControl) + return object; + var message = new $root.google.storage.v2.BucketAccessControl(); + if (object.role != null) + message.role = String(object.role); + if (object.id != null) + message.id = String(object.id); + if (object.entity != null) + message.entity = String(object.entity); + if (object.entityAlt != null) + message.entityAlt = String(object.entityAlt); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.email != null) + message.email = String(object.email); + if (object.domain != null) + message.domain = String(object.domain); + if (object.projectTeam != null) { + if (typeof object.projectTeam !== "object") + throw TypeError(".google.storage.v2.BucketAccessControl.projectTeam: object expected"); + message.projectTeam = $root.google.storage.v2.ProjectTeam.fromObject(object.projectTeam); + } + return message; + }; + + /** + * Creates a plain object from a BucketAccessControl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {google.storage.v2.BucketAccessControl} message BucketAccessControl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BucketAccessControl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.role = ""; + object.id = ""; + object.entity = ""; + object.entityId = ""; + object.email = ""; + object.domain = ""; + object.projectTeam = null; + object.etag = ""; + object.entityAlt = ""; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.projectTeam != null && message.hasOwnProperty("projectTeam")) + object.projectTeam = $root.google.storage.v2.ProjectTeam.toObject(message.projectTeam, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) + object.entityAlt = message.entityAlt; + return object; + }; + + /** + * Converts this BucketAccessControl to JSON. + * @function toJSON + * @memberof google.storage.v2.BucketAccessControl + * @instance + * @returns {Object.} JSON object + */ + BucketAccessControl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BucketAccessControl + * @function getTypeUrl + * @memberof google.storage.v2.BucketAccessControl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BucketAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.BucketAccessControl"; + }; + + return BucketAccessControl; + })(); + + v2.ChecksummedData = (function() { + + /** + * Properties of a ChecksummedData. + * @memberof google.storage.v2 + * @interface IChecksummedData + * @property {Uint8Array|null} [content] ChecksummedData content + * @property {number|null} [crc32c] ChecksummedData crc32c + */ + + /** + * Constructs a new ChecksummedData. + * @memberof google.storage.v2 + * @classdesc Represents a ChecksummedData. + * @implements IChecksummedData + * @constructor + * @param {google.storage.v2.IChecksummedData=} [properties] Properties to set + */ + function ChecksummedData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChecksummedData content. + * @member {Uint8Array} content + * @memberof google.storage.v2.ChecksummedData + * @instance + */ + ChecksummedData.prototype.content = $util.newBuffer([]); + + /** + * ChecksummedData crc32c. + * @member {number|null|undefined} crc32c + * @memberof google.storage.v2.ChecksummedData + * @instance + */ + ChecksummedData.prototype.crc32c = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChecksummedData.prototype, "_crc32c", { + get: $util.oneOfGetter($oneOfFields = ["crc32c"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChecksummedData instance using the specified properties. + * @function create + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {google.storage.v2.IChecksummedData=} [properties] Properties to set + * @returns {google.storage.v2.ChecksummedData} ChecksummedData instance + */ + ChecksummedData.create = function create(properties) { + return new ChecksummedData(properties); + }; + + /** + * Encodes the specified ChecksummedData message. Does not implicitly {@link google.storage.v2.ChecksummedData.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {google.storage.v2.IChecksummedData} message ChecksummedData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChecksummedData.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).bytes(message.content); + if (message.crc32c != null && Object.hasOwnProperty.call(message, "crc32c")) + writer.uint32(/* id 2, wireType 5 =*/21).fixed32(message.crc32c); + return writer; + }; + + /** + * Encodes the specified ChecksummedData message, length delimited. Does not implicitly {@link google.storage.v2.ChecksummedData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {google.storage.v2.IChecksummedData} message ChecksummedData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChecksummedData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChecksummedData message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ChecksummedData} ChecksummedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChecksummedData.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ChecksummedData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.content = reader.bytes(); + break; + } + case 2: { + message.crc32c = reader.fixed32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChecksummedData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ChecksummedData} ChecksummedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChecksummedData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChecksummedData message. + * @function verify + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChecksummedData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { + properties._crc32c = 1; + if (!$util.isInteger(message.crc32c)) + return "crc32c: integer expected"; + } + return null; + }; + + /** + * Creates a ChecksummedData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ChecksummedData} ChecksummedData + */ + ChecksummedData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ChecksummedData) + return object; + var message = new $root.google.storage.v2.ChecksummedData(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length >= 0) + message.content = object.content; + if (object.crc32c != null) + message.crc32c = object.crc32c >>> 0; + return message; + }; + + /** + * Creates a plain object from a ChecksummedData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {google.storage.v2.ChecksummedData} message ChecksummedData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChecksummedData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { + object.crc32c = message.crc32c; + if (options.oneofs) + object._crc32c = "crc32c"; + } + return object; + }; + + /** + * Converts this ChecksummedData to JSON. + * @function toJSON + * @memberof google.storage.v2.ChecksummedData + * @instance + * @returns {Object.} JSON object + */ + ChecksummedData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChecksummedData + * @function getTypeUrl + * @memberof google.storage.v2.ChecksummedData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChecksummedData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ChecksummedData"; + }; + + return ChecksummedData; + })(); + + v2.ObjectChecksums = (function() { + + /** + * Properties of an ObjectChecksums. + * @memberof google.storage.v2 + * @interface IObjectChecksums + * @property {number|null} [crc32c] ObjectChecksums crc32c + * @property {Uint8Array|null} [md5Hash] ObjectChecksums md5Hash + */ + + /** + * Constructs a new ObjectChecksums. + * @memberof google.storage.v2 + * @classdesc Represents an ObjectChecksums. + * @implements IObjectChecksums + * @constructor + * @param {google.storage.v2.IObjectChecksums=} [properties] Properties to set + */ + function ObjectChecksums(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectChecksums crc32c. + * @member {number|null|undefined} crc32c + * @memberof google.storage.v2.ObjectChecksums + * @instance + */ + ObjectChecksums.prototype.crc32c = null; + + /** + * ObjectChecksums md5Hash. + * @member {Uint8Array} md5Hash + * @memberof google.storage.v2.ObjectChecksums + * @instance + */ + ObjectChecksums.prototype.md5Hash = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObjectChecksums.prototype, "_crc32c", { + get: $util.oneOfGetter($oneOfFields = ["crc32c"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObjectChecksums instance using the specified properties. + * @function create + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {google.storage.v2.IObjectChecksums=} [properties] Properties to set + * @returns {google.storage.v2.ObjectChecksums} ObjectChecksums instance + */ + ObjectChecksums.create = function create(properties) { + return new ObjectChecksums(properties); + }; + + /** + * Encodes the specified ObjectChecksums message. Does not implicitly {@link google.storage.v2.ObjectChecksums.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {google.storage.v2.IObjectChecksums} message ObjectChecksums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectChecksums.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.crc32c != null && Object.hasOwnProperty.call(message, "crc32c")) + writer.uint32(/* id 1, wireType 5 =*/13).fixed32(message.crc32c); + if (message.md5Hash != null && Object.hasOwnProperty.call(message, "md5Hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.md5Hash); + return writer; + }; + + /** + * Encodes the specified ObjectChecksums message, length delimited. Does not implicitly {@link google.storage.v2.ObjectChecksums.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {google.storage.v2.IObjectChecksums} message ObjectChecksums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectChecksums.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectChecksums message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ObjectChecksums} ObjectChecksums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectChecksums.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ObjectChecksums(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.crc32c = reader.fixed32(); + break; + } + case 2: { + message.md5Hash = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectChecksums message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ObjectChecksums} ObjectChecksums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectChecksums.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectChecksums message. + * @function verify + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectChecksums.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { + properties._crc32c = 1; + if (!$util.isInteger(message.crc32c)) + return "crc32c: integer expected"; + } + if (message.md5Hash != null && message.hasOwnProperty("md5Hash")) + if (!(message.md5Hash && typeof message.md5Hash.length === "number" || $util.isString(message.md5Hash))) + return "md5Hash: buffer expected"; + return null; + }; + + /** + * Creates an ObjectChecksums message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ObjectChecksums} ObjectChecksums + */ + ObjectChecksums.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ObjectChecksums) + return object; + var message = new $root.google.storage.v2.ObjectChecksums(); + if (object.crc32c != null) + message.crc32c = object.crc32c >>> 0; + if (object.md5Hash != null) + if (typeof object.md5Hash === "string") + $util.base64.decode(object.md5Hash, message.md5Hash = $util.newBuffer($util.base64.length(object.md5Hash)), 0); + else if (object.md5Hash.length >= 0) + message.md5Hash = object.md5Hash; + return message; + }; + + /** + * Creates a plain object from an ObjectChecksums message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {google.storage.v2.ObjectChecksums} message ObjectChecksums + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectChecksums.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.md5Hash = ""; + else { + object.md5Hash = []; + if (options.bytes !== Array) + object.md5Hash = $util.newBuffer(object.md5Hash); + } + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { + object.crc32c = message.crc32c; + if (options.oneofs) + object._crc32c = "crc32c"; + } + if (message.md5Hash != null && message.hasOwnProperty("md5Hash")) + object.md5Hash = options.bytes === String ? $util.base64.encode(message.md5Hash, 0, message.md5Hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.md5Hash) : message.md5Hash; + return object; + }; + + /** + * Converts this ObjectChecksums to JSON. + * @function toJSON + * @memberof google.storage.v2.ObjectChecksums + * @instance + * @returns {Object.} JSON object + */ + ObjectChecksums.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectChecksums + * @function getTypeUrl + * @memberof google.storage.v2.ObjectChecksums + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectChecksums.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ObjectChecksums"; + }; + + return ObjectChecksums; + })(); + + v2.ObjectCustomContextPayload = (function() { + + /** + * Properties of an ObjectCustomContextPayload. + * @memberof google.storage.v2 + * @interface IObjectCustomContextPayload + * @property {string|null} [value] ObjectCustomContextPayload value + * @property {google.protobuf.ITimestamp|null} [createTime] ObjectCustomContextPayload createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ObjectCustomContextPayload updateTime + */ + + /** + * Constructs a new ObjectCustomContextPayload. + * @memberof google.storage.v2 + * @classdesc Represents an ObjectCustomContextPayload. + * @implements IObjectCustomContextPayload + * @constructor + * @param {google.storage.v2.IObjectCustomContextPayload=} [properties] Properties to set + */ + function ObjectCustomContextPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectCustomContextPayload value. + * @member {string} value + * @memberof google.storage.v2.ObjectCustomContextPayload + * @instance + */ + ObjectCustomContextPayload.prototype.value = ""; + + /** + * ObjectCustomContextPayload createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.v2.ObjectCustomContextPayload + * @instance + */ + ObjectCustomContextPayload.prototype.createTime = null; + + /** + * ObjectCustomContextPayload updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.v2.ObjectCustomContextPayload + * @instance + */ + ObjectCustomContextPayload.prototype.updateTime = null; + + /** + * Creates a new ObjectCustomContextPayload instance using the specified properties. + * @function create + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {google.storage.v2.IObjectCustomContextPayload=} [properties] Properties to set + * @returns {google.storage.v2.ObjectCustomContextPayload} ObjectCustomContextPayload instance + */ + ObjectCustomContextPayload.create = function create(properties) { + return new ObjectCustomContextPayload(properties); + }; + + /** + * Encodes the specified ObjectCustomContextPayload message. Does not implicitly {@link google.storage.v2.ObjectCustomContextPayload.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {google.storage.v2.IObjectCustomContextPayload} message ObjectCustomContextPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectCustomContextPayload.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.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(); + return writer; + }; + + /** + * Encodes the specified ObjectCustomContextPayload message, length delimited. Does not implicitly {@link google.storage.v2.ObjectCustomContextPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {google.storage.v2.IObjectCustomContextPayload} message ObjectCustomContextPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectCustomContextPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectCustomContextPayload message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ObjectCustomContextPayload} ObjectCustomContextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectCustomContextPayload.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ObjectCustomContextPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectCustomContextPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ObjectCustomContextPayload} ObjectCustomContextPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectCustomContextPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectCustomContextPayload message. + * @function verify + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectCustomContextPayload.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.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 ObjectCustomContextPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ObjectCustomContextPayload} ObjectCustomContextPayload + */ + ObjectCustomContextPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ObjectCustomContextPayload) + return object; + var message = new $root.google.storage.v2.ObjectCustomContextPayload(); + if (object.value != null) + message.value = String(object.value); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.v2.ObjectCustomContextPayload.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.v2.ObjectCustomContextPayload.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an ObjectCustomContextPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {google.storage.v2.ObjectCustomContextPayload} message ObjectCustomContextPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectCustomContextPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + 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 ObjectCustomContextPayload to JSON. + * @function toJSON + * @memberof google.storage.v2.ObjectCustomContextPayload + * @instance + * @returns {Object.} JSON object + */ + ObjectCustomContextPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectCustomContextPayload + * @function getTypeUrl + * @memberof google.storage.v2.ObjectCustomContextPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectCustomContextPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ObjectCustomContextPayload"; + }; + + return ObjectCustomContextPayload; + })(); + + v2.ObjectContexts = (function() { + + /** + * Properties of an ObjectContexts. + * @memberof google.storage.v2 + * @interface IObjectContexts + * @property {Object.|null} [custom] ObjectContexts custom + */ + + /** + * Constructs a new ObjectContexts. + * @memberof google.storage.v2 + * @classdesc Represents an ObjectContexts. + * @implements IObjectContexts + * @constructor + * @param {google.storage.v2.IObjectContexts=} [properties] Properties to set + */ + function ObjectContexts(properties) { + this.custom = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectContexts custom. + * @member {Object.} custom + * @memberof google.storage.v2.ObjectContexts + * @instance + */ + ObjectContexts.prototype.custom = $util.emptyObject; + + /** + * Creates a new ObjectContexts instance using the specified properties. + * @function create + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {google.storage.v2.IObjectContexts=} [properties] Properties to set + * @returns {google.storage.v2.ObjectContexts} ObjectContexts instance + */ + ObjectContexts.create = function create(properties) { + return new ObjectContexts(properties); + }; + + /** + * Encodes the specified ObjectContexts message. Does not implicitly {@link google.storage.v2.ObjectContexts.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {google.storage.v2.IObjectContexts} message ObjectContexts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectContexts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + for (var keys = Object.keys(message.custom), 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.storage.v2.ObjectCustomContextPayload.encode(message.custom[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ObjectContexts message, length delimited. Does not implicitly {@link google.storage.v2.ObjectContexts.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {google.storage.v2.IObjectContexts} message ObjectContexts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectContexts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectContexts message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ObjectContexts} ObjectContexts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectContexts.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ObjectContexts(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.custom === $util.emptyObject) + message.custom = {}; + 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.storage.v2.ObjectCustomContextPayload.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.custom[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectContexts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ObjectContexts} ObjectContexts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectContexts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectContexts message. + * @function verify + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectContexts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.custom != null && message.hasOwnProperty("custom")) { + if (!$util.isObject(message.custom)) + return "custom: object expected"; + var key = Object.keys(message.custom); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.storage.v2.ObjectCustomContextPayload.verify(message.custom[key[i]]); + if (error) + return "custom." + error; + } + } + return null; + }; + + /** + * Creates an ObjectContexts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ObjectContexts} ObjectContexts + */ + ObjectContexts.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ObjectContexts) + return object; + var message = new $root.google.storage.v2.ObjectContexts(); + if (object.custom) { + if (typeof object.custom !== "object") + throw TypeError(".google.storage.v2.ObjectContexts.custom: object expected"); + message.custom = {}; + for (var keys = Object.keys(object.custom), i = 0; i < keys.length; ++i) { + if (typeof object.custom[keys[i]] !== "object") + throw TypeError(".google.storage.v2.ObjectContexts.custom: object expected"); + message.custom[keys[i]] = $root.google.storage.v2.ObjectCustomContextPayload.fromObject(object.custom[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an ObjectContexts message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {google.storage.v2.ObjectContexts} message ObjectContexts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectContexts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.custom = {}; + var keys2; + if (message.custom && (keys2 = Object.keys(message.custom)).length) { + object.custom = {}; + for (var j = 0; j < keys2.length; ++j) + object.custom[keys2[j]] = $root.google.storage.v2.ObjectCustomContextPayload.toObject(message.custom[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ObjectContexts to JSON. + * @function toJSON + * @memberof google.storage.v2.ObjectContexts + * @instance + * @returns {Object.} JSON object + */ + ObjectContexts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectContexts + * @function getTypeUrl + * @memberof google.storage.v2.ObjectContexts + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectContexts.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ObjectContexts"; + }; + + return ObjectContexts; + })(); + + v2.CustomerEncryption = (function() { + + /** + * Properties of a CustomerEncryption. + * @memberof google.storage.v2 + * @interface ICustomerEncryption + * @property {string|null} [encryptionAlgorithm] CustomerEncryption encryptionAlgorithm + * @property {Uint8Array|null} [keySha256Bytes] CustomerEncryption keySha256Bytes + */ + + /** + * Constructs a new CustomerEncryption. + * @memberof google.storage.v2 + * @classdesc Represents a CustomerEncryption. + * @implements ICustomerEncryption + * @constructor + * @param {google.storage.v2.ICustomerEncryption=} [properties] Properties to set + */ + function CustomerEncryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEncryption encryptionAlgorithm. + * @member {string} encryptionAlgorithm + * @memberof google.storage.v2.CustomerEncryption + * @instance + */ + CustomerEncryption.prototype.encryptionAlgorithm = ""; + + /** + * CustomerEncryption keySha256Bytes. + * @member {Uint8Array} keySha256Bytes + * @memberof google.storage.v2.CustomerEncryption + * @instance + */ + CustomerEncryption.prototype.keySha256Bytes = $util.newBuffer([]); + + /** + * Creates a new CustomerEncryption instance using the specified properties. + * @function create + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {google.storage.v2.ICustomerEncryption=} [properties] Properties to set + * @returns {google.storage.v2.CustomerEncryption} CustomerEncryption instance + */ + CustomerEncryption.create = function create(properties) { + return new CustomerEncryption(properties); + }; + + /** + * Encodes the specified CustomerEncryption message. Does not implicitly {@link google.storage.v2.CustomerEncryption.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {google.storage.v2.ICustomerEncryption} message CustomerEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionAlgorithm != null && Object.hasOwnProperty.call(message, "encryptionAlgorithm")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encryptionAlgorithm); + if (message.keySha256Bytes != null && Object.hasOwnProperty.call(message, "keySha256Bytes")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.keySha256Bytes); + return writer; + }; + + /** + * Encodes the specified CustomerEncryption message, length delimited. Does not implicitly {@link google.storage.v2.CustomerEncryption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {google.storage.v2.ICustomerEncryption} message CustomerEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryption message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.CustomerEncryption} CustomerEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.CustomerEncryption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionAlgorithm = reader.string(); + break; + } + case 3: { + message.keySha256Bytes = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.CustomerEncryption} CustomerEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryption message. + * @function verify + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) + if (!$util.isString(message.encryptionAlgorithm)) + return "encryptionAlgorithm: string expected"; + if (message.keySha256Bytes != null && message.hasOwnProperty("keySha256Bytes")) + if (!(message.keySha256Bytes && typeof message.keySha256Bytes.length === "number" || $util.isString(message.keySha256Bytes))) + return "keySha256Bytes: buffer expected"; + return null; + }; + + /** + * Creates a CustomerEncryption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.CustomerEncryption} CustomerEncryption + */ + CustomerEncryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.CustomerEncryption) + return object; + var message = new $root.google.storage.v2.CustomerEncryption(); + if (object.encryptionAlgorithm != null) + message.encryptionAlgorithm = String(object.encryptionAlgorithm); + if (object.keySha256Bytes != null) + if (typeof object.keySha256Bytes === "string") + $util.base64.decode(object.keySha256Bytes, message.keySha256Bytes = $util.newBuffer($util.base64.length(object.keySha256Bytes)), 0); + else if (object.keySha256Bytes.length >= 0) + message.keySha256Bytes = object.keySha256Bytes; + return message; + }; + + /** + * Creates a plain object from a CustomerEncryption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {google.storage.v2.CustomerEncryption} message CustomerEncryption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encryptionAlgorithm = ""; + if (options.bytes === String) + object.keySha256Bytes = ""; + else { + object.keySha256Bytes = []; + if (options.bytes !== Array) + object.keySha256Bytes = $util.newBuffer(object.keySha256Bytes); + } + } + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) + object.encryptionAlgorithm = message.encryptionAlgorithm; + if (message.keySha256Bytes != null && message.hasOwnProperty("keySha256Bytes")) + object.keySha256Bytes = options.bytes === String ? $util.base64.encode(message.keySha256Bytes, 0, message.keySha256Bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.keySha256Bytes) : message.keySha256Bytes; + return object; + }; + + /** + * Converts this CustomerEncryption to JSON. + * @function toJSON + * @memberof google.storage.v2.CustomerEncryption + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerEncryption + * @function getTypeUrl + * @memberof google.storage.v2.CustomerEncryption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerEncryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.CustomerEncryption"; + }; + + return CustomerEncryption; + })(); + + v2.Object = (function() { + + /** + * Properties of an Object. + * @memberof google.storage.v2 + * @interface IObject + * @property {string|null} [name] Object name + * @property {string|null} [bucket] Object bucket + * @property {string|null} [etag] Object etag + * @property {number|Long|null} [generation] Object generation + * @property {string|null} [restoreToken] Object restoreToken + * @property {number|Long|null} [metageneration] Object metageneration + * @property {string|null} [storageClass] Object storageClass + * @property {number|Long|null} [size] Object size + * @property {string|null} [contentEncoding] Object contentEncoding + * @property {string|null} [contentDisposition] Object contentDisposition + * @property {string|null} [cacheControl] Object cacheControl + * @property {Array.|null} [acl] Object acl + * @property {string|null} [contentLanguage] Object contentLanguage + * @property {google.protobuf.ITimestamp|null} [deleteTime] Object deleteTime + * @property {google.protobuf.ITimestamp|null} [finalizeTime] Object finalizeTime + * @property {string|null} [contentType] Object contentType + * @property {google.protobuf.ITimestamp|null} [createTime] Object createTime + * @property {number|null} [componentCount] Object componentCount + * @property {google.storage.v2.IObjectChecksums|null} [checksums] Object checksums + * @property {google.protobuf.ITimestamp|null} [updateTime] Object updateTime + * @property {string|null} [kmsKey] Object kmsKey + * @property {google.protobuf.ITimestamp|null} [updateStorageClassTime] Object updateStorageClassTime + * @property {boolean|null} [temporaryHold] Object temporaryHold + * @property {google.protobuf.ITimestamp|null} [retentionExpireTime] Object retentionExpireTime + * @property {Object.|null} [metadata] Object metadata + * @property {google.storage.v2.IObjectContexts|null} [contexts] Object contexts + * @property {boolean|null} [eventBasedHold] Object eventBasedHold + * @property {google.storage.v2.IOwner|null} [owner] Object owner + * @property {google.storage.v2.ICustomerEncryption|null} [customerEncryption] Object customerEncryption + * @property {google.protobuf.ITimestamp|null} [customTime] Object customTime + * @property {google.protobuf.ITimestamp|null} [softDeleteTime] Object softDeleteTime + * @property {google.protobuf.ITimestamp|null} [hardDeleteTime] Object hardDeleteTime + * @property {google.storage.v2.Object.IRetention|null} [retention] Object retention + */ + + /** + * Constructs a new Object. + * @memberof google.storage.v2 + * @classdesc Represents an Object. + * @implements IObject + * @constructor + * @param {google.storage.v2.IObject=} [properties] Properties to set + */ + function Object(properties) { + this.acl = []; + this.metadata = {}; + if (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 name. + * @member {string} name + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.name = ""; + + /** + * Object bucket. + * @member {string} bucket + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.bucket = ""; + + /** + * Object etag. + * @member {string} etag + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.etag = ""; + + /** + * Object generation. + * @member {number|Long} generation + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Object restoreToken. + * @member {string|null|undefined} restoreToken + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.restoreToken = null; + + /** + * Object metageneration. + * @member {number|Long} metageneration + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.metageneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Object storageClass. + * @member {string} storageClass + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.storageClass = ""; + + /** + * Object size. + * @member {number|Long} size + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Object contentEncoding. + * @member {string} contentEncoding + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.contentEncoding = ""; + + /** + * Object contentDisposition. + * @member {string} contentDisposition + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.contentDisposition = ""; + + /** + * Object cacheControl. + * @member {string} cacheControl + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.cacheControl = ""; + + /** + * Object acl. + * @member {Array.} acl + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.acl = $util.emptyArray; + + /** + * Object contentLanguage. + * @member {string} contentLanguage + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.contentLanguage = ""; + + /** + * Object deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.deleteTime = null; + + /** + * Object finalizeTime. + * @member {google.protobuf.ITimestamp|null|undefined} finalizeTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.finalizeTime = null; + + /** + * Object contentType. + * @member {string} contentType + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.contentType = ""; + + /** + * Object createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.createTime = null; + + /** + * Object componentCount. + * @member {number} componentCount + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.componentCount = 0; + + /** + * Object checksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} checksums + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.checksums = null; + + /** + * Object updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.updateTime = null; + + /** + * Object kmsKey. + * @member {string} kmsKey + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.kmsKey = ""; + + /** + * Object updateStorageClassTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateStorageClassTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.updateStorageClassTime = null; + + /** + * Object temporaryHold. + * @member {boolean} temporaryHold + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.temporaryHold = false; + + /** + * Object retentionExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} retentionExpireTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.retentionExpireTime = null; + + /** + * Object metadata. + * @member {Object.} metadata + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.metadata = $util.emptyObject; + + /** + * Object contexts. + * @member {google.storage.v2.IObjectContexts|null|undefined} contexts + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.contexts = null; + + /** + * Object eventBasedHold. + * @member {boolean|null|undefined} eventBasedHold + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.eventBasedHold = null; + + /** + * Object owner. + * @member {google.storage.v2.IOwner|null|undefined} owner + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.owner = null; + + /** + * Object customerEncryption. + * @member {google.storage.v2.ICustomerEncryption|null|undefined} customerEncryption + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.customerEncryption = null; + + /** + * Object customTime. + * @member {google.protobuf.ITimestamp|null|undefined} customTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.customTime = null; + + /** + * Object softDeleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} softDeleteTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.softDeleteTime = null; + + /** + * Object hardDeleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} hardDeleteTime + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.hardDeleteTime = null; + + /** + * Object retention. + * @member {google.storage.v2.Object.IRetention|null|undefined} retention + * @memberof google.storage.v2.Object + * @instance + */ + Object.prototype.retention = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Object.prototype, "_restoreToken", { + get: $util.oneOfGetter($oneOfFields = ["restoreToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Object.prototype, "_eventBasedHold", { + get: $util.oneOfGetter($oneOfFields = ["eventBasedHold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Object.prototype, "_softDeleteTime", { + get: $util.oneOfGetter($oneOfFields = ["softDeleteTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Object.prototype, "_hardDeleteTime", { + get: $util.oneOfGetter($oneOfFields = ["hardDeleteTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Object instance using the specified properties. + * @function create + * @memberof google.storage.v2.Object + * @static + * @param {google.storage.v2.IObject=} [properties] Properties to set + * @returns {google.storage.v2.Object} Object instance + */ + Object.create = function create(properties) { + return new Object(properties); + }; + + /** + * Encodes the specified Object message. Does not implicitly {@link google.storage.v2.Object.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Object + * @static + * @param {google.storage.v2.IObject} message Object message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Object.encode = function encode(message, writer) { + 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.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucket); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.metageneration); + if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.storageClass); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.size); + if (message.contentEncoding != null && Object.hasOwnProperty.call(message, "contentEncoding")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.contentEncoding); + if (message.contentDisposition != null && Object.hasOwnProperty.call(message, "contentDisposition")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.contentDisposition); + if (message.cacheControl != null && Object.hasOwnProperty.call(message, "cacheControl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.cacheControl); + if (message.acl != null && message.acl.length) + for (var i = 0; i < message.acl.length; ++i) + $root.google.storage.v2.ObjectAccessControl.encode(message.acl[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.contentLanguage != null && Object.hasOwnProperty.call(message, "contentLanguage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.contentLanguage); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.contentType); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.componentCount != null && Object.hasOwnProperty.call(message, "componentCount")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.componentCount); + if (message.checksums != null && Object.hasOwnProperty.call(message, "checksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.checksums, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.kmsKey); + if (message.updateStorageClassTime != null && Object.hasOwnProperty.call(message, "updateStorageClassTime")) + $root.google.protobuf.Timestamp.encode(message.updateStorageClassTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.temporaryHold != null && Object.hasOwnProperty.call(message, "temporaryHold")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.temporaryHold); + if (message.retentionExpireTime != null && Object.hasOwnProperty.call(message, "retentionExpireTime")) + $root.google.protobuf.Timestamp.encode(message.retentionExpireTime, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + 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 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.eventBasedHold != null && Object.hasOwnProperty.call(message, "eventBasedHold")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.eventBasedHold); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.google.storage.v2.Owner.encode(message.owner, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.customerEncryption != null && Object.hasOwnProperty.call(message, "customerEncryption")) + $root.google.storage.v2.CustomerEncryption.encode(message.customerEncryption, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.customTime != null && Object.hasOwnProperty.call(message, "customTime")) + $root.google.protobuf.Timestamp.encode(message.customTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.etag); + if (message.softDeleteTime != null && Object.hasOwnProperty.call(message, "softDeleteTime")) + $root.google.protobuf.Timestamp.encode(message.softDeleteTime, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.hardDeleteTime != null && Object.hasOwnProperty.call(message, "hardDeleteTime")) + $root.google.protobuf.Timestamp.encode(message.hardDeleteTime, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + $root.google.storage.v2.Object.Retention.encode(message.retention, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.restoreToken != null && Object.hasOwnProperty.call(message, "restoreToken")) + writer.uint32(/* id 35, wireType 2 =*/282).string(message.restoreToken); + if (message.finalizeTime != null && Object.hasOwnProperty.call(message, "finalizeTime")) + $root.google.protobuf.Timestamp.encode(message.finalizeTime, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.contexts != null && Object.hasOwnProperty.call(message, "contexts")) + $root.google.storage.v2.ObjectContexts.encode(message.contexts, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.storage.v2.Object.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Object + * @static + * @param {google.storage.v2.IObject} message Object message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Object.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Object message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Object + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Object} Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Object.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Object(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.bucket = reader.string(); + break; + } + case 27: { + message.etag = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 35: { + message.restoreToken = reader.string(); + break; + } + case 4: { + message.metageneration = reader.int64(); + break; + } + case 5: { + message.storageClass = reader.string(); + break; + } + case 6: { + message.size = reader.int64(); + break; + } + case 7: { + message.contentEncoding = reader.string(); + break; + } + case 8: { + message.contentDisposition = reader.string(); + break; + } + case 9: { + message.cacheControl = reader.string(); + break; + } + case 10: { + if (!(message.acl && message.acl.length)) + message.acl = []; + message.acl.push($root.google.storage.v2.ObjectAccessControl.decode(reader, reader.uint32())); + break; + } + case 11: { + message.contentLanguage = reader.string(); + break; + } + case 12: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 36: { + message.finalizeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.contentType = reader.string(); + break; + } + case 14: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.componentCount = reader.int32(); + break; + } + case 16: { + message.checksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } + case 17: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + message.kmsKey = reader.string(); + break; + } + case 19: { + message.updateStorageClassTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.temporaryHold = reader.bool(); + break; + } + case 21: { + message.retentionExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 22: { + 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 38: { + message.contexts = $root.google.storage.v2.ObjectContexts.decode(reader, reader.uint32()); + break; + } + case 23: { + message.eventBasedHold = reader.bool(); + break; + } + case 24: { + message.owner = $root.google.storage.v2.Owner.decode(reader, reader.uint32()); + break; + } + case 25: { + message.customerEncryption = $root.google.storage.v2.CustomerEncryption.decode(reader, reader.uint32()); + break; + } + case 26: { + message.customTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 28: { + message.softDeleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 29: { + message.hardDeleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 30: { + message.retention = $root.google.storage.v2.Object.Retention.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Object message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Object + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Object} Object + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Object.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Object message. + * @function verify + * @memberof google.storage.v2.Object + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Object.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.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) { + properties._restoreToken = 1; + if (!$util.isString(message.restoreToken)) + return "restoreToken: string expected"; + } + if (message.metageneration != null && message.hasOwnProperty("metageneration")) + if (!$util.isInteger(message.metageneration) && !(message.metageneration && $util.isInteger(message.metageneration.low) && $util.isInteger(message.metageneration.high))) + return "metageneration: integer|Long expected"; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + if (!$util.isString(message.storageClass)) + return "storageClass: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.contentEncoding != null && message.hasOwnProperty("contentEncoding")) + if (!$util.isString(message.contentEncoding)) + return "contentEncoding: string expected"; + if (message.contentDisposition != null && message.hasOwnProperty("contentDisposition")) + if (!$util.isString(message.contentDisposition)) + return "contentDisposition: string expected"; + if (message.cacheControl != null && message.hasOwnProperty("cacheControl")) + if (!$util.isString(message.cacheControl)) + return "cacheControl: string expected"; + if (message.acl != null && message.hasOwnProperty("acl")) { + if (!Array.isArray(message.acl)) + return "acl: array expected"; + for (var i = 0; i < message.acl.length; ++i) { + var error = $root.google.storage.v2.ObjectAccessControl.verify(message.acl[i]); + if (error) + return "acl." + error; + } + } + if (message.contentLanguage != null && message.hasOwnProperty("contentLanguage")) + if (!$util.isString(message.contentLanguage)) + return "contentLanguage: string expected"; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finalizeTime); + if (error) + return "finalizeTime." + error; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: 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.componentCount != null && message.hasOwnProperty("componentCount")) + if (!$util.isInteger(message.componentCount)) + return "componentCount: integer expected"; + if (message.checksums != null && message.hasOwnProperty("checksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.checksums); + if (error) + return "checksums." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.updateStorageClassTime != null && message.hasOwnProperty("updateStorageClassTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateStorageClassTime); + if (error) + return "updateStorageClassTime." + error; + } + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) + if (typeof message.temporaryHold !== "boolean") + return "temporaryHold: boolean expected"; + if (message.retentionExpireTime != null && message.hasOwnProperty("retentionExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.retentionExpireTime); + if (error) + return "retentionExpireTime." + error; + } + 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.contexts != null && message.hasOwnProperty("contexts")) { + var error = $root.google.storage.v2.ObjectContexts.verify(message.contexts); + if (error) + return "contexts." + error; + } + if (message.eventBasedHold != null && message.hasOwnProperty("eventBasedHold")) { + properties._eventBasedHold = 1; + if (typeof message.eventBasedHold !== "boolean") + return "eventBasedHold: boolean expected"; + } + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.google.storage.v2.Owner.verify(message.owner); + if (error) + return "owner." + error; + } + if (message.customerEncryption != null && message.hasOwnProperty("customerEncryption")) { + var error = $root.google.storage.v2.CustomerEncryption.verify(message.customerEncryption); + if (error) + return "customerEncryption." + error; + } + if (message.customTime != null && message.hasOwnProperty("customTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.customTime); + if (error) + return "customTime." + error; + } + if (message.softDeleteTime != null && message.hasOwnProperty("softDeleteTime")) { + properties._softDeleteTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.softDeleteTime); + if (error) + return "softDeleteTime." + error; + } + } + if (message.hardDeleteTime != null && message.hasOwnProperty("hardDeleteTime")) { + properties._hardDeleteTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.hardDeleteTime); + if (error) + return "hardDeleteTime." + error; + } + } + if (message.retention != null && message.hasOwnProperty("retention")) { + var error = $root.google.storage.v2.Object.Retention.verify(message.retention); + if (error) + return "retention." + error; + } + return null; + }; + + /** + * Creates an Object message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Object + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Object} Object + */ + Object.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Object) + return object; + var message = new $root.google.storage.v2.Object(); + if (object.name != null) + message.name = String(object.name); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.etag != null) + message.etag = String(object.etag); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.restoreToken != null) + message.restoreToken = String(object.restoreToken); + if (object.metageneration != null) + if ($util.Long) + (message.metageneration = $util.Long.fromValue(object.metageneration)).unsigned = false; + else if (typeof object.metageneration === "string") + message.metageneration = parseInt(object.metageneration, 10); + else if (typeof object.metageneration === "number") + message.metageneration = object.metageneration; + else if (typeof object.metageneration === "object") + message.metageneration = new $util.LongBits(object.metageneration.low >>> 0, object.metageneration.high >>> 0).toNumber(); + if (object.storageClass != null) + message.storageClass = String(object.storageClass); + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.contentEncoding != null) + message.contentEncoding = String(object.contentEncoding); + if (object.contentDisposition != null) + message.contentDisposition = String(object.contentDisposition); + if (object.cacheControl != null) + message.cacheControl = String(object.cacheControl); + if (object.acl) { + if (!Array.isArray(object.acl)) + throw TypeError(".google.storage.v2.Object.acl: array expected"); + message.acl = []; + for (var i = 0; i < object.acl.length; ++i) { + if (typeof object.acl[i] !== "object") + throw TypeError(".google.storage.v2.Object.acl: object expected"); + message.acl[i] = $root.google.storage.v2.ObjectAccessControl.fromObject(object.acl[i]); + } + } + if (object.contentLanguage != null) + message.contentLanguage = String(object.contentLanguage); + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.storage.v2.Object.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.finalizeTime != null) { + if (typeof object.finalizeTime !== "object") + throw TypeError(".google.storage.v2.Object.finalizeTime: object expected"); + message.finalizeTime = $root.google.protobuf.Timestamp.fromObject(object.finalizeTime); + } + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.storage.v2.Object.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.componentCount != null) + message.componentCount = object.componentCount | 0; + if (object.checksums != null) { + if (typeof object.checksums !== "object") + throw TypeError(".google.storage.v2.Object.checksums: object expected"); + message.checksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.checksums); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.storage.v2.Object.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.updateStorageClassTime != null) { + if (typeof object.updateStorageClassTime !== "object") + throw TypeError(".google.storage.v2.Object.updateStorageClassTime: object expected"); + message.updateStorageClassTime = $root.google.protobuf.Timestamp.fromObject(object.updateStorageClassTime); + } + if (object.temporaryHold != null) + message.temporaryHold = Boolean(object.temporaryHold); + if (object.retentionExpireTime != null) { + if (typeof object.retentionExpireTime !== "object") + throw TypeError(".google.storage.v2.Object.retentionExpireTime: object expected"); + message.retentionExpireTime = $root.google.protobuf.Timestamp.fromObject(object.retentionExpireTime); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.storage.v2.Object.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.contexts != null) { + if (typeof object.contexts !== "object") + throw TypeError(".google.storage.v2.Object.contexts: object expected"); + message.contexts = $root.google.storage.v2.ObjectContexts.fromObject(object.contexts); + } + if (object.eventBasedHold != null) + message.eventBasedHold = Boolean(object.eventBasedHold); + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".google.storage.v2.Object.owner: object expected"); + message.owner = $root.google.storage.v2.Owner.fromObject(object.owner); + } + if (object.customerEncryption != null) { + if (typeof object.customerEncryption !== "object") + throw TypeError(".google.storage.v2.Object.customerEncryption: object expected"); + message.customerEncryption = $root.google.storage.v2.CustomerEncryption.fromObject(object.customerEncryption); + } + if (object.customTime != null) { + if (typeof object.customTime !== "object") + throw TypeError(".google.storage.v2.Object.customTime: object expected"); + message.customTime = $root.google.protobuf.Timestamp.fromObject(object.customTime); + } + if (object.softDeleteTime != null) { + if (typeof object.softDeleteTime !== "object") + throw TypeError(".google.storage.v2.Object.softDeleteTime: object expected"); + message.softDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.softDeleteTime); + } + if (object.hardDeleteTime != null) { + if (typeof object.hardDeleteTime !== "object") + throw TypeError(".google.storage.v2.Object.hardDeleteTime: object expected"); + message.hardDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.hardDeleteTime); + } + if (object.retention != null) { + if (typeof object.retention !== "object") + throw TypeError(".google.storage.v2.Object.retention: object expected"); + message.retention = $root.google.storage.v2.Object.Retention.fromObject(object.retention); + } + return message; + }; + + /** + * Creates a plain object from an Object message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Object + * @static + * @param {google.storage.v2.Object} message Object + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Object.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.acl = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.bucket = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.metageneration = options.longs === String ? "0" : 0; + object.storageClass = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + object.contentEncoding = ""; + object.contentDisposition = ""; + object.cacheControl = ""; + object.contentLanguage = ""; + object.deleteTime = null; + object.contentType = ""; + object.createTime = null; + object.componentCount = 0; + object.checksums = null; + object.updateTime = null; + object.kmsKey = ""; + object.updateStorageClassTime = null; + object.temporaryHold = false; + object.retentionExpireTime = null; + object.owner = null; + object.customerEncryption = null; + object.customTime = null; + object.etag = ""; + object.retention = null; + object.finalizeTime = null; + object.contexts = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + if (message.metageneration != null && message.hasOwnProperty("metageneration")) + if (typeof message.metageneration === "number") + object.metageneration = options.longs === String ? String(message.metageneration) : message.metageneration; + else + object.metageneration = options.longs === String ? $util.Long.prototype.toString.call(message.metageneration) : options.longs === Number ? new $util.LongBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0).toNumber() : message.metageneration; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + object.storageClass = message.storageClass; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.contentEncoding != null && message.hasOwnProperty("contentEncoding")) + object.contentEncoding = message.contentEncoding; + if (message.contentDisposition != null && message.hasOwnProperty("contentDisposition")) + object.contentDisposition = message.contentDisposition; + if (message.cacheControl != null && message.hasOwnProperty("cacheControl")) + object.cacheControl = message.cacheControl; + if (message.acl && message.acl.length) { + object.acl = []; + for (var j = 0; j < message.acl.length; ++j) + object.acl[j] = $root.google.storage.v2.ObjectAccessControl.toObject(message.acl[j], options); + } + if (message.contentLanguage != null && message.hasOwnProperty("contentLanguage")) + object.contentLanguage = message.contentLanguage; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.componentCount != null && message.hasOwnProperty("componentCount")) + object.componentCount = message.componentCount; + if (message.checksums != null && message.hasOwnProperty("checksums")) + object.checksums = $root.google.storage.v2.ObjectChecksums.toObject(message.checksums, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.updateStorageClassTime != null && message.hasOwnProperty("updateStorageClassTime")) + object.updateStorageClassTime = $root.google.protobuf.Timestamp.toObject(message.updateStorageClassTime, options); + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) + object.temporaryHold = message.temporaryHold; + if (message.retentionExpireTime != null && message.hasOwnProperty("retentionExpireTime")) + object.retentionExpireTime = $root.google.protobuf.Timestamp.toObject(message.retentionExpireTime, options); + 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.eventBasedHold != null && message.hasOwnProperty("eventBasedHold")) { + object.eventBasedHold = message.eventBasedHold; + if (options.oneofs) + object._eventBasedHold = "eventBasedHold"; + } + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.google.storage.v2.Owner.toObject(message.owner, options); + if (message.customerEncryption != null && message.hasOwnProperty("customerEncryption")) + object.customerEncryption = $root.google.storage.v2.CustomerEncryption.toObject(message.customerEncryption, options); + if (message.customTime != null && message.hasOwnProperty("customTime")) + object.customTime = $root.google.protobuf.Timestamp.toObject(message.customTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.softDeleteTime != null && message.hasOwnProperty("softDeleteTime")) { + object.softDeleteTime = $root.google.protobuf.Timestamp.toObject(message.softDeleteTime, options); + if (options.oneofs) + object._softDeleteTime = "softDeleteTime"; + } + if (message.hardDeleteTime != null && message.hasOwnProperty("hardDeleteTime")) { + object.hardDeleteTime = $root.google.protobuf.Timestamp.toObject(message.hardDeleteTime, options); + if (options.oneofs) + object._hardDeleteTime = "hardDeleteTime"; + } + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = $root.google.storage.v2.Object.Retention.toObject(message.retention, options); + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) { + object.restoreToken = message.restoreToken; + if (options.oneofs) + object._restoreToken = "restoreToken"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) + object.finalizeTime = $root.google.protobuf.Timestamp.toObject(message.finalizeTime, options); + if (message.contexts != null && message.hasOwnProperty("contexts")) + object.contexts = $root.google.storage.v2.ObjectContexts.toObject(message.contexts, options); + return object; + }; + + /** + * Converts this Object to JSON. + * @function toJSON + * @memberof google.storage.v2.Object + * @instance + * @returns {Object.} JSON object + */ + Object.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Object + * @function getTypeUrl + * @memberof google.storage.v2.Object + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Object.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Object"; + }; + + Object.Retention = (function() { + + /** + * Properties of a Retention. + * @memberof google.storage.v2.Object + * @interface IRetention + * @property {google.storage.v2.Object.Retention.Mode|null} [mode] Retention mode + * @property {google.protobuf.ITimestamp|null} [retainUntilTime] Retention retainUntilTime + */ + + /** + * Constructs a new Retention. + * @memberof google.storage.v2.Object + * @classdesc Represents a Retention. + * @implements IRetention + * @constructor + * @param {google.storage.v2.Object.IRetention=} [properties] Properties to set + */ + function Retention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Retention mode. + * @member {google.storage.v2.Object.Retention.Mode} mode + * @memberof google.storage.v2.Object.Retention + * @instance + */ + Retention.prototype.mode = 0; + + /** + * Retention retainUntilTime. + * @member {google.protobuf.ITimestamp|null|undefined} retainUntilTime + * @memberof google.storage.v2.Object.Retention + * @instance + */ + Retention.prototype.retainUntilTime = null; + + /** + * Creates a new Retention instance using the specified properties. + * @function create + * @memberof google.storage.v2.Object.Retention + * @static + * @param {google.storage.v2.Object.IRetention=} [properties] Properties to set + * @returns {google.storage.v2.Object.Retention} Retention instance + */ + Retention.create = function create(properties) { + return new Retention(properties); + }; + + /** + * Encodes the specified Retention message. Does not implicitly {@link google.storage.v2.Object.Retention.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Object.Retention + * @static + * @param {google.storage.v2.Object.IRetention} message Retention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Retention.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.retainUntilTime != null && Object.hasOwnProperty.call(message, "retainUntilTime")) + $root.google.protobuf.Timestamp.encode(message.retainUntilTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Retention message, length delimited. Does not implicitly {@link google.storage.v2.Object.Retention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Object.Retention + * @static + * @param {google.storage.v2.Object.IRetention} message Retention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Retention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Retention message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Object.Retention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Object.Retention} Retention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Retention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Object.Retention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + case 2: { + message.retainUntilTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Retention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Object.Retention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Object.Retention} Retention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Retention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Retention message. + * @function verify + * @memberof google.storage.v2.Object.Retention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Retention.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; + } + if (message.retainUntilTime != null && message.hasOwnProperty("retainUntilTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.retainUntilTime); + if (error) + return "retainUntilTime." + error; + } + return null; + }; + + /** + * Creates a Retention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Object.Retention + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Object.Retention} Retention + */ + Retention.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Object.Retention) + return object; + var message = new $root.google.storage.v2.Object.Retention(); + 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 "UNLOCKED": + case 1: + message.mode = 1; + break; + case "LOCKED": + case 2: + message.mode = 2; + break; + } + if (object.retainUntilTime != null) { + if (typeof object.retainUntilTime !== "object") + throw TypeError(".google.storage.v2.Object.Retention.retainUntilTime: object expected"); + message.retainUntilTime = $root.google.protobuf.Timestamp.fromObject(object.retainUntilTime); + } + return message; + }; + + /** + * Creates a plain object from a Retention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Object.Retention + * @static + * @param {google.storage.v2.Object.Retention} message Retention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Retention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.retainUntilTime = null; + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.storage.v2.Object.Retention.Mode[message.mode] === undefined ? message.mode : $root.google.storage.v2.Object.Retention.Mode[message.mode] : message.mode; + if (message.retainUntilTime != null && message.hasOwnProperty("retainUntilTime")) + object.retainUntilTime = $root.google.protobuf.Timestamp.toObject(message.retainUntilTime, options); + return object; + }; + + /** + * Converts this Retention to JSON. + * @function toJSON + * @memberof google.storage.v2.Object.Retention + * @instance + * @returns {Object.} JSON object + */ + Retention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Retention + * @function getTypeUrl + * @memberof google.storage.v2.Object.Retention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Retention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Object.Retention"; + }; + + /** + * Mode enum. + * @name google.storage.v2.Object.Retention.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} UNLOCKED=1 UNLOCKED value + * @property {number} LOCKED=2 LOCKED value + */ + Retention.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNLOCKED"] = 1; + values[valuesById[2] = "LOCKED"] = 2; + return values; + })(); + + return Retention; + })(); + + return Object; + })(); + + v2.ObjectAccessControl = (function() { + + /** + * Properties of an ObjectAccessControl. + * @memberof google.storage.v2 + * @interface IObjectAccessControl + * @property {string|null} [role] ObjectAccessControl role + * @property {string|null} [id] ObjectAccessControl id + * @property {string|null} [entity] ObjectAccessControl entity + * @property {string|null} [entityAlt] ObjectAccessControl entityAlt + * @property {string|null} [entityId] ObjectAccessControl entityId + * @property {string|null} [etag] ObjectAccessControl etag + * @property {string|null} [email] ObjectAccessControl email + * @property {string|null} [domain] ObjectAccessControl domain + * @property {google.storage.v2.IProjectTeam|null} [projectTeam] ObjectAccessControl projectTeam + */ + + /** + * Constructs a new ObjectAccessControl. + * @memberof google.storage.v2 + * @classdesc Represents an ObjectAccessControl. + * @implements IObjectAccessControl + * @constructor + * @param {google.storage.v2.IObjectAccessControl=} [properties] Properties to set + */ + function ObjectAccessControl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectAccessControl role. + * @member {string} role + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.role = ""; + + /** + * ObjectAccessControl id. + * @member {string} id + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.id = ""; + + /** + * ObjectAccessControl entity. + * @member {string} entity + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.entity = ""; + + /** + * ObjectAccessControl entityAlt. + * @member {string} entityAlt + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.entityAlt = ""; + + /** + * ObjectAccessControl entityId. + * @member {string} entityId + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.entityId = ""; + + /** + * ObjectAccessControl etag. + * @member {string} etag + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.etag = ""; + + /** + * ObjectAccessControl email. + * @member {string} email + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.email = ""; + + /** + * ObjectAccessControl domain. + * @member {string} domain + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.domain = ""; + + /** + * ObjectAccessControl projectTeam. + * @member {google.storage.v2.IProjectTeam|null|undefined} projectTeam + * @memberof google.storage.v2.ObjectAccessControl + * @instance + */ + ObjectAccessControl.prototype.projectTeam = null; + + /** + * Creates a new ObjectAccessControl instance using the specified properties. + * @function create + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {google.storage.v2.IObjectAccessControl=} [properties] Properties to set + * @returns {google.storage.v2.ObjectAccessControl} ObjectAccessControl instance + */ + ObjectAccessControl.create = function create(properties) { + return new ObjectAccessControl(properties); + }; + + /** + * Encodes the specified ObjectAccessControl message. Does not implicitly {@link google.storage.v2.ObjectAccessControl.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {google.storage.v2.IObjectAccessControl} message ObjectAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectAccessControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entity); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.entityId); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.email); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.domain); + if (message.projectTeam != null && Object.hasOwnProperty.call(message, "projectTeam")) + $root.google.storage.v2.ProjectTeam.encode(message.projectTeam, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + if (message.entityAlt != null && Object.hasOwnProperty.call(message, "entityAlt")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.entityAlt); + return writer; + }; + + /** + * Encodes the specified ObjectAccessControl message, length delimited. Does not implicitly {@link google.storage.v2.ObjectAccessControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {google.storage.v2.IObjectAccessControl} message ObjectAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectAccessControl message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ObjectAccessControl} ObjectAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectAccessControl.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ObjectAccessControl(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.entity = reader.string(); + break; + } + case 9: { + message.entityAlt = reader.string(); + break; + } + case 4: { + message.entityId = reader.string(); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + case 5: { + message.email = reader.string(); + break; + } + case 6: { + message.domain = reader.string(); + break; + } + case 7: { + message.projectTeam = $root.google.storage.v2.ProjectTeam.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectAccessControl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ObjectAccessControl} ObjectAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectAccessControl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectAccessControl message. + * @function verify + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectAccessControl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) + if (!$util.isString(message.entityAlt)) + return "entityAlt: string expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.projectTeam != null && message.hasOwnProperty("projectTeam")) { + var error = $root.google.storage.v2.ProjectTeam.verify(message.projectTeam); + if (error) + return "projectTeam." + error; + } + return null; + }; + + /** + * Creates an ObjectAccessControl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ObjectAccessControl} ObjectAccessControl + */ + ObjectAccessControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ObjectAccessControl) + return object; + var message = new $root.google.storage.v2.ObjectAccessControl(); + if (object.role != null) + message.role = String(object.role); + if (object.id != null) + message.id = String(object.id); + if (object.entity != null) + message.entity = String(object.entity); + if (object.entityAlt != null) + message.entityAlt = String(object.entityAlt); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.email != null) + message.email = String(object.email); + if (object.domain != null) + message.domain = String(object.domain); + if (object.projectTeam != null) { + if (typeof object.projectTeam !== "object") + throw TypeError(".google.storage.v2.ObjectAccessControl.projectTeam: object expected"); + message.projectTeam = $root.google.storage.v2.ProjectTeam.fromObject(object.projectTeam); + } + return message; + }; + + /** + * Creates a plain object from an ObjectAccessControl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {google.storage.v2.ObjectAccessControl} message ObjectAccessControl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectAccessControl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.role = ""; + object.id = ""; + object.entity = ""; + object.entityId = ""; + object.email = ""; + object.domain = ""; + object.projectTeam = null; + object.etag = ""; + object.entityAlt = ""; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.projectTeam != null && message.hasOwnProperty("projectTeam")) + object.projectTeam = $root.google.storage.v2.ProjectTeam.toObject(message.projectTeam, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) + object.entityAlt = message.entityAlt; + return object; + }; + + /** + * Converts this ObjectAccessControl to JSON. + * @function toJSON + * @memberof google.storage.v2.ObjectAccessControl + * @instance + * @returns {Object.} JSON object + */ + ObjectAccessControl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectAccessControl + * @function getTypeUrl + * @memberof google.storage.v2.ObjectAccessControl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ObjectAccessControl"; + }; + + return ObjectAccessControl; + })(); + + v2.ListObjectsResponse = (function() { + + /** + * Properties of a ListObjectsResponse. + * @memberof google.storage.v2 + * @interface IListObjectsResponse + * @property {Array.|null} [objects] ListObjectsResponse objects + * @property {Array.|null} [prefixes] ListObjectsResponse prefixes + * @property {string|null} [nextPageToken] ListObjectsResponse nextPageToken + */ + + /** + * Constructs a new ListObjectsResponse. + * @memberof google.storage.v2 + * @classdesc Represents a ListObjectsResponse. + * @implements IListObjectsResponse + * @constructor + * @param {google.storage.v2.IListObjectsResponse=} [properties] Properties to set + */ + function ListObjectsResponse(properties) { + this.objects = []; + this.prefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListObjectsResponse objects. + * @member {Array.} objects + * @memberof google.storage.v2.ListObjectsResponse + * @instance + */ + ListObjectsResponse.prototype.objects = $util.emptyArray; + + /** + * ListObjectsResponse prefixes. + * @member {Array.} prefixes + * @memberof google.storage.v2.ListObjectsResponse + * @instance + */ + ListObjectsResponse.prototype.prefixes = $util.emptyArray; + + /** + * ListObjectsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storage.v2.ListObjectsResponse + * @instance + */ + ListObjectsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListObjectsResponse instance using the specified properties. + * @function create + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {google.storage.v2.IListObjectsResponse=} [properties] Properties to set + * @returns {google.storage.v2.ListObjectsResponse} ListObjectsResponse instance + */ + ListObjectsResponse.create = function create(properties) { + return new ListObjectsResponse(properties); + }; + + /** + * Encodes the specified ListObjectsResponse message. Does not implicitly {@link google.storage.v2.ListObjectsResponse.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {google.storage.v2.IListObjectsResponse} message ListObjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListObjectsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objects != null && message.objects.length) + for (var i = 0; i < message.objects.length; ++i) + $root.google.storage.v2.Object.encode(message.objects[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prefixes != null && message.prefixes.length) + for (var i = 0; i < message.prefixes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prefixes[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListObjectsResponse message, length delimited. Does not implicitly {@link google.storage.v2.ListObjectsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {google.storage.v2.IListObjectsResponse} message ListObjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListObjectsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListObjectsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ListObjectsResponse} ListObjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListObjectsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ListObjectsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.objects && message.objects.length)) + message.objects = []; + message.objects.push($root.google.storage.v2.Object.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.prefixes && message.prefixes.length)) + message.prefixes = []; + message.prefixes.push(reader.string()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListObjectsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ListObjectsResponse} ListObjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListObjectsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListObjectsResponse message. + * @function verify + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListObjectsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objects != null && message.hasOwnProperty("objects")) { + if (!Array.isArray(message.objects)) + return "objects: array expected"; + for (var i = 0; i < message.objects.length; ++i) { + var error = $root.google.storage.v2.Object.verify(message.objects[i]); + if (error) + return "objects." + error; + } + } + if (message.prefixes != null && message.hasOwnProperty("prefixes")) { + if (!Array.isArray(message.prefixes)) + return "prefixes: array expected"; + for (var i = 0; i < message.prefixes.length; ++i) + if (!$util.isString(message.prefixes[i])) + return "prefixes: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListObjectsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ListObjectsResponse} ListObjectsResponse + */ + ListObjectsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ListObjectsResponse) + return object; + var message = new $root.google.storage.v2.ListObjectsResponse(); + if (object.objects) { + if (!Array.isArray(object.objects)) + throw TypeError(".google.storage.v2.ListObjectsResponse.objects: array expected"); + message.objects = []; + for (var i = 0; i < object.objects.length; ++i) { + if (typeof object.objects[i] !== "object") + throw TypeError(".google.storage.v2.ListObjectsResponse.objects: object expected"); + message.objects[i] = $root.google.storage.v2.Object.fromObject(object.objects[i]); + } + } + if (object.prefixes) { + if (!Array.isArray(object.prefixes)) + throw TypeError(".google.storage.v2.ListObjectsResponse.prefixes: array expected"); + message.prefixes = []; + for (var i = 0; i < object.prefixes.length; ++i) + message.prefixes[i] = String(object.prefixes[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListObjectsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {google.storage.v2.ListObjectsResponse} message ListObjectsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListObjectsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.objects = []; + object.prefixes = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.objects && message.objects.length) { + object.objects = []; + for (var j = 0; j < message.objects.length; ++j) + object.objects[j] = $root.google.storage.v2.Object.toObject(message.objects[j], options); + } + if (message.prefixes && message.prefixes.length) { + object.prefixes = []; + for (var j = 0; j < message.prefixes.length; ++j) + object.prefixes[j] = message.prefixes[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListObjectsResponse to JSON. + * @function toJSON + * @memberof google.storage.v2.ListObjectsResponse + * @instance + * @returns {Object.} JSON object + */ + ListObjectsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListObjectsResponse + * @function getTypeUrl + * @memberof google.storage.v2.ListObjectsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListObjectsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ListObjectsResponse"; + }; + + return ListObjectsResponse; + })(); + + v2.ProjectTeam = (function() { + + /** + * Properties of a ProjectTeam. + * @memberof google.storage.v2 + * @interface IProjectTeam + * @property {string|null} [projectNumber] ProjectTeam projectNumber + * @property {string|null} [team] ProjectTeam team + */ + + /** + * Constructs a new ProjectTeam. + * @memberof google.storage.v2 + * @classdesc Represents a ProjectTeam. + * @implements IProjectTeam + * @constructor + * @param {google.storage.v2.IProjectTeam=} [properties] Properties to set + */ + function ProjectTeam(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProjectTeam projectNumber. + * @member {string} projectNumber + * @memberof google.storage.v2.ProjectTeam + * @instance + */ + ProjectTeam.prototype.projectNumber = ""; + + /** + * ProjectTeam team. + * @member {string} team + * @memberof google.storage.v2.ProjectTeam + * @instance + */ + ProjectTeam.prototype.team = ""; + + /** + * Creates a new ProjectTeam instance using the specified properties. + * @function create + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {google.storage.v2.IProjectTeam=} [properties] Properties to set + * @returns {google.storage.v2.ProjectTeam} ProjectTeam instance + */ + ProjectTeam.create = function create(properties) { + return new ProjectTeam(properties); + }; + + /** + * Encodes the specified ProjectTeam message. Does not implicitly {@link google.storage.v2.ProjectTeam.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {google.storage.v2.IProjectTeam} message ProjectTeam message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectTeam.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectNumber != null && Object.hasOwnProperty.call(message, "projectNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectNumber); + if (message.team != null && Object.hasOwnProperty.call(message, "team")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.team); + return writer; + }; + + /** + * Encodes the specified ProjectTeam message, length delimited. Does not implicitly {@link google.storage.v2.ProjectTeam.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {google.storage.v2.IProjectTeam} message ProjectTeam message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectTeam.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProjectTeam message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ProjectTeam} ProjectTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectTeam.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ProjectTeam(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectNumber = reader.string(); + break; + } + case 2: { + message.team = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProjectTeam message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ProjectTeam} ProjectTeam + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectTeam.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProjectTeam message. + * @function verify + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProjectTeam.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) + if (!$util.isString(message.projectNumber)) + return "projectNumber: string expected"; + if (message.team != null && message.hasOwnProperty("team")) + if (!$util.isString(message.team)) + return "team: string expected"; + return null; + }; + + /** + * Creates a ProjectTeam message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ProjectTeam} ProjectTeam + */ + ProjectTeam.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ProjectTeam) + return object; + var message = new $root.google.storage.v2.ProjectTeam(); + if (object.projectNumber != null) + message.projectNumber = String(object.projectNumber); + if (object.team != null) + message.team = String(object.team); + return message; + }; + + /** + * Creates a plain object from a ProjectTeam message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {google.storage.v2.ProjectTeam} message ProjectTeam + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProjectTeam.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectNumber = ""; + object.team = ""; + } + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) + object.projectNumber = message.projectNumber; + if (message.team != null && message.hasOwnProperty("team")) + object.team = message.team; + return object; + }; + + /** + * Converts this ProjectTeam to JSON. + * @function toJSON + * @memberof google.storage.v2.ProjectTeam + * @instance + * @returns {Object.} JSON object + */ + ProjectTeam.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProjectTeam + * @function getTypeUrl + * @memberof google.storage.v2.ProjectTeam + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProjectTeam.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ProjectTeam"; + }; + + return ProjectTeam; + })(); + + v2.Owner = (function() { + + /** + * Properties of an Owner. + * @memberof google.storage.v2 + * @interface IOwner + * @property {string|null} [entity] Owner entity + * @property {string|null} [entityId] Owner entityId + */ + + /** + * Constructs a new Owner. + * @memberof google.storage.v2 + * @classdesc Represents an Owner. + * @implements IOwner + * @constructor + * @param {google.storage.v2.IOwner=} [properties] Properties to set + */ + function Owner(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Owner entity. + * @member {string} entity + * @memberof google.storage.v2.Owner + * @instance + */ + Owner.prototype.entity = ""; + + /** + * Owner entityId. + * @member {string} entityId + * @memberof google.storage.v2.Owner + * @instance + */ + Owner.prototype.entityId = ""; + + /** + * Creates a new Owner instance using the specified properties. + * @function create + * @memberof google.storage.v2.Owner + * @static + * @param {google.storage.v2.IOwner=} [properties] Properties to set + * @returns {google.storage.v2.Owner} Owner instance + */ + Owner.create = function create(properties) { + return new Owner(properties); + }; + + /** + * Encodes the specified Owner message. Does not implicitly {@link google.storage.v2.Owner.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.Owner + * @static + * @param {google.storage.v2.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityId); + return writer; + }; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.storage.v2.Owner.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.Owner + * @static + * @param {google.storage.v2.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.Owner(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entity = reader.string(); + break; + } + case 2: { + message.entityId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Owner message. + * @function verify + * @memberof google.storage.v2.Owner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Owner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + return null; + }; + + /** + * Creates an Owner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.Owner + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.Owner} Owner + */ + Owner.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.Owner) + return object; + var message = new $root.google.storage.v2.Owner(); + if (object.entity != null) + message.entity = String(object.entity); + if (object.entityId != null) + message.entityId = String(object.entityId); + return message; + }; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.Owner + * @static + * @param {google.storage.v2.Owner} message Owner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Owner.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entity = ""; + object.entityId = ""; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + return object; + }; + + /** + * Converts this Owner to JSON. + * @function toJSON + * @memberof google.storage.v2.Owner + * @instance + * @returns {Object.} JSON object + */ + Owner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Owner + * @function getTypeUrl + * @memberof google.storage.v2.Owner + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Owner.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.Owner"; + }; + + return Owner; + })(); + + v2.ContentRange = (function() { + + /** + * Properties of a ContentRange. + * @memberof google.storage.v2 + * @interface IContentRange + * @property {number|Long|null} [start] ContentRange start + * @property {number|Long|null} [end] ContentRange end + * @property {number|Long|null} [completeLength] ContentRange completeLength + */ + + /** + * Constructs a new ContentRange. + * @memberof google.storage.v2 + * @classdesc Represents a ContentRange. + * @implements IContentRange + * @constructor + * @param {google.storage.v2.IContentRange=} [properties] Properties to set + */ + function ContentRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentRange start. + * @member {number|Long} start + * @memberof google.storage.v2.ContentRange + * @instance + */ + ContentRange.prototype.start = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ContentRange end. + * @member {number|Long} end + * @memberof google.storage.v2.ContentRange + * @instance + */ + ContentRange.prototype.end = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ContentRange completeLength. + * @member {number|Long} completeLength + * @memberof google.storage.v2.ContentRange + * @instance + */ + ContentRange.prototype.completeLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ContentRange instance using the specified properties. + * @function create + * @memberof google.storage.v2.ContentRange + * @static + * @param {google.storage.v2.IContentRange=} [properties] Properties to set + * @returns {google.storage.v2.ContentRange} ContentRange instance + */ + ContentRange.create = function create(properties) { + return new ContentRange(properties); + }; + + /** + * Encodes the specified ContentRange message. Does not implicitly {@link google.storage.v2.ContentRange.verify|verify} messages. + * @function encode + * @memberof google.storage.v2.ContentRange + * @static + * @param {google.storage.v2.IContentRange} message ContentRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentRange.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).int64(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.end); + if (message.completeLength != null && Object.hasOwnProperty.call(message, "completeLength")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.completeLength); + return writer; + }; + + /** + * Encodes the specified ContentRange message, length delimited. Does not implicitly {@link google.storage.v2.ContentRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storage.v2.ContentRange + * @static + * @param {google.storage.v2.IContentRange} message ContentRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentRange message from the specified reader or buffer. + * @function decode + * @memberof google.storage.v2.ContentRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storage.v2.ContentRange} ContentRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storage.v2.ContentRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int64(); + break; + } + case 2: { + message.end = reader.int64(); + break; + } + case 3: { + message.completeLength = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storage.v2.ContentRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storage.v2.ContentRange} ContentRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentRange message. + * @function verify + * @memberof google.storage.v2.ContentRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentRange.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) && !(message.start && $util.isInteger(message.start.low) && $util.isInteger(message.start.high))) + return "start: integer|Long expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end) && !(message.end && $util.isInteger(message.end.low) && $util.isInteger(message.end.high))) + return "end: integer|Long expected"; + if (message.completeLength != null && message.hasOwnProperty("completeLength")) + if (!$util.isInteger(message.completeLength) && !(message.completeLength && $util.isInteger(message.completeLength.low) && $util.isInteger(message.completeLength.high))) + return "completeLength: integer|Long expected"; + return null; + }; + + /** + * Creates a ContentRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storage.v2.ContentRange + * @static + * @param {Object.} object Plain object + * @returns {google.storage.v2.ContentRange} ContentRange + */ + ContentRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.storage.v2.ContentRange) + return object; + var message = new $root.google.storage.v2.ContentRange(); + if (object.start != null) + if ($util.Long) + (message.start = $util.Long.fromValue(object.start)).unsigned = false; + else if (typeof object.start === "string") + message.start = parseInt(object.start, 10); + else if (typeof object.start === "number") + message.start = object.start; + else if (typeof object.start === "object") + message.start = new $util.LongBits(object.start.low >>> 0, object.start.high >>> 0).toNumber(); + if (object.end != null) + if ($util.Long) + (message.end = $util.Long.fromValue(object.end)).unsigned = false; + else if (typeof object.end === "string") + message.end = parseInt(object.end, 10); + else if (typeof object.end === "number") + message.end = object.end; + else if (typeof object.end === "object") + message.end = new $util.LongBits(object.end.low >>> 0, object.end.high >>> 0).toNumber(); + if (object.completeLength != null) + if ($util.Long) + (message.completeLength = $util.Long.fromValue(object.completeLength)).unsigned = false; + else if (typeof object.completeLength === "string") + message.completeLength = parseInt(object.completeLength, 10); + else if (typeof object.completeLength === "number") + message.completeLength = object.completeLength; + else if (typeof object.completeLength === "object") + message.completeLength = new $util.LongBits(object.completeLength.low >>> 0, object.completeLength.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ContentRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storage.v2.ContentRange + * @static + * @param {google.storage.v2.ContentRange} message ContentRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentRange.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.start = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.start = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.end = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.completeLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.completeLength = options.longs === String ? "0" : 0; + } + if (message.start != null && message.hasOwnProperty("start")) + if (typeof message.start === "number") + object.start = options.longs === String ? String(message.start) : message.start; + else + object.start = options.longs === String ? $util.Long.prototype.toString.call(message.start) : options.longs === Number ? new $util.LongBits(message.start.low >>> 0, message.start.high >>> 0).toNumber() : message.start; + if (message.end != null && message.hasOwnProperty("end")) + if (typeof message.end === "number") + object.end = options.longs === String ? String(message.end) : message.end; + else + object.end = options.longs === String ? $util.Long.prototype.toString.call(message.end) : options.longs === Number ? new $util.LongBits(message.end.low >>> 0, message.end.high >>> 0).toNumber() : message.end; + if (message.completeLength != null && message.hasOwnProperty("completeLength")) + if (typeof message.completeLength === "number") + object.completeLength = options.longs === String ? String(message.completeLength) : message.completeLength; + else + object.completeLength = options.longs === String ? $util.Long.prototype.toString.call(message.completeLength) : options.longs === Number ? new $util.LongBits(message.completeLength.low >>> 0, message.completeLength.high >>> 0).toNumber() : message.completeLength; + return object; + }; + + /** + * Converts this ContentRange to JSON. + * @function toJSON + * @memberof google.storage.v2.ContentRange + * @instance + * @returns {Object.} JSON object + */ + ContentRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentRange + * @function getTypeUrl + * @memberof google.storage.v2.ContentRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storage.v2.ContentRange"; + }; + + return ContentRange; + })(); + + return v2; + })(); + + return storage; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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.RoutingRule = (function() { + + /** + * Properties of a RoutingRule. + * @memberof google.api + * @interface IRoutingRule + * @property {Array.|null} [routingParameters] RoutingRule routingParameters + */ + + /** + * Constructs a new RoutingRule. + * @memberof google.api + * @classdesc Represents a RoutingRule. + * @implements IRoutingRule + * @constructor + * @param {google.api.IRoutingRule=} [properties] Properties to set + */ + function RoutingRule(properties) { + this.routingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingRule routingParameters. + * @member {Array.} routingParameters + * @memberof google.api.RoutingRule + * @instance + */ + RoutingRule.prototype.routingParameters = $util.emptyArray; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @function create + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule=} [properties] Properties to set + * @returns {google.api.RoutingRule} RoutingRule instance + */ + RoutingRule.create = function create(properties) { + return new RoutingRule(properties); + }; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingParameters != null && message.routingParameters.length) + for (var i = 0; i < message.routingParameters.length; ++i) + $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.routingParameters && message.routingParameters.length)) + message.routingParameters = []; + message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingRule message. + * @function verify + * @memberof google.api.RoutingRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + if (!Array.isArray(message.routingParameters)) + return "routingParameters: array expected"; + for (var i = 0; i < message.routingParameters.length; ++i) { + var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); + if (error) + return "routingParameters." + error; + } + } + return null; + }; + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingRule} RoutingRule + */ + RoutingRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingRule) + return object; + var message = new $root.google.api.RoutingRule(); + if (object.routingParameters) { + if (!Array.isArray(object.routingParameters)) + throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); + message.routingParameters = []; + for (var i = 0; i < object.routingParameters.length; ++i) { + if (typeof object.routingParameters[i] !== "object") + throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); + message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingRule + * @static + * @param {google.api.RoutingRule} message RoutingRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routingParameters = []; + if (message.routingParameters && message.routingParameters.length) { + object.routingParameters = []; + for (var j = 0; j < message.routingParameters.length; ++j) + object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); + } + return object; + }; + + /** + * Converts this RoutingRule to JSON. + * @function toJSON + * @memberof google.api.RoutingRule + * @instance + * @returns {Object.} JSON object + */ + RoutingRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingRule + * @function getTypeUrl + * @memberof google.api.RoutingRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingRule"; + }; + + return RoutingRule; + })(); + + api.RoutingParameter = (function() { + + /** + * Properties of a RoutingParameter. + * @memberof google.api + * @interface IRoutingParameter + * @property {string|null} [field] RoutingParameter field + * @property {string|null} [pathTemplate] RoutingParameter pathTemplate + */ + + /** + * Constructs a new RoutingParameter. + * @memberof google.api + * @classdesc Represents a RoutingParameter. + * @implements IRoutingParameter + * @constructor + * @param {google.api.IRoutingParameter=} [properties] Properties to set + */ + function RoutingParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingParameter field. + * @member {string} field + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.field = ""; + + /** + * RoutingParameter pathTemplate. + * @member {string} pathTemplate + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.pathTemplate = ""; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @function create + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter=} [properties] Properties to set + * @returns {google.api.RoutingParameter} RoutingParameter instance + */ + RoutingParameter.create = function create(properties) { + return new RoutingParameter(properties); + }; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingParameter message. + * @function verify + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingParameter} RoutingParameter + */ + RoutingParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingParameter) + return object; + var message = new $root.google.api.RoutingParameter(); + if (object.field != null) + message.field = String(object.field); + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.RoutingParameter} message RoutingParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.pathTemplate = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this RoutingParameter to JSON. + * @function toJSON + * @memberof google.api.RoutingParameter + * @instance + * @returns {Object.} JSON object + */ + RoutingParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingParameter + * @function getTypeUrl + * @memberof google.api.RoutingParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingParameter"; + }; + + return RoutingParameter; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + 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; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.api.routing. + * @member {google.api.IRoutingRule|null|undefined} .google.api.routing + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.routing"] = null; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) + $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 72295729: { + message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { + var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); + if (error) + return ".google.api.routing." + error; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.api.routing"] != null) { + if (typeof object[".google.api.routing"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); + message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + object[".google.api.routing"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) + object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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.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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, 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 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.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; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + 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 SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-storage-control/protos/protos.json b/owl-bot-staging/google-storage-control/protos/protos.json new file mode 100644 index 00000000000..94c3b8c1a28 --- /dev/null +++ b/owl-bot-staging/google-storage-control/protos/protos.json @@ -0,0 +1,8823 @@ +{ + "nested": { + "google": { + "nested": { + "storage": { + "nested": { + "control": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Storage.Control.V2", + "go_package": "cloud.google.com/go/storage/control/apiv2/controlpb;controlpb", + "java_multiple_files": true, + "java_outer_classname": "StorageControlProto", + "java_package": "com.google.storage.control.v2", + "php_namespace": "Google\\Cloud\\Storage\\Control\\V2", + "ruby_package": "Google::Cloud::Storage::Control::V2", + "(google.api.resource_definition).type": "storage.googleapis.com/Bucket", + "(google.api.resource_definition).pattern": "projects/{project}/buckets/{bucket}" + }, + "nested": { + "StorageControl": { + "options": { + "(google.api.default_host)": "storage.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_write" + }, + "methods": { + "CreateFolder": { + "requestType": "CreateFolderRequest", + "responseType": "Folder", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent,folder,folder_id" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent,folder,folder_id" + } + ] + }, + "DeleteFolder": { + "requestType": "DeleteFolderRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetFolder": { + "requestType": "GetFolderRequest", + "responseType": "Folder", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFolders": { + "requestType": "ListFoldersRequest", + "responseType": "ListFoldersResponse", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RenameFolder": { + "requestType": "RenameFolderRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name,destination_folder_id", + "(google.longrunning.operation_info).response_type": "Folder", + "(google.longrunning.operation_info).metadata_type": "RenameFolderMetadata" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name,destination_folder_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Folder", + "metadata_type": "RenameFolderMetadata" + } + } + ] + }, + "DeleteFolderRecursive": { + "requestType": "DeleteFolderRecursiveRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteFolderRecursiveMetadata" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteFolderRecursiveMetadata" + } + } + ] + }, + "GetStorageLayout": { + "requestType": "GetStorageLayoutRequest", + "responseType": "StorageLayout", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateManagedFolder": { + "requestType": "CreateManagedFolderRequest", + "responseType": "ManagedFolder", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent,managed_folder,managed_folder_id" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent,managed_folder,managed_folder_id" + } + ] + }, + "DeleteManagedFolder": { + "requestType": "DeleteManagedFolderRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetManagedFolder": { + "requestType": "GetManagedFolderRequest", + "responseType": "ManagedFolder", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListManagedFolders": { + "requestType": "ListManagedFoldersRequest", + "responseType": "ListManagedFoldersResponse", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateAnywhereCache": { + "requestType": "CreateAnywhereCacheRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent,anywhere_cache", + "(google.longrunning.operation_info).response_type": "AnywhereCache", + "(google.longrunning.operation_info).metadata_type": "CreateAnywhereCacheMetadata" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent,anywhere_cache" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnywhereCache", + "metadata_type": "CreateAnywhereCacheMetadata" + } + } + ] + }, + "UpdateAnywhereCache": { + "requestType": "UpdateAnywhereCacheRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.routing).routing_parameters.field": "anywhere_cache.name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "anywhere_cache,update_mask", + "(google.longrunning.operation_info).response_type": "AnywhereCache", + "(google.longrunning.operation_info).metadata_type": "UpdateAnywhereCacheMetadata" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "anywhere_cache.name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "anywhere_cache,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnywhereCache", + "metadata_type": "UpdateAnywhereCacheMetadata" + } + } + ] + }, + "DisableAnywhereCache": { + "requestType": "DisableAnywhereCacheRequest", + "responseType": "AnywhereCache", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "PauseAnywhereCache": { + "requestType": "PauseAnywhereCacheRequest", + "responseType": "AnywhereCache", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ResumeAnywhereCache": { + "requestType": "ResumeAnywhereCacheRequest", + "responseType": "AnywhereCache", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetAnywhereCache": { + "requestType": "GetAnywhereCacheRequest", + "responseType": "AnywhereCache", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAnywhereCaches": { + "requestType": "ListAnywhereCachesRequest", + "responseType": "ListAnywhereCachesResponse", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProjectIntelligenceConfig": { + "requestType": "GetProjectIntelligenceConfigRequest", + "responseType": "IntelligenceConfig", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/intelligenceConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/intelligenceConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateProjectIntelligenceConfig": { + "requestType": "UpdateProjectIntelligenceConfigRequest", + "responseType": "IntelligenceConfig", + "options": { + "(google.api.http).patch": "/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}", + "(google.api.http).body": "intelligence_config", + "(google.api.method_signature)": "intelligence_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}", + "body": "intelligence_config" + } + }, + { + "(google.api.method_signature)": "intelligence_config,update_mask" + } + ] + }, + "GetFolderIntelligenceConfig": { + "requestType": "GetFolderIntelligenceConfigRequest", + "responseType": "IntelligenceConfig", + "options": { + "(google.api.http).get": "/v2/{name=folders/*/locations/*/intelligenceConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=folders/*/locations/*/intelligenceConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateFolderIntelligenceConfig": { + "requestType": "UpdateFolderIntelligenceConfigRequest", + "responseType": "IntelligenceConfig", + "options": { + "(google.api.http).patch": "/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}", + "(google.api.http).body": "intelligence_config", + "(google.api.method_signature)": "intelligence_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}", + "body": "intelligence_config" + } + }, + { + "(google.api.method_signature)": "intelligence_config,update_mask" + } + ] + }, + "GetOrganizationIntelligenceConfig": { + "requestType": "GetOrganizationIntelligenceConfigRequest", + "responseType": "IntelligenceConfig", + "options": { + "(google.api.http).get": "/v2/{name=organizations/*/locations/*/intelligenceConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=organizations/*/locations/*/intelligenceConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateOrganizationIntelligenceConfig": { + "requestType": "UpdateOrganizationIntelligenceConfigRequest", + "responseType": "IntelligenceConfig", + "options": { + "(google.api.http).patch": "/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}", + "(google.api.http).body": "intelligence_config", + "(google.api.method_signature)": "intelligence_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}", + "body": "intelligence_config" + } + }, + { + "(google.api.method_signature)": "intelligence_config,update_mask" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.routing).routing_parameters.field": "resource", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "resource", + "path_template": "{bucket=**}" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.routing).routing_parameters.field": "resource", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "resource", + "path_template": "{bucket=**}" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.routing).routing_parameters.field": "resource", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/managedFolders/**", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "resource", + "path_template": "{bucket=**}" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/objects/**" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/managedFolders/**" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + } + } + }, + "PendingRenameInfo": { + "fields": { + "operation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Folder": { + "options": { + "(google.api.resource).type": "storage.googleapis.com/Folder", + "(google.api.resource).pattern": "projects/{project}/buckets/{bucket}/folders/{folder=**}", + "(google.api.resource).plural": "folders", + "(google.api.resource).singular": "folder" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "metageneration": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pendingRenameInfo": { + "type": "PendingRenameInfo", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetFolderRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Folder" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateFolderRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/Folder" + } + }, + "folder": { + "type": "Folder", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "folderId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "recursive": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteFolderRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Folder" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListFoldersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/Folder" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefix": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "delimiter": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lexicographicStart": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lexicographicEnd": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListFoldersResponse": { + "fields": { + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RenameFolderRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Folder" + } + }, + "destinationFolderId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteFolderRecursiveRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Folder" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CommonLongRunningOperationMetadata": { + "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" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progressPercent": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RenameFolderMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonLongRunningOperationMetadata", + "id": 1 + }, + "sourceFolderId": { + "type": "string", + "id": 2 + }, + "destinationFolderId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteFolderRecursiveMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonLongRunningOperationMetadata", + "id": 1 + }, + "folderId": { + "type": "string", + "id": 2 + } + } + }, + "StorageLayout": { + "options": { + "(google.api.resource).type": "storage.googleapis.com/StorageLayout", + "(google.api.resource).pattern": "projects/{project}/buckets/{bucket}/storageLayout", + "(google.api.resource).plural": "storageLayouts", + "(google.api.resource).singular": "storageLayout" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "locationType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customPlacementConfig": { + "type": "CustomPlacementConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hierarchicalNamespace": { + "type": "HierarchicalNamespace", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "CustomPlacementConfig": { + "fields": { + "dataLocations": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "HierarchicalNamespace": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + } + } + }, + "GetStorageLayoutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/StorageLayout" + } + }, + "prefix": { + "type": "string", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ManagedFolder": { + "options": { + "(google.api.resource).type": "storage.googleapis.com/ManagedFolder", + "(google.api.resource).pattern": "projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}", + "(google.api.resource).plural": "managedFolders", + "(google.api.resource).singular": "managedFolder" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "metageneration": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetManagedFolderRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/ManagedFolder" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateManagedFolderRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/ManagedFolder" + } + }, + "managedFolder": { + "type": "ManagedFolder", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "managedFolderId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteManagedFolderRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/ManagedFolder" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "allowNonEmpty": { + "type": "bool", + "id": 5 + }, + "requestId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListManagedFoldersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/ManagedFolder" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefix": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListManagedFoldersResponse": { + "fields": { + "managedFolders": { + "rule": "repeated", + "type": "ManagedFolder", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateAnywhereCacheMetadata": { + "oneofs": { + "_anywhereCacheId": { + "oneof": [ + "anywhereCacheId" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + }, + "_ttl": { + "oneof": [ + "ttl" + ] + }, + "_admissionPolicy": { + "oneof": [ + "admissionPolicy" + ] + } + }, + "fields": { + "commonMetadata": { + "type": "CommonLongRunningOperationMetadata", + "id": 1 + }, + "anywhereCacheId": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "admissionPolicy": { + "type": "string", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateAnywhereCacheMetadata": { + "oneofs": { + "_anywhereCacheId": { + "oneof": [ + "anywhereCacheId" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + }, + "_ttl": { + "oneof": [ + "ttl" + ] + }, + "_admissionPolicy": { + "oneof": [ + "admissionPolicy" + ] + } + }, + "fields": { + "commonMetadata": { + "type": "CommonLongRunningOperationMetadata", + "id": 1 + }, + "anywhereCacheId": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "admissionPolicy": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "AnywhereCache": { + "options": { + "(google.api.resource).type": "storage.googleapis.com/AnywhereCache", + "(google.api.resource).pattern": "projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}", + "(google.api.resource).plural": "anywhereCaches", + "(google.api.resource).singular": "anywhereCache" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "zone": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "admissionPolicy": { + "type": "string", + "id": 9 + }, + "state": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pendingUpdate": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateAnywhereCacheRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/AnywhereCache" + } + }, + "anywhereCache": { + "type": "AnywhereCache", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAnywhereCacheRequest": { + "fields": { + "anywhereCache": { + "type": "AnywhereCache", + "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_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisableAnywhereCacheRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/AnywhereCache" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PauseAnywhereCacheRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/AnywhereCache" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResumeAnywhereCacheRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/AnywhereCache" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetAnywhereCacheRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/AnywhereCache" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAnywhereCachesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/AnywhereCache" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAnywhereCachesResponse": { + "fields": { + "anywhereCaches": { + "rule": "repeated", + "type": "AnywhereCache", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "IntelligenceConfig": { + "options": { + "(google.api.resource).type": "storage.googleapis.com/IntelligenceConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/intelligenceConfig", + "(google.api.resource).plural": "intelligenceConfigs", + "(google.api.resource).singular": "intelligenceConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "editionConfig": { + "type": "EditionConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "filter": { + "type": "Filter", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "effectiveIntelligenceConfig": { + "type": "EffectiveIntelligenceConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trialConfig": { + "type": "TrialConfig", + "id": 7 + } + }, + "nested": { + "EditionConfig": { + "values": { + "EDITION_CONFIG_UNSPECIFIED": 0, + "INHERIT": 1, + "DISABLED": 2, + "STANDARD": 3, + "TRIAL": 5 + } + }, + "Filter": { + "oneofs": { + "cloudStorageLocations": { + "oneof": [ + "includedCloudStorageLocations", + "excludedCloudStorageLocations" + ] + }, + "cloudStorageBuckets": { + "oneof": [ + "includedCloudStorageBuckets", + "excludedCloudStorageBuckets" + ] + } + }, + "fields": { + "includedCloudStorageLocations": { + "type": "CloudStorageLocations", + "id": 1 + }, + "excludedCloudStorageLocations": { + "type": "CloudStorageLocations", + "id": 2 + }, + "includedCloudStorageBuckets": { + "type": "CloudStorageBuckets", + "id": 3 + }, + "excludedCloudStorageBuckets": { + "type": "CloudStorageBuckets", + "id": 4 + } + }, + "nested": { + "CloudStorageLocations": { + "fields": { + "locations": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudStorageBuckets": { + "fields": { + "bucketIdRegexes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "EffectiveIntelligenceConfig": { + "fields": { + "effectiveEdition": { + "type": "EffectiveEdition", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "intelligenceConfig": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "EffectiveEdition": { + "values": { + "EFFECTIVE_EDITION_UNSPECIFIED": 0, + "NONE": 1, + "STANDARD": 2 + } + } + } + }, + "TrialConfig": { + "fields": { + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "UpdateOrganizationIntelligenceConfigRequest": { + "fields": { + "intelligenceConfig": { + "type": "IntelligenceConfig", + "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_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateFolderIntelligenceConfigRequest": { + "fields": { + "intelligenceConfig": { + "type": "IntelligenceConfig", + "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_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateProjectIntelligenceConfigRequest": { + "fields": { + "intelligenceConfig": { + "type": "IntelligenceConfig", + "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_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetOrganizationIntelligenceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/IntelligenceConfig" + } + } + } + }, + "GetFolderIntelligenceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/IntelligenceConfig" + } + } + } + }, + "GetProjectIntelligenceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/IntelligenceConfig" + } + } + } + } + } + } + } + }, + "v2": { + "options": { + "go_package": "cloud.google.com/go/storage/internal/apiv2/storagepb;storagepb", + "java_multiple_files": true, + "java_outer_classname": "StorageProto", + "java_package": "com.google.storage.v2", + "(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": { + "Storage": { + "options": { + "(google.api.default_host)": "storage.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_write" + }, + "methods": { + "DeleteBucket": { + "requestType": "DeleteBucketRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetBucket": { + "requestType": "GetBucketRequest", + "responseType": "Bucket", + "options": { + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBucket": { + "requestType": "CreateBucketRequest", + "responseType": "Bucket", + "options": { + "(google.api.routing).routing_parameters.field": "bucket.project", + "(google.api.routing).routing_parameters.path_template": "{project=**}", + "(google.api.method_signature)": "parent,bucket,bucket_id" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "parent", + "path_template": "{project=**}" + }, + { + "field": "bucket.project", + "path_template": "{project=**}" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,bucket,bucket_id" + } + ] + }, + "ListBuckets": { + "requestType": "ListBucketsRequest", + "responseType": "ListBucketsResponse", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{project=**}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{project=**}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "LockBucketRetentionPolicy": { + "requestType": "LockBucketRetentionPolicyRequest", + "responseType": "Bucket", + "options": { + "(google.api.routing).routing_parameters.field": "bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.routing).routing_parameters.field": "resource", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "resource", + "path_template": "{bucket=**}" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.routing).routing_parameters.field": "resource", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "resource", + "path_template": "{bucket=**}" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.routing).routing_parameters.field": "resource", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/managedFolders/**", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "resource", + "path_template": "{bucket=**}" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/objects/**" + }, + { + "field": "resource", + "path_template": "{bucket=projects/*/buckets/*}/managedFolders/**" + } + ] + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + }, + "UpdateBucket": { + "requestType": "UpdateBucketRequest", + "responseType": "Bucket", + "options": { + "(google.api.routing).routing_parameters.field": "bucket.name", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket,update_mask" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket.name", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket,update_mask" + } + ] + }, + "ComposeObject": { + "requestType": "ComposeObjectRequest", + "responseType": "Object", + "options": { + "(google.api.routing).routing_parameters.field": "destination.bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "destination.bucket", + "path_template": "{bucket=**}" + } + } + } + ] + }, + "DeleteObject": { + "requestType": "DeleteObjectRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.routing).routing_parameters.field": "bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket,object,generation" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket,object" + }, + { + "(google.api.method_signature)": "bucket,object,generation" + } + ] + }, + "RestoreObject": { + "requestType": "RestoreObjectRequest", + "responseType": "Object", + "options": { + "(google.api.routing).routing_parameters.field": "bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket,object,generation" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket,object,generation" + } + ] + }, + "CancelResumableWrite": { + "requestType": "CancelResumableWriteRequest", + "responseType": "CancelResumableWriteResponse", + "options": { + "(google.api.routing).routing_parameters.field": "upload_id", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "upload_id" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "upload_id", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "upload_id" + } + ] + }, + "GetObject": { + "requestType": "GetObjectRequest", + "responseType": "Object", + "options": { + "(google.api.routing).routing_parameters.field": "bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket,object,generation" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket,object" + }, + { + "(google.api.method_signature)": "bucket,object,generation" + } + ] + }, + "ReadObject": { + "requestType": "ReadObjectRequest", + "responseType": "ReadObjectResponse", + "responseStream": true, + "options": { + "(google.api.routing).routing_parameters.field": "bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket,object,generation" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket,object" + }, + { + "(google.api.method_signature)": "bucket,object,generation" + } + ] + }, + "BidiReadObject": { + "requestType": "BidiReadObjectRequest", + "requestStream": true, + "responseType": "BidiReadObjectResponse", + "responseStream": true, + "options": { + "(google.api.routing).routing_parameters.field": "read_object_spec.bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "read_object_spec.bucket", + "path_template": "{bucket=**}" + } + } + } + ] + }, + "UpdateObject": { + "requestType": "UpdateObjectRequest", + "responseType": "Object", + "options": { + "(google.api.routing).routing_parameters.field": "object.bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "object,update_mask" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "object.bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "object,update_mask" + } + ] + }, + "WriteObject": { + "requestType": "WriteObjectRequest", + "requestStream": true, + "responseType": "WriteObjectResponse" + }, + "BidiWriteObject": { + "requestType": "BidiWriteObjectRequest", + "requestStream": true, + "responseType": "BidiWriteObjectResponse", + "responseStream": true + }, + "ListObjects": { + "requestType": "ListObjectsRequest", + "responseType": "ListObjectsResponse", + "options": { + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RewriteObject": { + "requestType": "RewriteObjectRequest", + "responseType": "RewriteResponse", + "options": { + "(google.api.routing).routing_parameters.field": "destination_bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": [ + { + "field": "source_bucket" + }, + { + "field": "destination_bucket", + "path_template": "{bucket=**}" + } + ] + } + } + ] + }, + "StartResumableWrite": { + "requestType": "StartResumableWriteRequest", + "responseType": "StartResumableWriteResponse", + "options": { + "(google.api.routing).routing_parameters.field": "write_object_spec.resource.bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "write_object_spec.resource.bucket", + "path_template": "{bucket=**}" + } + } + } + ] + }, + "QueryWriteStatus": { + "requestType": "QueryWriteStatusRequest", + "responseType": "QueryWriteStatusResponse", + "options": { + "(google.api.routing).routing_parameters.field": "upload_id", + "(google.api.routing).routing_parameters.path_template": "{bucket=projects/*/buckets/*}/**", + "(google.api.method_signature)": "upload_id" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "upload_id", + "path_template": "{bucket=projects/*/buckets/*}/**" + } + } + }, + { + "(google.api.method_signature)": "upload_id" + } + ] + }, + "MoveObject": { + "requestType": "MoveObjectRequest", + "responseType": "Object", + "options": { + "(google.api.routing).routing_parameters.field": "bucket", + "(google.api.routing).routing_parameters.path_template": "{bucket=**}", + "(google.api.method_signature)": "bucket,source_object,destination_object" + }, + "parsedOptions": [ + { + "(google.api.routing)": { + "routing_parameters": { + "field": "bucket", + "path_template": "{bucket=**}" + } + } + }, + { + "(google.api.method_signature)": "bucket,source_object,destination_object" + } + ] + } + } + }, + "DeleteBucketRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "GetBucketRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_readMask": { + "oneof": [ + "readMask" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "CreateBucketRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/Bucket" + } + }, + "bucket": { + "type": "Bucket", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bucketId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "predefinedAcl": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableObjectRetention": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBucketsRequest": { + "oneofs": { + "_readMask": { + "oneof": [ + "readMask" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "storage.googleapis.com/Bucket" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefix": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBucketsResponse": { + "fields": { + "buckets": { + "rule": "repeated", + "type": "Bucket", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "LockBucketRetentionPolicyRequest": { + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBucketRequest": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "bucket": { + "type": "Bucket", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "predefinedAcl": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ComposeObjectRequest": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_deleteSourceObjects": { + "oneof": [ + "deleteSourceObjects" + ] + } + }, + "fields": { + "destination": { + "type": "Object", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceObjects": { + "rule": "repeated", + "type": "SourceObject", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationPredefinedAcl": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "kmsKey": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectChecksums": { + "type": "ObjectChecksums", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deleteSourceObjects": { + "type": "bool", + "id": 11, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "SourceObject": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectPreconditions": { + "type": "ObjectPreconditions", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ObjectPreconditions": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + } + }, + "fields": { + "ifGenerationMatch": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + } + } + } + } + }, + "DeleteObjectRequest": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreObjectRequest": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_copySourceAcl": { + "oneof": [ + "copySourceAcl" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "restoreToken": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "copySourceAcl": { + "type": "bool", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelResumableWriteRequest": { + "fields": { + "uploadId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CancelResumableWriteResponse": { + "fields": {} + }, + "ReadObjectRequest": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_readMask": { + "oneof": [ + "readMask" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readOffset": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readLimit": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 12, + "options": { + "proto3_optional": true + } + } + } + }, + "GetObjectRequest": { + "oneofs": { + "_softDeleted": { + "oneof": [ + "softDeleted" + ] + }, + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_readMask": { + "oneof": [ + "readMask" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "softDeleted": { + "type": "bool", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "restoreToken": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ReadObjectResponse": { + "fields": { + "checksummedData": { + "type": "ChecksummedData", + "id": 1 + }, + "objectChecksums": { + "type": "ObjectChecksums", + "id": 2 + }, + "contentRange": { + "type": "ContentRange", + "id": 3 + }, + "metadata": { + "type": "Object", + "id": 4 + } + } + }, + "BidiReadObjectSpec": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_readMask": { + "oneof": [ + "readMask" + ] + }, + "_readHandle": { + "oneof": [ + "readHandle" + ] + }, + "_routingToken": { + "oneof": [ + "routingToken" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 12, + "options": { + "deprecated": true, + "proto3_optional": true + } + }, + "readHandle": { + "type": "BidiReadHandle", + "id": 13, + "options": { + "proto3_optional": true + } + }, + "routingToken": { + "type": "string", + "id": 14, + "options": { + "proto3_optional": true + } + } + } + }, + "BidiReadObjectRequest": { + "fields": { + "readObjectSpec": { + "type": "BidiReadObjectSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readRanges": { + "rule": "repeated", + "type": "ReadRange", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiReadObjectResponse": { + "fields": { + "objectDataRanges": { + "rule": "repeated", + "type": "ObjectRangeData", + "id": 6 + }, + "metadata": { + "type": "Object", + "id": 4 + }, + "readHandle": { + "type": "BidiReadHandle", + "id": 7 + } + } + }, + "BidiReadObjectRedirectedError": { + "oneofs": { + "_routingToken": { + "oneof": [ + "routingToken" + ] + } + }, + "fields": { + "readHandle": { + "type": "BidiReadHandle", + "id": 1 + }, + "routingToken": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "BidiWriteObjectRedirectedError": { + "oneofs": { + "_routingToken": { + "oneof": [ + "routingToken" + ] + }, + "_writeHandle": { + "oneof": [ + "writeHandle" + ] + }, + "_generation": { + "oneof": [ + "generation" + ] + } + }, + "fields": { + "routingToken": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "writeHandle": { + "type": "BidiWriteHandle", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "BidiReadObjectError": { + "fields": { + "readRangeErrors": { + "rule": "repeated", + "type": "ReadRangeError", + "id": 1 + } + } + }, + "ReadRangeError": { + "fields": { + "readId": { + "type": "int64", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "ReadRange": { + "fields": { + "readOffset": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readLength": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ObjectRangeData": { + "fields": { + "checksummedData": { + "type": "ChecksummedData", + "id": 1 + }, + "readRange": { + "type": "ReadRange", + "id": 2 + }, + "rangeEnd": { + "type": "bool", + "id": 3 + } + } + }, + "BidiReadHandle": { + "fields": { + "handle": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BidiWriteHandle": { + "fields": { + "handle": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WriteObjectSpec": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_objectSize": { + "oneof": [ + "objectSize" + ] + }, + "_appendable": { + "oneof": [ + "appendable" + ] + } + }, + "fields": { + "resource": { + "type": "Object", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "predefinedAcl": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "objectSize": { + "type": "int64", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "appendable": { + "type": "bool", + "id": 9, + "options": { + "proto3_optional": true + } + } + } + }, + "WriteObjectRequest": { + "oneofs": { + "firstMessage": { + "oneof": [ + "uploadId", + "writeObjectSpec" + ] + }, + "data": { + "oneof": [ + "checksummedData" + ] + } + }, + "fields": { + "uploadId": { + "type": "string", + "id": 1 + }, + "writeObjectSpec": { + "type": "WriteObjectSpec", + "id": 2 + }, + "writeOffset": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "checksummedData": { + "type": "ChecksummedData", + "id": 4 + }, + "objectChecksums": { + "type": "ObjectChecksums", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "finishWrite": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WriteObjectResponse": { + "oneofs": { + "writeStatus": { + "oneof": [ + "persistedSize", + "resource" + ] + } + }, + "fields": { + "persistedSize": { + "type": "int64", + "id": 1 + }, + "resource": { + "type": "Object", + "id": 2 + }, + "persistedDataChecksums": { + "type": "ObjectChecksums", + "id": 3 + } + } + }, + "AppendObjectSpec": { + "oneofs": { + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_routingToken": { + "oneof": [ + "routingToken" + ] + }, + "_writeHandle": { + "oneof": [ + "writeHandle" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "routingToken": { + "type": "string", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "writeHandle": { + "type": "BidiWriteHandle", + "id": 7, + "options": { + "proto3_optional": true + } + } + } + }, + "BidiWriteObjectRequest": { + "oneofs": { + "firstMessage": { + "oneof": [ + "uploadId", + "writeObjectSpec", + "appendObjectSpec" + ] + }, + "data": { + "oneof": [ + "checksummedData" + ] + } + }, + "fields": { + "uploadId": { + "type": "string", + "id": 1 + }, + "writeObjectSpec": { + "type": "WriteObjectSpec", + "id": 2 + }, + "appendObjectSpec": { + "type": "AppendObjectSpec", + "id": 11 + }, + "writeOffset": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "checksummedData": { + "type": "ChecksummedData", + "id": 4 + }, + "objectChecksums": { + "type": "ObjectChecksums", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stateLookup": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flush": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "finishWrite": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiWriteObjectResponse": { + "oneofs": { + "writeStatus": { + "oneof": [ + "persistedSize", + "resource" + ] + }, + "_writeHandle": { + "oneof": [ + "writeHandle" + ] + } + }, + "fields": { + "persistedSize": { + "type": "int64", + "id": 1 + }, + "resource": { + "type": "Object", + "id": 2 + }, + "persistedDataChecksums": { + "type": "ObjectChecksums", + "id": 4 + }, + "writeHandle": { + "type": "BidiWriteHandle", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "ListObjectsRequest": { + "oneofs": { + "_readMask": { + "oneof": [ + "readMask" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "delimiter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeTrailingDelimiter": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefix": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versions": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "lexicographicStart": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lexicographicEnd": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "softDeleted": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeFoldersAsPrefixes": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchGlob": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryWriteStatusRequest": { + "fields": { + "uploadId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryWriteStatusResponse": { + "oneofs": { + "writeStatus": { + "oneof": [ + "persistedSize", + "resource" + ] + } + }, + "fields": { + "persistedSize": { + "type": "int64", + "id": 1 + }, + "resource": { + "type": "Object", + "id": 2 + }, + "persistedDataChecksums": { + "type": "ObjectChecksums", + "id": 3 + } + } + }, + "RewriteObjectRequest": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + }, + "_ifSourceGenerationMatch": { + "oneof": [ + "ifSourceGenerationMatch" + ] + }, + "_ifSourceGenerationNotMatch": { + "oneof": [ + "ifSourceGenerationNotMatch" + ] + }, + "_ifSourceMetagenerationMatch": { + "oneof": [ + "ifSourceMetagenerationMatch" + ] + }, + "_ifSourceMetagenerationNotMatch": { + "oneof": [ + "ifSourceMetagenerationNotMatch" + ] + } + }, + "fields": { + "destinationName": { + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "destinationBucket": { + "type": "string", + "id": 25, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "destinationKmsKey": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "destination": { + "type": "Object", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sourceBucket": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "sourceObject": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceGeneration": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rewriteToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationPredefinedAcl": { + "type": "string", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "ifSourceGenerationMatch": { + "type": "int64", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "ifSourceGenerationNotMatch": { + "type": "int64", + "id": 12, + "options": { + "proto3_optional": true + } + }, + "ifSourceMetagenerationMatch": { + "type": "int64", + "id": 13, + "options": { + "proto3_optional": true + } + }, + "ifSourceMetagenerationNotMatch": { + "type": "int64", + "id": 14, + "options": { + "proto3_optional": true + } + }, + "maxBytesRewrittenPerCall": { + "type": "int64", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "copySourceEncryptionAlgorithm": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "copySourceEncryptionKeyBytes": { + "type": "bytes", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "copySourceEncryptionKeySha256Bytes": { + "type": "bytes", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectChecksums": { + "type": "ObjectChecksums", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RewriteResponse": { + "fields": { + "totalBytesRewritten": { + "type": "int64", + "id": 1 + }, + "objectSize": { + "type": "int64", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "rewriteToken": { + "type": "string", + "id": 4 + }, + "resource": { + "type": "Object", + "id": 5 + } + } + }, + "MoveObjectRequest": { + "oneofs": { + "_ifSourceGenerationMatch": { + "oneof": [ + "ifSourceGenerationMatch" + ] + }, + "_ifSourceGenerationNotMatch": { + "oneof": [ + "ifSourceGenerationNotMatch" + ] + }, + "_ifSourceMetagenerationMatch": { + "oneof": [ + "ifSourceMetagenerationMatch" + ] + }, + "_ifSourceMetagenerationNotMatch": { + "oneof": [ + "ifSourceMetagenerationNotMatch" + ] + }, + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "sourceObject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destinationObject": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ifSourceGenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifSourceGenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifSourceMetagenerationMatch": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifSourceMetagenerationNotMatch": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "StartResumableWriteRequest": { + "fields": { + "writeObjectSpec": { + "type": "WriteObjectSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectChecksums": { + "type": "ObjectChecksums", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StartResumableWriteResponse": { + "fields": { + "uploadId": { + "type": "string", + "id": 1 + } + } + }, + "UpdateObjectRequest": { + "oneofs": { + "_ifGenerationMatch": { + "oneof": [ + "ifGenerationMatch" + ] + }, + "_ifGenerationNotMatch": { + "oneof": [ + "ifGenerationNotMatch" + ] + }, + "_ifMetagenerationMatch": { + "oneof": [ + "ifMetagenerationMatch" + ] + }, + "_ifMetagenerationNotMatch": { + "oneof": [ + "ifMetagenerationNotMatch" + ] + } + }, + "fields": { + "object": { + "type": "Object", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ifGenerationMatch": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "ifGenerationNotMatch": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationMatch": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "ifMetagenerationNotMatch": { + "type": "int64", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "predefinedAcl": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "commonObjectRequestParams": { + "type": "CommonObjectRequestParams", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "overrideUnlockedRetention": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CommonObjectRequestParams": { + "fields": { + "encryptionAlgorithm": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKeyBytes": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKeySha256Bytes": { + "type": "bytes", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ServiceConstants": { + "fields": {}, + "nested": { + "Values": { + "options": { + "allow_alias": true + }, + "values": { + "VALUES_UNSPECIFIED": 0, + "MAX_READ_CHUNK_BYTES": 2097152, + "MAX_WRITE_CHUNK_BYTES": 2097152, + "MAX_OBJECT_SIZE_MB": 5242880, + "MAX_CUSTOM_METADATA_FIELD_NAME_BYTES": 1024, + "MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES": 4096, + "MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES": 8192, + "MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES": 20480, + "MAX_NOTIFICATION_CONFIGS_PER_BUCKET": 100, + "MAX_LIFECYCLE_RULES_PER_BUCKET": 100, + "MAX_NOTIFICATION_CUSTOM_ATTRIBUTES": 5, + "MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH": 256, + "MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH": 1024, + "MAX_LABELS_ENTRIES_COUNT": 64, + "MAX_LABELS_KEY_VALUE_LENGTH": 63, + "MAX_LABELS_KEY_VALUE_BYTES": 128, + "MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST": 1000, + "SPLIT_TOKEN_MAX_VALID_DAYS": 14 + } + } + } + }, + "Bucket": { + "options": { + "(google.api.resource).type": "storage.googleapis.com/Bucket", + "(google.api.resource).pattern": "projects/{project}/buckets/{bucket}", + "(google.api.resource).plural": "buckets", + "(google.api.resource).singular": "bucket" + }, + "oneofs": { + "_ipFilter": { + "oneof": [ + "ipFilter" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "bucketId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 29 + }, + "project": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "metageneration": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "locationType": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageClass": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rpo": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acl": { + "rule": "repeated", + "type": "BucketAccessControl", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultObjectAcl": { + "rule": "repeated", + "type": "ObjectAccessControl", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lifecycle": { + "type": "Lifecycle", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cors": { + "rule": "repeated", + "type": "Cors", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultEventBasedHold": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "website": { + "type": "Website", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versioning": { + "type": "Versioning", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "logging": { + "type": "Logging", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "owner": { + "type": "Owner", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryption": { + "type": "Encryption", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "billing": { + "type": "Billing", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retentionPolicy": { + "type": "RetentionPolicy", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "iamConfig": { + "type": "IamConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customPlacementConfig": { + "type": "CustomPlacementConfig", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoclass": { + "type": "Autoclass", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hierarchicalNamespace": { + "type": "HierarchicalNamespace", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "softDeletePolicy": { + "type": "SoftDeletePolicy", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectRetention": { + "type": "ObjectRetention", + "id": 33, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ipFilter": { + "type": "IpFilter", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Billing": { + "fields": { + "requesterPays": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Cors": { + "fields": { + "origin": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "method": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "responseHeader": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxAgeSeconds": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Encryption": { + "oneofs": { + "_googleManagedEncryptionEnforcementConfig": { + "oneof": [ + "googleManagedEncryptionEnforcementConfig" + ] + }, + "_customerManagedEncryptionEnforcementConfig": { + "oneof": [ + "customerManagedEncryptionEnforcementConfig" + ] + }, + "_customerSuppliedEncryptionEnforcementConfig": { + "oneof": [ + "customerSuppliedEncryptionEnforcementConfig" + ] + } + }, + "fields": { + "defaultKmsKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "googleManagedEncryptionEnforcementConfig": { + "type": "GoogleManagedEncryptionEnforcementConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "customerManagedEncryptionEnforcementConfig": { + "type": "CustomerManagedEncryptionEnforcementConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "customerSuppliedEncryptionEnforcementConfig": { + "type": "CustomerSuppliedEncryptionEnforcementConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "GoogleManagedEncryptionEnforcementConfig": { + "oneofs": { + "_restrictionMode": { + "oneof": [ + "restrictionMode" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + } + }, + "fields": { + "restrictionMode": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "CustomerManagedEncryptionEnforcementConfig": { + "oneofs": { + "_restrictionMode": { + "oneof": [ + "restrictionMode" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + } + }, + "fields": { + "restrictionMode": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "CustomerSuppliedEncryptionEnforcementConfig": { + "oneofs": { + "_restrictionMode": { + "oneof": [ + "restrictionMode" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + } + }, + "fields": { + "restrictionMode": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "IamConfig": { + "fields": { + "uniformBucketLevelAccess": { + "type": "UniformBucketLevelAccess", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publicAccessPrevention": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UniformBucketLevelAccess": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lockTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "Lifecycle": { + "fields": { + "rule": { + "rule": "repeated", + "type": "Rule", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Rule": { + "fields": { + "action": { + "type": "Action", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "condition": { + "type": "Condition", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Action": { + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageClass": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Condition": { + "oneofs": { + "_ageDays": { + "oneof": [ + "ageDays" + ] + }, + "_isLive": { + "oneof": [ + "isLive" + ] + }, + "_numNewerVersions": { + "oneof": [ + "numNewerVersions" + ] + }, + "_daysSinceCustomTime": { + "oneof": [ + "daysSinceCustomTime" + ] + }, + "_daysSinceNoncurrentTime": { + "oneof": [ + "daysSinceNoncurrentTime" + ] + } + }, + "fields": { + "ageDays": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "createdBefore": { + "type": "google.type.Date", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "isLive": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "numNewerVersions": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "matchesStorageClass": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysSinceCustomTime": { + "type": "int32", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "customTimeBefore": { + "type": "google.type.Date", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysSinceNoncurrentTime": { + "type": "int32", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "noncurrentTimeBefore": { + "type": "google.type.Date", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchesPrefix": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchesSuffix": { + "rule": "repeated", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "Logging": { + "fields": { + "logBucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "logObjectPrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ObjectRetention": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RetentionPolicy": { + "fields": { + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "isLocked": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retentionDuration": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SoftDeletePolicy": { + "oneofs": { + "_retentionDuration": { + "oneof": [ + "retentionDuration" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + } + }, + "fields": { + "retentionDuration": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "Versioning": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Website": { + "fields": { + "mainPageSuffix": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "notFoundPage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CustomPlacementConfig": { + "fields": { + "dataLocations": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Autoclass": { + "oneofs": { + "_terminalStorageClass": { + "oneof": [ + "terminalStorageClass" + ] + }, + "_terminalStorageClassUpdateTime": { + "oneof": [ + "terminalStorageClassUpdateTime" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toggleTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalStorageClass": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "terminalStorageClassUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "IpFilter": { + "oneofs": { + "_mode": { + "oneof": [ + "mode" + ] + }, + "_publicNetworkSource": { + "oneof": [ + "publicNetworkSource" + ] + }, + "_allowAllServiceAgentAccess": { + "oneof": [ + "allowAllServiceAgentAccess" + ] + } + }, + "fields": { + "mode": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "publicNetworkSource": { + "type": "PublicNetworkSource", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "vpcNetworkSources": { + "rule": "repeated", + "type": "VpcNetworkSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowCrossOrgVpcs": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowAllServiceAgentAccess": { + "type": "bool", + "id": 5, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PublicNetworkSource": { + "fields": { + "allowedIpCidrRanges": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VpcNetworkSource": { + "oneofs": { + "_network": { + "oneof": [ + "network" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "allowedIpCidrRanges": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "HierarchicalNamespace": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "BucketAccessControl": { + "fields": { + "role": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entity": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entityAlt": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entityId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "email": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "domain": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "projectTeam": { + "type": "ProjectTeam", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChecksummedData": { + "oneofs": { + "_crc32c": { + "oneof": [ + "crc32c" + ] + } + }, + "fields": { + "content": { + "type": "bytes", + "id": 1, + "options": { + "ctype": "CORD", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "crc32c": { + "type": "fixed32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "ObjectChecksums": { + "oneofs": { + "_crc32c": { + "oneof": [ + "crc32c" + ] + } + }, + "fields": { + "crc32c": { + "type": "fixed32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "md5Hash": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ObjectCustomContextPayload": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "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" + } + } + } + }, + "ObjectContexts": { + "fields": { + "custom": { + "keyType": "string", + "type": "ObjectCustomContextPayload", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CustomerEncryption": { + "fields": { + "encryptionAlgorithm": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keySha256Bytes": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Object": { + "oneofs": { + "_restoreToken": { + "oneof": [ + "restoreToken" + ] + }, + "_eventBasedHold": { + "oneof": [ + "eventBasedHold" + ] + }, + "_softDeleteTime": { + "oneof": [ + "softDeleteTime" + ] + }, + "_hardDeleteTime": { + "oneof": [ + "hardDeleteTime" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "bucket": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket" + } + }, + "etag": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "restoreToken": { + "type": "string", + "id": 35, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "metageneration": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageClass": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "size": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "contentEncoding": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contentDisposition": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cacheControl": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acl": { + "rule": "repeated", + "type": "ObjectAccessControl", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contentLanguage": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "finalizeTime": { + "type": "google.protobuf.Timestamp", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "contentType": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "componentCount": { + "type": "int32", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "checksums": { + "type": "ObjectChecksums", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKey": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "updateStorageClassTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "temporaryHold": { + "type": "bool", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retentionExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contexts": { + "type": "ObjectContexts", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventBasedHold": { + "type": "bool", + "id": 23, + "options": { + "proto3_optional": true + } + }, + "owner": { + "type": "Owner", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customerEncryption": { + "type": "CustomerEncryption", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "softDeleteTime": { + "type": "google.protobuf.Timestamp", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "hardDeleteTime": { + "type": "google.protobuf.Timestamp", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "retention": { + "type": "Retention", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Retention": { + "fields": { + "mode": { + "type": "Mode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retainUntilTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "UNLOCKED": 1, + "LOCKED": 2 + } + } + } + } + } + }, + "ObjectAccessControl": { + "fields": { + "role": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entity": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entityAlt": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entityId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "email": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "domain": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "projectTeam": { + "type": "ProjectTeam", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListObjectsResponse": { + "fields": { + "objects": { + "rule": "repeated", + "type": "Object", + "id": 1 + }, + "prefixes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "ProjectTeam": { + "fields": { + "projectNumber": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "team": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Owner": { + "fields": { + "entity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entityId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ContentRange": { + "fields": { + "start": { + "type": "int64", + "id": 1 + }, + "end": { + "type": "int64", + "id": 2 + }, + "completeLength": { + "type": "int64", + "id": 3 + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "RoutingProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "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 + } + } + }, + "routing": { + "type": "google.api.RoutingRule", + "id": 72295729, + "extend": "google.protobuf.MethodOptions" + }, + "RoutingRule": { + "fields": { + "routingParameters": { + "rule": "repeated", + "type": "RoutingParameter", + "id": 2 + } + } + }, + "RoutingParameter": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "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 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "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": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json b/owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json new file mode 100644 index 00000000000..cf927732b85 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json @@ -0,0 +1,1339 @@ +{ + "clientLibrary": { + "name": "nodejs-control", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.storage.control.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "storage_v2_generated_StorageControl_CreateFolder_async", + "title": "StorageControl createFolder Sample", + "origin": "API_DEFINITION", + "description": " Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket.", + "canonical": true, + "file": "storage_control.create_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFolder", + "fullName": "google.storage.control.v2.StorageControl.CreateFolder", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "folder", + "type": ".google.storage.control.v2.Folder" + }, + { + "name": "folder_id", + "type": "TYPE_STRING" + }, + { + "name": "recursive", + "type": "TYPE_BOOL" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.Folder", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "CreateFolder", + "fullName": "google.storage.control.v2.StorageControl.CreateFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_DeleteFolder_async", + "title": "StorageControl deleteFolder Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket.", + "canonical": true, + "file": "storage_control.delete_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFolder", + "fullName": "google.storage.control.v2.StorageControl.DeleteFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "DeleteFolder", + "fullName": "google.storage.control.v2.StorageControl.DeleteFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetFolder_async", + "title": "StorageControl getFolder Sample", + "origin": "API_DEFINITION", + "description": " Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket.", + "canonical": true, + "file": "storage_control.get_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFolder", + "fullName": "google.storage.control.v2.StorageControl.GetFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.Folder", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetFolder", + "fullName": "google.storage.control.v2.StorageControl.GetFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_ListFolders_async", + "title": "StorageControl listFolders Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket.", + "canonical": true, + "file": "storage_control.list_folders.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFolders", + "fullName": "google.storage.control.v2.StorageControl.ListFolders", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "prefix", + "type": "TYPE_STRING" + }, + { + "name": "delimiter", + "type": "TYPE_STRING" + }, + { + "name": "lexicographic_start", + "type": "TYPE_STRING" + }, + { + "name": "lexicographic_end", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.ListFoldersResponse", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "ListFolders", + "fullName": "google.storage.control.v2.StorageControl.ListFolders", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_RenameFolder_async", + "title": "StorageControl renameFolder Sample", + "origin": "API_DEFINITION", + "description": " Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes.", + "canonical": true, + "file": "storage_control.rename_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RenameFolder", + "fullName": "google.storage.control.v2.StorageControl.RenameFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "destination_folder_id", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "RenameFolder", + "fullName": "google.storage.control.v2.StorageControl.RenameFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_DeleteFolderRecursive_async", + "title": "StorageControl deleteFolderRecursive Sample", + "origin": "API_DEFINITION", + "description": " Deletes a folder recursively. This operation is only applicable to a hierarchical namespace enabled bucket.", + "canonical": true, + "file": "storage_control.delete_folder_recursive.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFolderRecursive", + "fullName": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "DeleteFolderRecursive", + "fullName": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetStorageLayout_async", + "title": "StorageControl getStorageLayout Sample", + "origin": "API_DEFINITION", + "description": " Returns the storage layout configuration for a given bucket.", + "canonical": true, + "file": "storage_control.get_storage_layout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStorageLayout", + "fullName": "google.storage.control.v2.StorageControl.GetStorageLayout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "prefix", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.StorageLayout", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetStorageLayout", + "fullName": "google.storage.control.v2.StorageControl.GetStorageLayout", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_CreateManagedFolder_async", + "title": "StorageControl createManagedFolder Sample", + "origin": "API_DEFINITION", + "description": " Creates a new managed folder.", + "canonical": true, + "file": "storage_control.create_managed_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateManagedFolder", + "fullName": "google.storage.control.v2.StorageControl.CreateManagedFolder", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "managed_folder", + "type": ".google.storage.control.v2.ManagedFolder" + }, + { + "name": "managed_folder_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.ManagedFolder", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "CreateManagedFolder", + "fullName": "google.storage.control.v2.StorageControl.CreateManagedFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_DeleteManagedFolder_async", + "title": "StorageControl deleteManagedFolder Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes an empty managed folder.", + "canonical": true, + "file": "storage_control.delete_managed_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteManagedFolder", + "fullName": "google.storage.control.v2.StorageControl.DeleteManagedFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "allow_non_empty", + "type": "TYPE_BOOL" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "DeleteManagedFolder", + "fullName": "google.storage.control.v2.StorageControl.DeleteManagedFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetManagedFolder_async", + "title": "StorageControl getManagedFolder Sample", + "origin": "API_DEFINITION", + "description": " Returns metadata for the specified managed folder.", + "canonical": true, + "file": "storage_control.get_managed_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetManagedFolder", + "fullName": "google.storage.control.v2.StorageControl.GetManagedFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.ManagedFolder", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetManagedFolder", + "fullName": "google.storage.control.v2.StorageControl.GetManagedFolder", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_ListManagedFolders_async", + "title": "StorageControl listManagedFolders Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of managed folders for a given bucket.", + "canonical": true, + "file": "storage_control.list_managed_folders.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListManagedFolders", + "fullName": "google.storage.control.v2.StorageControl.ListManagedFolders", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "prefix", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.ListManagedFoldersResponse", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "ListManagedFolders", + "fullName": "google.storage.control.v2.StorageControl.ListManagedFolders", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_CreateAnywhereCache_async", + "title": "StorageControl createAnywhereCache Sample", + "origin": "API_DEFINITION", + "description": " Creates an Anywhere Cache instance.", + "canonical": true, + "file": "storage_control.create_anywhere_cache.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.CreateAnywhereCache", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "anywhere_cache", + "type": ".google.storage.control.v2.AnywhereCache" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "CreateAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.CreateAnywhereCache", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_UpdateAnywhereCache_async", + "title": "StorageControl updateAnywhereCache Sample", + "origin": "API_DEFINITION", + "description": " Updates an Anywhere Cache instance. Mutable fields include `ttl` and `admission_policy`.", + "canonical": true, + "file": "storage_control.update_anywhere_cache.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.UpdateAnywhereCache", + "async": true, + "parameters": [ + { + "name": "anywhere_cache", + "type": ".google.storage.control.v2.AnywhereCache" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "UpdateAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.UpdateAnywhereCache", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_DisableAnywhereCache_async", + "title": "StorageControl disableAnywhereCache Sample", + "origin": "API_DEFINITION", + "description": " Disables an Anywhere Cache instance. A disabled instance is read-only. The disablement could be revoked by calling ResumeAnywhereCache. The cache instance will be deleted automatically if it remains in the disabled state for at least one hour.", + "canonical": true, + "file": "storage_control.disable_anywhere_cache.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.DisableAnywhereCache", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.AnywhereCache", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "DisableAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.DisableAnywhereCache", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_PauseAnywhereCache_async", + "title": "StorageControl pauseAnywhereCache Sample", + "origin": "API_DEFINITION", + "description": " Pauses an Anywhere Cache instance.", + "canonical": true, + "file": "storage_control.pause_anywhere_cache.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PauseAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.PauseAnywhereCache", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.AnywhereCache", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "PauseAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.PauseAnywhereCache", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_ResumeAnywhereCache_async", + "title": "StorageControl resumeAnywhereCache Sample", + "origin": "API_DEFINITION", + "description": " Resumes a disabled or paused Anywhere Cache instance.", + "canonical": true, + "file": "storage_control.resume_anywhere_cache.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.ResumeAnywhereCache", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.AnywhereCache", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "ResumeAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.ResumeAnywhereCache", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetAnywhereCache_async", + "title": "StorageControl getAnywhereCache Sample", + "origin": "API_DEFINITION", + "description": " Gets an Anywhere Cache instance.", + "canonical": true, + "file": "storage_control.get_anywhere_cache.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.GetAnywhereCache", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.AnywhereCache", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetAnywhereCache", + "fullName": "google.storage.control.v2.StorageControl.GetAnywhereCache", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_ListAnywhereCaches_async", + "title": "StorageControl listAnywhereCaches Sample", + "origin": "API_DEFINITION", + "description": " Lists Anywhere Cache instances for a given bucket.", + "canonical": true, + "file": "storage_control.list_anywhere_caches.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAnywhereCaches", + "fullName": "google.storage.control.v2.StorageControl.ListAnywhereCaches", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.ListAnywhereCachesResponse", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "ListAnywhereCaches", + "fullName": "google.storage.control.v2.StorageControl.ListAnywhereCaches", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_async", + "title": "StorageControl getProjectIntelligenceConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the Project scoped singleton IntelligenceConfig resource.", + "canonical": true, + "file": "storage_control.get_project_intelligence_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProjectIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.GetProjectIntelligenceConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.IntelligenceConfig", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetProjectIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.GetProjectIntelligenceConfig", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_async", + "title": "StorageControl updateProjectIntelligenceConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the Project scoped singleton IntelligenceConfig resource.", + "canonical": true, + "file": "storage_control.update_project_intelligence_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateProjectIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfig", + "async": true, + "parameters": [ + { + "name": "intelligence_config", + "type": ".google.storage.control.v2.IntelligenceConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.IntelligenceConfig", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "UpdateProjectIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfig", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_async", + "title": "StorageControl getFolderIntelligenceConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the Folder scoped singleton IntelligenceConfig resource.", + "canonical": true, + "file": "storage_control.get_folder_intelligence_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFolderIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.GetFolderIntelligenceConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.IntelligenceConfig", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetFolderIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.GetFolderIntelligenceConfig", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_async", + "title": "StorageControl updateFolderIntelligenceConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the Folder scoped singleton IntelligenceConfig resource.", + "canonical": true, + "file": "storage_control.update_folder_intelligence_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFolderIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfig", + "async": true, + "parameters": [ + { + "name": "intelligence_config", + "type": ".google.storage.control.v2.IntelligenceConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.IntelligenceConfig", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "UpdateFolderIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfig", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_async", + "title": "StorageControl getOrganizationIntelligenceConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the Organization scoped singleton IntelligenceConfig resource.", + "canonical": true, + "file": "storage_control.get_organization_intelligence_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganizationIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.IntelligenceConfig", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetOrganizationIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfig", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_async", + "title": "StorageControl updateOrganizationIntelligenceConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the Organization scoped singleton IntelligenceConfig resource.", + "canonical": true, + "file": "storage_control.update_organization_intelligence_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateOrganizationIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfig", + "async": true, + "parameters": [ + { + "name": "intelligence_config", + "type": ".google.storage.control.v2.IntelligenceConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storage.control.v2.IntelligenceConfig", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "UpdateOrganizationIntelligenceConfig", + "fullName": "google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfig", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_GetIamPolicy_async", + "title": "StorageControl getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the IAM policy for a specified bucket. The `resource` field in the request should be `projects/_/buckets/{bucket}` for a bucket, or `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` for a managed folder.", + "canonical": true, + "file": "storage_control.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.storage.control.v2.StorageControl.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.storage.control.v2.StorageControl.GetIamPolicy", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_SetIamPolicy_async", + "title": "StorageControl setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates an IAM policy for the specified bucket. The `resource` field in the request should be `projects/_/buckets/{bucket}` for a bucket, or `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` for a managed folder.", + "canonical": true, + "file": "storage_control.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.storage.control.v2.StorageControl.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.storage.control.v2.StorageControl.SetIamPolicy", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + }, + { + "regionTag": "storage_v2_generated_StorageControl_TestIamPermissions_async", + "title": "StorageControl testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Tests a set of permissions on the given bucket, object, or managed folder to see which, if any, are held by the caller. The `resource` field in the request should be `projects/_/buckets/{bucket}` for a bucket, `projects/_/buckets/{bucket}/objects/{object}` for an object, or `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` for a managed folder.", + "canonical": true, + "file": "storage_control.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.storage.control.v2.StorageControl.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "StorageControlClient", + "fullName": "google.storage.control.v2.StorageControlClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.storage.control.v2.StorageControl.TestIamPermissions", + "service": { + "shortName": "StorageControl", + "fullName": "google.storage.control.v2.StorageControl" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.v2.json b/owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.v2.json new file mode 100644 index 00000000000..7d8ebc43fb2 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.v2.json @@ -0,0 +1,339 @@ +{ + "clientLibrary": { + "name": "nodejs-storage", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.storage.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "storage_v2_generated_Storage_DeleteBucket_async", + "title": "Storage deleteBucket Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes an empty bucket. The request fails if there are any live or noncurrent objects in the bucket, but the request succeeds if the bucket only contains soft-deleted objects or incomplete uploads, such as ongoing XML API multipart uploads. Does not permanently delete soft-deleted objects. When this API is used to delete a bucket containing an object that has a soft delete policy enabled, the object becomes soft deleted, and the `softDeleteTime` and `hardDeleteTime` properties are set on the object. Objects and multipart uploads that were in the bucket at the time of deletion are also retained for the specified retention duration. When a soft-deleted bucket reaches the end of its retention duration, it is permanently deleted. The `hardDeleteTime` of the bucket always equals or exceeds the expiration time of the last soft-deleted object in the bucket. **IAM Permissions**: Requires `storage.buckets.delete` IAM permission on the bucket.", + "canonical": true, + "file": "storage.delete_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBucket", + "fullName": "google.storage.v2.Storage.DeleteBucket", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageClient", + "fullName": "google.storage.v2.StorageClient" + }, + "method": { + "shortName": "DeleteBucket", + "fullName": "google.storage.v2.Storage.DeleteBucket", + "service": { + "shortName": "Storage", + "fullName": "google.storage.v2.Storage" + } + } + } + }, + { + "regionTag": "storage_v2_generated_Storage_GetBucket_async", + "title": "Storage getBucket Sample", + "origin": "API_DEFINITION", + "description": " Returns metadata for the specified bucket. **IAM Permissions**: Requires `storage.buckets.get` IAM permission on the bucket. Additionally, to return specific bucket metadata, the authenticated user must have the following permissions: - To return the IAM policies: `storage.buckets.getIamPolicy` - To return the bucket IP filtering rules: `storage.buckets.getIpFilter`", + "canonical": true, + "file": "storage.get_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBucket", + "fullName": "google.storage.v2.Storage.GetBucket", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storage.v2.Bucket", + "client": { + "shortName": "StorageClient", + "fullName": "google.storage.v2.StorageClient" + }, + "method": { + "shortName": "GetBucket", + "fullName": "google.storage.v2.Storage.GetBucket", + "service": { + "shortName": "Storage", + "fullName": "google.storage.v2.Storage" + } + } + } + }, + { + "regionTag": "storage_v2_generated_Storage_CreateBucket_async", + "title": "Storage createBucket Sample", + "origin": "API_DEFINITION", + "description": " Creates a new bucket. **IAM Permissions**: Requires `storage.buckets.create` IAM permission on the bucket. Additionally, to enable specific bucket features, the authenticated user must have the following permissions: - To enable object retention using the `enableObjectRetention` query parameter: `storage.buckets.enableObjectRetention` - To set the bucket IP filtering rules: `storage.buckets.setIpFilter`", + "canonical": true, + "file": "storage.create_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBucket", + "fullName": "google.storage.v2.Storage.CreateBucket", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "bucket", + "type": ".google.storage.v2.Bucket" + }, + { + "name": "bucket_id", + "type": "TYPE_STRING" + }, + { + "name": "predefined_acl", + "type": "TYPE_STRING" + }, + { + "name": "predefined_default_object_acl", + "type": "TYPE_STRING" + }, + { + "name": "enable_object_retention", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.storage.v2.Bucket", + "client": { + "shortName": "StorageClient", + "fullName": "google.storage.v2.StorageClient" + }, + "method": { + "shortName": "CreateBucket", + "fullName": "google.storage.v2.Storage.CreateBucket", + "service": { + "shortName": "Storage", + "fullName": "google.storage.v2.Storage" + } + } + } + }, + { + "regionTag": "storage_v2_generated_Storage_ListBuckets_async", + "title": "Storage listBuckets Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of buckets for a given project, ordered lexicographically by name. **IAM Permissions**: Requires `storage.buckets.list` IAM permission on the bucket. Additionally, to enable specific bucket features, the authenticated user must have the following permissions: - To list the IAM policies: `storage.buckets.getIamPolicy` - To list the bucket IP filtering rules: `storage.buckets.getIpFilter`", + "canonical": true, + "file": "storage.list_buckets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBuckets", + "fullName": "google.storage.v2.Storage.ListBuckets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "prefix", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "return_partial_success", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.storage.v2.ListBucketsResponse", + "client": { + "shortName": "StorageClient", + "fullName": "google.storage.v2.StorageClient" + }, + "method": { + "shortName": "ListBuckets", + "fullName": "google.storage.v2.Storage.ListBuckets", + "service": { + "shortName": "Storage", + "fullName": "google.storage.v2.Storage" + } + } + } + }, + { + "regionTag": "storage_v2_generated_Storage_LockBucketRetentionPolicy_async", + "title": "Storage lockBucketRetentionPolicy Sample", + "origin": "API_DEFINITION", + "description": " Permanently locks the retention policy that is currently applied to the specified bucket. Caution: Locking a bucket is an irreversible action. Once you lock a bucket: - You cannot remove the retention policy from the bucket. - You cannot decrease the retention period for the policy. Once locked, you must delete the entire bucket in order to remove the bucket's retention policy. However, before you can delete the bucket, you must delete all the objects in the bucket, which is only possible if all the objects have reached the retention period set by the retention policy. **IAM Permissions**: Requires `storage.buckets.update` IAM permission on the bucket.", + "canonical": true, + "file": "storage.lock_bucket_retention_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LockBucketRetentionPolicy", + "fullName": "google.storage.v2.Storage.LockBucketRetentionPolicy", + "async": true, + "parameters": [ + { + "name": "bucket", + "type": "TYPE_STRING" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.storage.v2.Bucket", + "client": { + "shortName": "StorageClient", + "fullName": "google.storage.v2.StorageClient" + }, + "method": { + "shortName": "LockBucketRetentionPolicy", + "fullName": "google.storage.v2.Storage.LockBucketRetentionPolicy", + "service": { + "shortName": "Storage", + "fullName": "google.storage.v2.Storage" + } + } + } + }, + { + "regionTag": "storage_v2_generated_Storage_UpdateBucket_async", + "title": "Storage updateBucket Sample", + "origin": "API_DEFINITION", + "description": " Updates a bucket. Changes to the bucket are readable immediately after writing, but configuration changes might take time to propagate. This method supports `patch` semantics. **IAM Permissions**: Requires `storage.buckets.update` IAM permission on the bucket. Additionally, to enable specific bucket features, the authenticated user must have the following permissions: - To set bucket IP filtering rules: `storage.buckets.setIpFilter` - To update public access prevention policies or access control lists (ACLs): `storage.buckets.setIamPolicy`", + "canonical": true, + "file": "storage.update_bucket.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBucket", + "fullName": "google.storage.v2.Storage.UpdateBucket", + "async": true, + "parameters": [ + { + "name": "bucket", + "type": ".google.storage.v2.Bucket" + }, + { + "name": "if_metageneration_match", + "type": "TYPE_INT64" + }, + { + "name": "if_metageneration_not_match", + "type": "TYPE_INT64" + }, + { + "name": "predefined_acl", + "type": "TYPE_STRING" + }, + { + "name": "predefined_default_object_acl", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storage.v2.Bucket", + "client": { + "shortName": "StorageClient", + "fullName": "google.storage.v2.StorageClient" + }, + "method": { + "shortName": "UpdateBucket", + "fullName": "google.storage.v2.Storage.UpdateBucket", + "service": { + "shortName": "Storage", + "fullName": "google.storage.v2.Storage" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage.create_bucket.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.create_bucket.js new file mode 100644 index 00000000000..73e48fc6653 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.create_bucket.js @@ -0,0 +1,96 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, bucketId) { + // [START storage_v2_generated_Storage_CreateBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 to which this bucket belongs. This field must either + * be empty or `projects/_`. The project ID that owns this bucket should be + * specified in the `bucket.project` field. + */ + // const parent = 'abc123' + /** + * Optional. Properties of the new bucket being inserted. + * The name of the bucket is specified in the `bucket_id` field. Populating + * `bucket.name` field results in an error. + * The project of the bucket must be specified in the `bucket.project` field. + * This field must be in `projects/{projectIdentifier}` format, + * {projectIdentifier} can be the project ID or project number. The `parent` + * field must be either empty or `projects/_`. + */ + // const bucket = {} + /** + * Required. The ID to use for this bucket, which becomes the final component + * of the bucket's resource name. For example, the value `foo` might result in + * a bucket with the name `projects/123456/buckets/foo`. + */ + // const bucketId = 'abc123' + /** + * Optional. Apply a predefined set of access controls to this bucket. + * Valid values are `authenticatedRead`, `private`, `projectPrivate`, + * `publicRead`, or `publicReadWrite`. + */ + // const predefinedAcl = 'abc123' + /** + * Optional. Apply a predefined set of default object access controls to this + * bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + * `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + */ + // const predefinedDefaultObjectAcl = 'abc123' + /** + * Optional. If true, enable object retention on the bucket. + */ + // const enableObjectRetention = true + + // Imports the Storage library + const {StorageClient} = require('@google-cloud/storage').v2; + + // Instantiates a client + const storageClient = new StorageClient(); + + async function callCreateBucket() { + // Construct request + const request = { + parent, + bucketId, + }; + + // Run request + const response = await storageClient.createBucket(request); + console.log(response); + } + + callCreateBucket(); + // [END storage_v2_generated_Storage_CreateBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage.delete_bucket.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.delete_bucket.js new file mode 100644 index 00000000000..838c24980eb --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.delete_bucket.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_Storage_DeleteBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 a bucket to delete. + */ + // const name = 'abc123' + /** + * If set, only deletes the bucket if its metageneration matches this value. + */ + // const ifMetagenerationMatch = 1234 + /** + * If set, only deletes the bucket if its metageneration does not match this + * value. + */ + // const ifMetagenerationNotMatch = 1234 + + // Imports the Storage library + const {StorageClient} = require('@google-cloud/storage').v2; + + // Instantiates a client + const storageClient = new StorageClient(); + + async function callDeleteBucket() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storageClient.deleteBucket(request); + console.log(response); + } + + callDeleteBucket(); + // [END storage_v2_generated_Storage_DeleteBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage.get_bucket.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.get_bucket.js new file mode 100644 index 00000000000..ecf1fd3e421 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.get_bucket.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_Storage_GetBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 a bucket. + */ + // const name = 'abc123' + /** + * If set, only gets the bucket metadata if its metageneration matches this + * value. + */ + // const ifMetagenerationMatch = 1234 + /** + * If set, and if the bucket's current metageneration matches the specified + * value, the request returns an error. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Mask specifying which fields to read. + * A `*` field might be used to indicate all fields. + * If no mask is specified, it defaults to all fields. + */ + // const readMask = {} + + // Imports the Storage library + const {StorageClient} = require('@google-cloud/storage').v2; + + // Instantiates a client + const storageClient = new StorageClient(); + + async function callGetBucket() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storageClient.getBucket(request); + console.log(response); + } + + callGetBucket(); + // [END storage_v2_generated_Storage_GetBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage.list_buckets.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.list_buckets.js new file mode 100644 index 00000000000..bba5a711a3d --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.list_buckets.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_Storage_ListBuckets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 whose buckets we are listing. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of buckets to return in a single response. The + * service uses this parameter or `1,000` items, whichever is smaller. If + * `acl` is present in the `read_mask`, the service uses this parameter of + * `200` items, whichever is smaller. + */ + // const pageSize = 1234 + /** + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter results to buckets whose names begin with this prefix. + */ + // const prefix = 'abc123' + /** + * Mask specifying which fields to read from each result. + * If no mask is specified, it defaults to all fields except `items. + * owner`, `items.acl`, and `items.default_object_acl`. + * `*` might be used to mean "all fields". + */ + // const readMask = {} + /** + * Optional. Allows listing of buckets, even if there are buckets that are + * unreachable. + */ + // const returnPartialSuccess = true + + // Imports the Storage library + const {StorageClient} = require('@google-cloud/storage').v2; + + // Instantiates a client + const storageClient = new StorageClient(); + + async function callListBuckets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = storageClient.listBucketsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBuckets(); + // [END storage_v2_generated_Storage_ListBuckets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage.lock_bucket_retention_policy.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.lock_bucket_retention_policy.js new file mode 100644 index 00000000000..e79cec742b0 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.lock_bucket_retention_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(bucket, ifMetagenerationMatch) { + // [START storage_v2_generated_Storage_LockBucketRetentionPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 a bucket. + */ + // const bucket = 'abc123' + /** + * Required. Makes the operation conditional on whether bucket's current + * metageneration matches the given value. Must be positive. + */ + // const ifMetagenerationMatch = 1234 + + // Imports the Storage library + const {StorageClient} = require('@google-cloud/storage').v2; + + // Instantiates a client + const storageClient = new StorageClient(); + + async function callLockBucketRetentionPolicy() { + // Construct request + const request = { + bucket, + ifMetagenerationMatch, + }; + + // Run request + const response = await storageClient.lockBucketRetentionPolicy(request); + console.log(response); + } + + callLockBucketRetentionPolicy(); + // [END storage_v2_generated_Storage_LockBucketRetentionPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage.update_bucket.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.update_bucket.js new file mode 100644 index 00000000000..61b98b39ed6 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage.update_bucket.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(bucket, updateMask) { + // [START storage_v2_generated_Storage_UpdateBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The bucket to update. + * The bucket's `name` field is used to identify the bucket. + */ + // const bucket = {} + /** + * If set, the request modifies the bucket if its metageneration matches this + * value. + */ + // const ifMetagenerationMatch = 1234 + /** + * If set, the request modifies the bucket if its metageneration doesn't + * match this value. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Optional. Apply a predefined set of access controls to this bucket. + * Valid values are `authenticatedRead`, `private`, `projectPrivate`, + * `publicRead`, or `publicReadWrite`. + */ + // const predefinedAcl = 'abc123' + /** + * Optional. Apply a predefined set of default object access controls to this + * bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + * `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + */ + // const predefinedDefaultObjectAcl = 'abc123' + /** + * Required. List of fields to be updated. + * To specify ALL fields, equivalent to the JSON API's "update" function, + * specify a single field with the value `*`. Note: not recommended. If a new + * field is introduced at a later time, an older client updating with the `*` + * might accidentally reset the new field's value. + * Not specifying any fields is an error. + */ + // const updateMask = {} + + // Imports the Storage library + const {StorageClient} = require('@google-cloud/storage').v2; + + // Instantiates a client + const storageClient = new StorageClient(); + + async function callUpdateBucket() { + // Construct request + const request = { + bucket, + updateMask, + }; + + // Run request + const response = await storageClient.updateBucket(request); + console.log(response); + } + + callUpdateBucket(); + // [END storage_v2_generated_Storage_UpdateBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_anywhere_cache.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_anywhere_cache.js new file mode 100644 index 00000000000..0562cf6ff7e --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_anywhere_cache.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, anywhereCache) { + // [START storage_v2_generated_StorageControl_CreateAnywhereCache_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The bucket to which this cache belongs. + * Format: `projects/{project}/buckets/{bucket}` + */ + // const parent = 'abc123' + /** + * Required. Properties of the Anywhere Cache instance being created. + * The parent bucket name is specified in the `parent` field. Server uses the + * default value of `ttl` or `admission_policy` if not specified in + * request. + */ + // const anywhereCache = {} + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callCreateAnywhereCache() { + // Construct request + const request = { + parent, + anywhereCache, + }; + + // Run request + const [operation] = await controlClient.createAnywhereCache(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAnywhereCache(); + // [END storage_v2_generated_StorageControl_CreateAnywhereCache_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_folder.js new file mode 100644 index 00000000000..a6c34e33488 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_folder.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, folder, folderId) { + // [START storage_v2_generated_StorageControl_CreateFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 bucket in which the folder will reside. The bucket + * must be a hierarchical namespace enabled bucket. + */ + // const parent = 'abc123' + /** + * Required. Properties of the new folder being created. + * The bucket and name of the folder are specified in the parent and folder_id + * fields, respectively. Populating those fields in `folder` will result in an + * error. + */ + // const folder = {} + /** + * Required. The full name of a folder, including all its parent folders. + * Folders use single '/' characters as a delimiter. + * The folder_id must end with a slash. + * For example, the folder_id of "books/biographies/" would create a new + * "biographies/" folder under the "books/" folder. + */ + // const folderId = 'abc123' + /** + * Optional. If true, parent folder doesn't have to be present and all missing + * ancestor folders will be created atomically. + */ + // const recursive = true + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callCreateFolder() { + // Construct request + const request = { + parent, + folder, + folderId, + }; + + // Run request + const response = await controlClient.createFolder(request); + console.log(response); + } + + callCreateFolder(); + // [END storage_v2_generated_StorageControl_CreateFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_managed_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_managed_folder.js new file mode 100644 index 00000000000..a84de8ad38e --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.create_managed_folder.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, managedFolder, managedFolderId) { + // [START storage_v2_generated_StorageControl_CreateManagedFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 bucket this managed folder belongs to. + */ + // const parent = 'abc123' + /** + * Required. Properties of the managed folder being created. + * The bucket and managed folder names are specified in the `parent` and + * `managed_folder_id` fields. Populating these fields in `managed_folder` + * will result in an error. + */ + // const managedFolder = {} + /** + * Required. The name of the managed folder. It uses a single `/` as delimiter + * and leading and trailing `/` are allowed. + */ + // const managedFolderId = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callCreateManagedFolder() { + // Construct request + const request = { + parent, + managedFolder, + managedFolderId, + }; + + // Run request + const response = await controlClient.createManagedFolder(request); + console.log(response); + } + + callCreateManagedFolder(); + // [END storage_v2_generated_StorageControl_CreateManagedFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder.js new file mode 100644 index 00000000000..8e6b2474858 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_DeleteFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 folder. + * Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + */ + // const name = 'abc123' + /** + * Makes the operation only succeed conditional on whether the folder's + * current metageneration matches the given value. + */ + // const ifMetagenerationMatch = 1234 + /** + * Makes the operation only succeed conditional on whether the folder's + * current metageneration does not match the given value. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callDeleteFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.deleteFolder(request); + console.log(response); + } + + callDeleteFolder(); + // [END storage_v2_generated_StorageControl_DeleteFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder_recursive.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder_recursive.js new file mode 100644 index 00000000000..5c88cdf4f3b --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_folder_recursive.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_DeleteFolderRecursive_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 folder being deleted, however all of its contents + * will be deleted too. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + */ + // const name = 'abc123' + /** + * Optional. Makes the operation only succeed conditional on whether the root + * folder's current metageneration matches the given value. + */ + // const ifMetagenerationMatch = 1234 + /** + * Optional. Makes the operation only succeed conditional on whether the root + * folder's current metageneration does not match the given value. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callDeleteFolderRecursive() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await controlClient.deleteFolderRecursive(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteFolderRecursive(); + // [END storage_v2_generated_StorageControl_DeleteFolderRecursive_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_managed_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_managed_folder.js new file mode 100644 index 00000000000..3e79982f780 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.delete_managed_folder.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_DeleteManagedFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 managed folder. + * Format: + * `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + */ + // const name = 'abc123' + /** + * The operation succeeds conditional on the managed folder's current + * metageneration matching the value here specified. + */ + // const ifMetagenerationMatch = 1234 + /** + * The operation succeeds conditional on the managed folder's current + * metageneration NOT matching the value here specified. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Allows deletion of a managed folder even if it is not empty. + * A managed folder is empty if it manages no child managed folders or + * objects. Caller must have permission for + * storage.managedFolders.setIamPolicy. + */ + // const allowNonEmpty = true + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callDeleteManagedFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.deleteManagedFolder(request); + console.log(response); + } + + callDeleteManagedFolder(); + // [END storage_v2_generated_StorageControl_DeleteManagedFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.disable_anywhere_cache.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.disable_anywhere_cache.js new file mode 100644 index 00000000000..06d586ce5d0 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.disable_anywhere_cache.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_DisableAnywhereCache_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callDisableAnywhereCache() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.disableAnywhereCache(request); + console.log(response); + } + + callDisableAnywhereCache(); + // [END storage_v2_generated_StorageControl_DisableAnywhereCache_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_anywhere_cache.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_anywhere_cache.js new file mode 100644 index 00000000000..68753db4acb --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_anywhere_cache.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetAnywhereCache_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetAnywhereCache() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getAnywhereCache(request); + console.log(response); + } + + callGetAnywhereCache(); + // [END storage_v2_generated_StorageControl_GetAnywhereCache_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder.js new file mode 100644 index 00000000000..aab29a27a27 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 folder. + * Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + */ + // const name = 'abc123' + /** + * Makes the operation only succeed conditional on whether the folder's + * current metageneration matches the given value. + */ + // const ifMetagenerationMatch = 1234 + /** + * Makes the operation only succeed conditional on whether the folder's + * current metageneration does not match the given value. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getFolder(request); + console.log(response); + } + + callGetFolder(); + // [END storage_v2_generated_StorageControl_GetFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder_intelligence_config.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder_intelligence_config.js new file mode 100644 index 00000000000..799c5c11942 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_folder_intelligence_config.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 `IntelligenceConfig` resource associated with + * your folder. + * Format: `folders/{id}/locations/global/intelligenceConfig` + */ + // const name = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetFolderIntelligenceConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getFolderIntelligenceConfig(request); + console.log(response); + } + + callGetFolderIntelligenceConfig(); + // [END storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_iam_policy.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_iam_policy.js new file mode 100644 index 00000000000..86e1b6a708e --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START storage_v2_generated_StorageControl_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await controlClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END storage_v2_generated_StorageControl_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_managed_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_managed_folder.js new file mode 100644 index 00000000000..f47c61d12fd --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_managed_folder.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetManagedFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 managed folder. + * Format: + * `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + */ + // const name = 'abc123' + /** + * The operation succeeds conditional on the managed folder's current + * metageneration matching the value here specified. + */ + // const ifMetagenerationMatch = 1234 + /** + * The operation succeeds conditional on the managed folder's current + * metageneration NOT matching the value here specified. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetManagedFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getManagedFolder(request); + console.log(response); + } + + callGetManagedFolder(); + // [END storage_v2_generated_StorageControl_GetManagedFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_organization_intelligence_config.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_organization_intelligence_config.js new file mode 100644 index 00000000000..c4b65e7f83a --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_organization_intelligence_config.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 `IntelligenceConfig` resource associated with + * your organization. + * Format: `organizations/{org_id}/locations/global/intelligenceConfig` + */ + // const name = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetOrganizationIntelligenceConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getOrganizationIntelligenceConfig(request); + console.log(response); + } + + callGetOrganizationIntelligenceConfig(); + // [END storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_project_intelligence_config.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_project_intelligence_config.js new file mode 100644 index 00000000000..fa15b9a36f1 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_project_intelligence_config.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 `IntelligenceConfig` resource associated with + * your project. + * Format: `projects/{id}/locations/global/intelligenceConfig` + */ + // const name = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetProjectIntelligenceConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getProjectIntelligenceConfig(request); + console.log(response); + } + + callGetProjectIntelligenceConfig(); + // [END storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_storage_layout.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_storage_layout.js new file mode 100644 index 00000000000..846325e16bb --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.get_storage_layout.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_GetStorageLayout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 StorageLayout resource. + * Format: `projects/{project}/buckets/{bucket}/storageLayout` + */ + // const name = 'abc123' + /** + * An optional prefix used for permission check. It is useful when the caller + * only has limited permissions under a specific prefix. + */ + // const prefix = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callGetStorageLayout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.getStorageLayout(request); + console.log(response); + } + + callGetStorageLayout(); + // [END storage_v2_generated_StorageControl_GetStorageLayout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_anywhere_caches.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_anywhere_caches.js new file mode 100644 index 00000000000..ad4ea0921ff --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_anywhere_caches.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_ListAnywhereCaches_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The bucket to which this cache belongs. + */ + // const parent = 'abc123' + /** + * Maximum number of caches to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + */ + // const pageSize = 1234 + /** + * A previously-returned page token representing part of the larger set of + * results to view. + */ + // const pageToken = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callListAnywhereCaches() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = controlClient.listAnywhereCachesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAnywhereCaches(); + // [END storage_v2_generated_StorageControl_ListAnywhereCaches_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_folders.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_folders.js new file mode 100644 index 00000000000..3db340ad77b --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_folders.js @@ -0,0 +1,104 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_ListFolders_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 bucket in which to look for folders. The bucket must + * be a hierarchical namespace enabled bucket. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of folders to return in a single response. The + * service will use this parameter or 1,000 items, whichever is smaller. + */ + // const pageSize = 1234 + /** + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter results to folders whose names begin with this prefix. + * If set, the value must either be an empty string or end with a '/'. + */ + // const prefix = 'abc123' + /** + * Optional. If set, returns results in a directory-like mode. The results + * will only include folders that either exactly match the above prefix, or + * are one level below the prefix. The only supported value is '/'. + */ + // const delimiter = 'abc123' + /** + * Optional. Filter results to folders whose names are lexicographically equal + * to or after lexicographic_start. If lexicographic_end is also set, the + * folders listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + */ + // const lexicographicStart = 'abc123' + /** + * Optional. Filter results to folders whose names are lexicographically + * before lexicographic_end. If lexicographic_start is also set, the folders + * listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + */ + // const lexicographicEnd = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callListFolders() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = controlClient.listFoldersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFolders(); + // [END storage_v2_generated_StorageControl_ListFolders_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_managed_folders.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_managed_folders.js new file mode 100644 index 00000000000..efe861b4922 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.list_managed_folders.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_ListManagedFolders_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 bucket this managed folder belongs to. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of managed folders to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + */ + // const pageSize = 1234 + /** + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter results to match managed folders with name starting with + * this prefix. + */ + // const prefix = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callListManagedFolders() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = controlClient.listManagedFoldersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListManagedFolders(); + // [END storage_v2_generated_StorageControl_ListManagedFolders_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.pause_anywhere_cache.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.pause_anywhere_cache.js new file mode 100644 index 00000000000..fe31e762db0 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.pause_anywhere_cache.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_PauseAnywhereCache_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callPauseAnywhereCache() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.pauseAnywhereCache(request); + console.log(response); + } + + callPauseAnywhereCache(); + // [END storage_v2_generated_StorageControl_PauseAnywhereCache_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.rename_folder.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.rename_folder.js new file mode 100644 index 00000000000..6dd7c95390a --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.rename_folder.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, destinationFolderId) { + // [START storage_v2_generated_StorageControl_RenameFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 source folder being renamed. + * Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + */ + // const name = 'abc123' + /** + * Required. The destination folder ID, e.g. `foo/bar/`. + */ + // const destinationFolderId = 'abc123' + /** + * Makes the operation only succeed conditional on whether the source + * folder's current metageneration matches the given value. + */ + // const ifMetagenerationMatch = 1234 + /** + * Makes the operation only succeed conditional on whether the source + * folder's current metageneration does not match the given value. + */ + // const ifMetagenerationNotMatch = 1234 + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callRenameFolder() { + // Construct request + const request = { + name, + destinationFolderId, + }; + + // Run request + const [operation] = await controlClient.renameFolder(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRenameFolder(); + // [END storage_v2_generated_StorageControl_RenameFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.resume_anywhere_cache.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.resume_anywhere_cache.js new file mode 100644 index 00000000000..88cc6e8e654 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.resume_anywhere_cache.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 storage_v2_generated_StorageControl_ResumeAnywhereCache_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callResumeAnywhereCache() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await controlClient.resumeAnywhereCache(request); + console.log(response); + } + + callResumeAnywhereCache(); + // [END storage_v2_generated_StorageControl_ResumeAnywhereCache_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.set_iam_policy.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.set_iam_policy.js new file mode 100644 index 00000000000..ebcafb70887 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START storage_v2_generated_StorageControl_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await controlClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END storage_v2_generated_StorageControl_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.test_iam_permissions.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.test_iam_permissions.js new file mode 100644 index 00000000000..54874010702 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START storage_v2_generated_StorageControl_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * 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). + */ + // const permissions = ['abc','def'] + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await controlClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END storage_v2_generated_StorageControl_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_anywhere_cache.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_anywhere_cache.js new file mode 100644 index 00000000000..f73ad04612d --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_anywhere_cache.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(anywhereCache, updateMask) { + // [START storage_v2_generated_StorageControl_UpdateAnywhereCache_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Anywhere Cache instance to be updated. + */ + // const anywhereCache = {} + /** + * Required. List of fields to be updated. Mutable fields of AnywhereCache + * include `ttl` and `admission_policy`. + * To specify ALL fields, specify a single field with the value `*`. Note: We + * recommend against doing this. If a new field is introduced at a later time, + * an older client updating with the `*` may accidentally reset the new + * field's value. + * Not specifying any fields is an error. + */ + // const updateMask = {} + /** + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callUpdateAnywhereCache() { + // Construct request + const request = { + anywhereCache, + updateMask, + }; + + // Run request + const [operation] = await controlClient.updateAnywhereCache(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAnywhereCache(); + // [END storage_v2_generated_StorageControl_UpdateAnywhereCache_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_folder_intelligence_config.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_folder_intelligence_config.js new file mode 100644 index 00000000000..7957618966f --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_folder_intelligence_config.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(intelligenceConfig, updateMask) { + // [START storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `IntelligenceConfig` resource to be updated. + */ + // const intelligenceConfig = {} + /** + * Required. The `update_mask` that specifies the fields within the + * `IntelligenceConfig` resource that should be modified by this update. Only + * the listed fields are updated. + */ + // const updateMask = {} + /** + * Optional. The ID that uniquely identifies the request, preventing duplicate + * processing. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callUpdateFolderIntelligenceConfig() { + // Construct request + const request = { + intelligenceConfig, + updateMask, + }; + + // Run request + const response = await controlClient.updateFolderIntelligenceConfig(request); + console.log(response); + } + + callUpdateFolderIntelligenceConfig(); + // [END storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_organization_intelligence_config.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_organization_intelligence_config.js new file mode 100644 index 00000000000..8875826fb05 --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_organization_intelligence_config.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(intelligenceConfig, updateMask) { + // [START storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `IntelligenceConfig` resource to be updated. + */ + // const intelligenceConfig = {} + /** + * Required. The `update_mask` that specifies the fields within the + * `IntelligenceConfig` resource that should be modified by this update. Only + * the listed fields are updated. + */ + // const updateMask = {} + /** + * Optional. The ID that uniquely identifies the request, preventing duplicate + * processing. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callUpdateOrganizationIntelligenceConfig() { + // Construct request + const request = { + intelligenceConfig, + updateMask, + }; + + // Run request + const response = await controlClient.updateOrganizationIntelligenceConfig(request); + console.log(response); + } + + callUpdateOrganizationIntelligenceConfig(); + // [END storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_project_intelligence_config.js b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_project_intelligence_config.js new file mode 100644 index 00000000000..ede7fa6947b --- /dev/null +++ b/owl-bot-staging/google-storage-control/samples/generated/v2/storage_control.update_project_intelligence_config.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(intelligenceConfig, updateMask) { + // [START storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `IntelligenceConfig` resource to be updated. + */ + // const intelligenceConfig = {} + /** + * Required. The `update_mask` that specifies the fields within the + * `IntelligenceConfig` resource that should be modified by this update. Only + * the listed fields are updated. + */ + // const updateMask = {} + /** + * Optional. The ID that uniquely identifies the request, preventing duplicate + * processing. + */ + // const requestId = 'abc123' + + // Imports the Control library + const {StorageControlClient} = require('@google-cloud/storage-control').v2; + + // Instantiates a client + const controlClient = new StorageControlClient(); + + async function callUpdateProjectIntelligenceConfig() { + // Construct request + const request = { + intelligenceConfig, + updateMask, + }; + + // Run request + const response = await controlClient.updateProjectIntelligenceConfig(request); + console.log(response); + } + + callUpdateProjectIntelligenceConfig(); + // [END storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storage-control/src/index.ts b/owl-bot-staging/google-storage-control/src/index.ts new file mode 100644 index 00000000000..5f8e09620a2 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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'; +import * as v2 from './v2'; + +const StorageControlClient = v2.StorageControlClient; +type StorageControlClient = v2.StorageControlClient; + +export {v2, v2, StorageControlClient}; +export default {v2, v2, StorageControlClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-storage-control/src/v2/gapic_metadata.json b/owl-bot-staging/google-storage-control/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..89a81d3b623 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/gapic_metadata.json @@ -0,0 +1,305 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.storage.control.v2", + "libraryPackage": "@google-cloud/storage-control", + "services": { + "StorageControl": { + "clients": { + "grpc": { + "libraryClient": "StorageControlClient", + "rpcs": { + "CreateFolder": { + "methods": [ + "createFolder" + ] + }, + "DeleteFolder": { + "methods": [ + "deleteFolder" + ] + }, + "GetFolder": { + "methods": [ + "getFolder" + ] + }, + "GetStorageLayout": { + "methods": [ + "getStorageLayout" + ] + }, + "CreateManagedFolder": { + "methods": [ + "createManagedFolder" + ] + }, + "DeleteManagedFolder": { + "methods": [ + "deleteManagedFolder" + ] + }, + "GetManagedFolder": { + "methods": [ + "getManagedFolder" + ] + }, + "DisableAnywhereCache": { + "methods": [ + "disableAnywhereCache" + ] + }, + "PauseAnywhereCache": { + "methods": [ + "pauseAnywhereCache" + ] + }, + "ResumeAnywhereCache": { + "methods": [ + "resumeAnywhereCache" + ] + }, + "GetAnywhereCache": { + "methods": [ + "getAnywhereCache" + ] + }, + "GetProjectIntelligenceConfig": { + "methods": [ + "getProjectIntelligenceConfig" + ] + }, + "UpdateProjectIntelligenceConfig": { + "methods": [ + "updateProjectIntelligenceConfig" + ] + }, + "GetFolderIntelligenceConfig": { + "methods": [ + "getFolderIntelligenceConfig" + ] + }, + "UpdateFolderIntelligenceConfig": { + "methods": [ + "updateFolderIntelligenceConfig" + ] + }, + "GetOrganizationIntelligenceConfig": { + "methods": [ + "getOrganizationIntelligenceConfig" + ] + }, + "UpdateOrganizationIntelligenceConfig": { + "methods": [ + "updateOrganizationIntelligenceConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "RenameFolder": { + "methods": [ + "renameFolder" + ] + }, + "DeleteFolderRecursive": { + "methods": [ + "deleteFolderRecursive" + ] + }, + "CreateAnywhereCache": { + "methods": [ + "createAnywhereCache" + ] + }, + "UpdateAnywhereCache": { + "methods": [ + "updateAnywhereCache" + ] + }, + "ListFolders": { + "methods": [ + "listFolders", + "listFoldersStream", + "listFoldersAsync" + ] + }, + "ListManagedFolders": { + "methods": [ + "listManagedFolders", + "listManagedFoldersStream", + "listManagedFoldersAsync" + ] + }, + "ListAnywhereCaches": { + "methods": [ + "listAnywhereCaches", + "listAnywhereCachesStream", + "listAnywhereCachesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "StorageControlClient", + "rpcs": { + "CreateFolder": { + "methods": [ + "createFolder" + ] + }, + "DeleteFolder": { + "methods": [ + "deleteFolder" + ] + }, + "GetFolder": { + "methods": [ + "getFolder" + ] + }, + "GetStorageLayout": { + "methods": [ + "getStorageLayout" + ] + }, + "CreateManagedFolder": { + "methods": [ + "createManagedFolder" + ] + }, + "DeleteManagedFolder": { + "methods": [ + "deleteManagedFolder" + ] + }, + "GetManagedFolder": { + "methods": [ + "getManagedFolder" + ] + }, + "DisableAnywhereCache": { + "methods": [ + "disableAnywhereCache" + ] + }, + "PauseAnywhereCache": { + "methods": [ + "pauseAnywhereCache" + ] + }, + "ResumeAnywhereCache": { + "methods": [ + "resumeAnywhereCache" + ] + }, + "GetAnywhereCache": { + "methods": [ + "getAnywhereCache" + ] + }, + "GetProjectIntelligenceConfig": { + "methods": [ + "getProjectIntelligenceConfig" + ] + }, + "UpdateProjectIntelligenceConfig": { + "methods": [ + "updateProjectIntelligenceConfig" + ] + }, + "GetFolderIntelligenceConfig": { + "methods": [ + "getFolderIntelligenceConfig" + ] + }, + "UpdateFolderIntelligenceConfig": { + "methods": [ + "updateFolderIntelligenceConfig" + ] + }, + "GetOrganizationIntelligenceConfig": { + "methods": [ + "getOrganizationIntelligenceConfig" + ] + }, + "UpdateOrganizationIntelligenceConfig": { + "methods": [ + "updateOrganizationIntelligenceConfig" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "RenameFolder": { + "methods": [ + "renameFolder" + ] + }, + "DeleteFolderRecursive": { + "methods": [ + "deleteFolderRecursive" + ] + }, + "CreateAnywhereCache": { + "methods": [ + "createAnywhereCache" + ] + }, + "UpdateAnywhereCache": { + "methods": [ + "updateAnywhereCache" + ] + }, + "ListFolders": { + "methods": [ + "listFolders", + "listFoldersStream", + "listFoldersAsync" + ] + }, + "ListManagedFolders": { + "methods": [ + "listManagedFolders", + "listManagedFoldersStream", + "listManagedFoldersAsync" + ] + }, + "ListAnywhereCaches": { + "methods": [ + "listAnywhereCaches", + "listAnywhereCachesStream", + "listAnywhereCachesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-storage-control/src/v2/index.ts b/owl-bot-staging/google-storage-control/src/v2/index.ts new file mode 100644 index 00000000000..74c2472e7eb --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {StorageControlClient} from './storage_control_client'; diff --git a/owl-bot-staging/google-storage-control/src/v2/storage_client.ts b/owl-bot-staging/google-storage-control/src/v2/storage_client.ts new file mode 100644 index 00000000000..418ae232a59 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/storage_client.ts @@ -0,0 +1,1466 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/storage_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './storage_client_config.json'; +const version = require('../../../package.json').version; + +/** + * ## API Overview and Naming Syntax + * + * The Cloud Storage gRPC API allows applications to read and write data through + * the abstractions of buckets and objects. For a description of these + * abstractions please see [Cloud Storage + * documentation](https://cloud.google.com/storage/docs). + * + * Resources are named as follows: + * + * - Projects are referred to as they are defined by the Resource Manager API, + * using strings like `projects/123456` or `projects/my-string-id`. + * - Buckets are named using string names of the form: + * `projects/{project}/buckets/{bucket}`. + * For globally unique buckets, `_` might be substituted for the project. + * - Objects are uniquely identified by their name along with the name of the + * bucket they belong to, as separate strings in this API. For example: + * + * ``` + * ReadObjectRequest { + * bucket: 'projects/_/buckets/my-bucket' + * object: 'my-object' + * } + * ``` + * + * Note that object names can contain `/` characters, which are treated as + * any other character (no special directory semantics). + * @class + * @memberof v2 + */ +export class StorageClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('storage'); + + 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}; + storageStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of StorageClient. + * + * @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://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new StorageClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof StorageClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'storage.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + bucketPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/buckets/{bucket}' + ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listBuckets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'buckets') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.storage.v2.Storage', 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.storageStub) { + return this.storageStub; + } + + // Put together the "service stub" for + // google.storage.v2.Storage. + this.storageStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.storage.v2.Storage') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.storage.v2.Storage, + 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 storageStubMethods = + ['deleteBucket', 'getBucket', 'createBucket', 'listBuckets', 'lockBucketRetentionPolicy', 'updateBucket']; + for (const methodName of storageStubMethods) { + const callPromise = this.storageStub.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.storageStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'storage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'storage.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/devstorage.full_control', + 'https://www.googleapis.com/auth/devstorage.read_only', + 'https://www.googleapis.com/auth/devstorage.read_write' + ]; + } + + 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 -- + // ------------------- +/** + * Permanently deletes an empty bucket. + * The request fails if there are any live or + * noncurrent objects in the bucket, but the request succeeds if the + * bucket only contains soft-deleted objects or incomplete uploads, such + * as ongoing XML API multipart uploads. Does not permanently delete + * soft-deleted objects. + * + * When this API is used to delete a bucket containing an object that has a + * soft delete policy + * enabled, the object becomes soft deleted, and the + * `softDeleteTime` and `hardDeleteTime` properties are set on the + * object. + * + * Objects and multipart uploads that were in the bucket at the time of + * deletion are also retained for the specified retention duration. When + * a soft-deleted bucket reaches the end of its retention duration, it + * is permanently deleted. The `hardDeleteTime` of the bucket always + * equals + * or exceeds the expiration time of the last soft-deleted object in the + * bucket. + * + * **IAM Permissions**: + * + * Requires `storage.buckets.delete` IAM permission on the bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of a bucket to delete. + * @param {number} request.ifMetagenerationMatch + * If set, only deletes the bucket if its metageneration matches this value. + * @param {number} request.ifMetagenerationNotMatch + * If set, only deletes the bucket if its metageneration does not match this + * value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage.delete_bucket.js + * region_tag:storage_v2_generated_Storage_DeleteBucket_async + */ + deleteBucket( + request?: protos.google.storage.v2.IDeleteBucketRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|undefined, {}|undefined + ]>; + deleteBucket( + request: protos.google.storage.v2.IDeleteBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|null|undefined, + {}|null|undefined>): void; + deleteBucket( + request: protos.google.storage.v2.IDeleteBucketRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|null|undefined, + {}|null|undefined>): void; + deleteBucket( + request?: protos.google.storage.v2.IDeleteBucketRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('deleteBucket request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteBucket(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.storage.v2.IDeleteBucketRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteBucket response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns metadata for the specified bucket. + * + * **IAM Permissions**: + * + * Requires `storage.buckets.get` + * IAM permission on + * the bucket. Additionally, to return specific bucket metadata, the + * authenticated user must have the following permissions: + * + * - To return the IAM policies: `storage.buckets.getIamPolicy` + * - To return the bucket IP filtering rules: `storage.buckets.getIpFilter` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of a bucket. + * @param {number} request.ifMetagenerationMatch + * If set, only gets the bucket metadata if its metageneration matches this + * value. + * @param {number} request.ifMetagenerationNotMatch + * If set, and if the bucket's current metageneration matches the specified + * value, the request returns an error. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * A `*` field might be used to indicate all fields. + * If no mask is specified, it defaults to all fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage.get_bucket.js + * region_tag:storage_v2_generated_Storage_GetBucket_async + */ + getBucket( + request?: protos.google.storage.v2.IGetBucketRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|undefined, {}|undefined + ]>; + getBucket( + request: protos.google.storage.v2.IGetBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|null|undefined, + {}|null|undefined>): void; + getBucket( + request: protos.google.storage.v2.IGetBucketRequest, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|null|undefined, + {}|null|undefined>): void; + getBucket( + request?: protos.google.storage.v2.IGetBucketRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getBucket request %j', request); + const wrappedCallback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBucket(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IGetBucketRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBucket response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new bucket. + * + * **IAM Permissions**: + * + * Requires `storage.buckets.create` IAM permission on the bucket. + * Additionally, to enable specific bucket features, the authenticated user + * must have the following permissions: + * + * - To enable object retention using the `enableObjectRetention` query + * parameter: `storage.buckets.enableObjectRetention` + * - To set the bucket IP filtering rules: `storage.buckets.setIpFilter` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to which this bucket belongs. This field must either + * be empty or `projects/_`. The project ID that owns this bucket should be + * specified in the `bucket.project` field. + * @param {google.storage.v2.Bucket} [request.bucket] + * Optional. Properties of the new bucket being inserted. + * The name of the bucket is specified in the `bucket_id` field. Populating + * `bucket.name` field results in an error. + * The project of the bucket must be specified in the `bucket.project` field. + * This field must be in `projects/{projectIdentifier}` format, + * {projectIdentifier} can be the project ID or project number. The `parent` + * field must be either empty or `projects/_`. + * @param {string} request.bucketId + * Required. The ID to use for this bucket, which becomes the final component + * of the bucket's resource name. For example, the value `foo` might result in + * a bucket with the name `projects/123456/buckets/foo`. + * @param {string} [request.predefinedAcl] + * Optional. Apply a predefined set of access controls to this bucket. + * Valid values are `authenticatedRead`, `private`, `projectPrivate`, + * `publicRead`, or `publicReadWrite`. + * @param {string} [request.predefinedDefaultObjectAcl] + * Optional. Apply a predefined set of default object access controls to this + * bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + * `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + * @param {boolean} [request.enableObjectRetention] + * Optional. If true, enable object retention on the bucket. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage.create_bucket.js + * region_tag:storage_v2_generated_Storage_CreateBucket_async + */ + createBucket( + request?: protos.google.storage.v2.ICreateBucketRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|undefined, {}|undefined + ]>; + createBucket( + request: protos.google.storage.v2.ICreateBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|null|undefined, + {}|null|undefined>): void; + createBucket( + request: protos.google.storage.v2.ICreateBucketRequest, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|null|undefined, + {}|null|undefined>): void; + createBucket( + request?: protos.google.storage.v2.ICreateBucketRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['project'] ?? fieldValue; + Object.assign(routingParameter, { project: parameterValue }); + } + } + } + { + const fieldValue = request.bucket?.project; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['project'] ?? fieldValue; + Object.assign(routingParameter, { project: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('createBucket request %j', request); + const wrappedCallback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createBucket(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ICreateBucketRequest|undefined, + {}|undefined + ]) => { + this._log.info('createBucket response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Permanently locks the retention + * policy that is + * currently applied to the specified bucket. + * + * Caution: Locking a bucket is an + * irreversible action. Once you lock a bucket: + * + * - You cannot remove the retention policy from the bucket. + * - You cannot decrease the retention period for the policy. + * + * Once locked, you must delete the entire bucket in order to remove the + * bucket's retention policy. However, before you can delete the bucket, you + * must delete all the objects in the bucket, which is only + * possible if all the objects have reached the retention period set by the + * retention policy. + * + * **IAM Permissions**: + * + * Requires `storage.buckets.update` IAM permission on the bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.bucket + * Required. Name of a bucket. + * @param {number} request.ifMetagenerationMatch + * Required. Makes the operation conditional on whether bucket's current + * metageneration matches the given value. Must be positive. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage.lock_bucket_retention_policy.js + * region_tag:storage_v2_generated_Storage_LockBucketRetentionPolicy_async + */ + lockBucketRetentionPolicy( + request?: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|undefined, {}|undefined + ]>; + lockBucketRetentionPolicy( + request: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|null|undefined, + {}|null|undefined>): void; + lockBucketRetentionPolicy( + request: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|null|undefined, + {}|null|undefined>): void; + lockBucketRetentionPolicy( + request?: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.bucket; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('lockBucketRetentionPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lockBucketRetentionPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.lockBucketRetentionPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.ILockBucketRetentionPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('lockBucketRetentionPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a bucket. Changes to the bucket are readable immediately after + * writing, but configuration changes might take time to propagate. This + * method supports `patch` semantics. + * + * **IAM Permissions**: + * + * Requires `storage.buckets.update` IAM permission on the bucket. + * Additionally, to enable specific bucket features, the authenticated user + * must have the following permissions: + * + * - To set bucket IP filtering rules: `storage.buckets.setIpFilter` + * - To update public access prevention policies or access control lists + * (ACLs): `storage.buckets.setIamPolicy` + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storage.v2.Bucket} request.bucket + * Required. The bucket to update. + * The bucket's `name` field is used to identify the bucket. + * @param {number} request.ifMetagenerationMatch + * If set, the request modifies the bucket if its metageneration matches this + * value. + * @param {number} request.ifMetagenerationNotMatch + * If set, the request modifies the bucket if its metageneration doesn't + * match this value. + * @param {string} [request.predefinedAcl] + * Optional. Apply a predefined set of access controls to this bucket. + * Valid values are `authenticatedRead`, `private`, `projectPrivate`, + * `publicRead`, or `publicReadWrite`. + * @param {string} [request.predefinedDefaultObjectAcl] + * Optional. Apply a predefined set of default object access controls to this + * bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + * `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. List of fields to be updated. + * + * To specify ALL fields, equivalent to the JSON API's "update" function, + * specify a single field with the value `*`. Note: not recommended. If a new + * field is introduced at a later time, an older client updating with the `*` + * might accidentally reset the new field's value. + * + * Not specifying any fields is an error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.v2.Bucket|Bucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage.update_bucket.js + * region_tag:storage_v2_generated_Storage_UpdateBucket_async + */ + updateBucket( + request?: protos.google.storage.v2.IUpdateBucketRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|undefined, {}|undefined + ]>; + updateBucket( + request: protos.google.storage.v2.IUpdateBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|null|undefined, + {}|null|undefined>): void; + updateBucket( + request: protos.google.storage.v2.IUpdateBucketRequest, + callback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|null|undefined, + {}|null|undefined>): void; + updateBucket( + request?: protos.google.storage.v2.IUpdateBucketRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.bucket?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('updateBucket request %j', request); + const wrappedCallback: Callback< + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateBucket(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.v2.IBucket, + protos.google.storage.v2.IUpdateBucketRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateBucket response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Retrieves a list of buckets for a given project, ordered + * lexicographically by name. + * + * **IAM Permissions**: + * + * Requires `storage.buckets.list` IAM permission on the bucket. + * Additionally, to enable specific bucket features, the authenticated + * user must have the following permissions: + * + * - To list the IAM policies: `storage.buckets.getIamPolicy` + * - To list the bucket IP filtering rules: `storage.buckets.getIpFilter` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project whose buckets we are listing. + * @param {number} [request.pageSize] + * Optional. Maximum number of buckets to return in a single response. The + * service uses this parameter or `1,000` items, whichever is smaller. If + * `acl` is present in the `read_mask`, the service uses this parameter of + * `200` items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to buckets whose names begin with this prefix. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read from each result. + * If no mask is specified, it defaults to all fields except `items. + * owner`, `items.acl`, and `items.default_object_acl`. + * `*` might be used to mean "all fields". + * @param {boolean} [request.returnPartialSuccess] + * Optional. Allows listing of buckets, even if there are buckets that are + * unreachable. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.storage.v2.Bucket|Bucket}. + * 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 `listBucketsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBuckets( + request?: protos.google.storage.v2.IListBucketsRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.v2.IBucket[], + protos.google.storage.v2.IListBucketsRequest|null, + protos.google.storage.v2.IListBucketsResponse + ]>; + listBuckets( + request: protos.google.storage.v2.IListBucketsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storage.v2.IListBucketsRequest, + protos.google.storage.v2.IListBucketsResponse|null|undefined, + protos.google.storage.v2.IBucket>): void; + listBuckets( + request: protos.google.storage.v2.IListBucketsRequest, + callback: PaginationCallback< + protos.google.storage.v2.IListBucketsRequest, + protos.google.storage.v2.IListBucketsResponse|null|undefined, + protos.google.storage.v2.IBucket>): void; + listBuckets( + request?: protos.google.storage.v2.IListBucketsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.storage.v2.IListBucketsRequest, + protos.google.storage.v2.IListBucketsResponse|null|undefined, + protos.google.storage.v2.IBucket>, + callback?: PaginationCallback< + protos.google.storage.v2.IListBucketsRequest, + protos.google.storage.v2.IListBucketsResponse|null|undefined, + protos.google.storage.v2.IBucket>): + Promise<[ + protos.google.storage.v2.IBucket[], + protos.google.storage.v2.IListBucketsRequest|null, + protos.google.storage.v2.IListBucketsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['project'] ?? fieldValue; + Object.assign(routingParameter, { project: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.storage.v2.IListBucketsRequest, + protos.google.storage.v2.IListBucketsResponse|null|undefined, + protos.google.storage.v2.IBucket>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBuckets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBuckets request %j', request); + return this.innerApiCalls + .listBuckets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.storage.v2.IBucket[], + protos.google.storage.v2.IListBucketsRequest|null, + protos.google.storage.v2.IListBucketsResponse + ]) => { + this._log.info('listBuckets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBuckets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project whose buckets we are listing. + * @param {number} [request.pageSize] + * Optional. Maximum number of buckets to return in a single response. The + * service uses this parameter or `1,000` items, whichever is smaller. If + * `acl` is present in the `read_mask`, the service uses this parameter of + * `200` items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to buckets whose names begin with this prefix. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read from each result. + * If no mask is specified, it defaults to all fields except `items. + * owner`, `items.acl`, and `items.default_object_acl`. + * `*` might be used to mean "all fields". + * @param {boolean} [request.returnPartialSuccess] + * Optional. Allows listing of buckets, even if there are buckets that are + * unreachable. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.storage.v2.Bucket|Bucket} 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 `listBucketsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBucketsStream( + request?: protos.google.storage.v2.IListBucketsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['project'] ?? fieldValue; + Object.assign(routingParameter, { project: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listBuckets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBuckets stream %j', request); + return this.descriptors.page.listBuckets.createStream( + this.innerApiCalls.listBuckets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBuckets`, 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 whose buckets we are listing. + * @param {number} [request.pageSize] + * Optional. Maximum number of buckets to return in a single response. The + * service uses this parameter or `1,000` items, whichever is smaller. If + * `acl` is present in the `read_mask`, the service uses this parameter of + * `200` items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to buckets whose names begin with this prefix. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read from each result. + * If no mask is specified, it defaults to all fields except `items. + * owner`, `items.acl`, and `items.default_object_acl`. + * `*` might be used to mean "all fields". + * @param {boolean} [request.returnPartialSuccess] + * Optional. Allows listing of buckets, even if there are buckets that are + * unreachable. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.storage.v2.Bucket|Bucket}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage.list_buckets.js + * region_tag:storage_v2_generated_Storage_ListBuckets_async + */ + listBucketsAsync( + request?: protos.google.storage.v2.IListBucketsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['project'] ?? fieldValue; + Object.assign(routingParameter, { project: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listBuckets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBuckets iterate %j', request); + return this.descriptors.page.listBuckets.asyncIterate( + this.innerApiCalls['listBuckets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified bucket resource name string. + * + * @param {string} project + * @param {string} bucket + * @returns {string} Resource name string. + */ + bucketPath(project:string,bucket:string) { + return this.pathTemplates.bucketPathTemplate.render({ + project: project, + bucket: bucket, + }); + } + + /** + * Parse the project from Bucket resource. + * + * @param {string} bucketName + * A fully-qualified path representing Bucket resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBucketName(bucketName: string) { + return this.pathTemplates.bucketPathTemplate.match(bucketName).project; + } + + /** + * Parse the bucket from Bucket resource. + * + * @param {string} bucketName + * A fully-qualified path representing Bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBucketName(bucketName: string) { + return this.pathTemplates.bucketPathTemplate.match(bucketName).bucket; + } + + /** + * 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 project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.storageStub && !this._terminated) { + return this.storageStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-storage-control/src/v2/storage_client_config.json b/owl-bot-staging/google-storage-control/src/v2/storage_client_config.json new file mode 100644 index 00000000000..6919c05f02d --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/storage_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.storage.v2.Storage": { + "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 + }, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "DeleteBucket": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetBucket": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateBucket": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListBuckets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "LockBucketRetentionPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateBucket": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + } + } + } + } +} diff --git a/owl-bot-staging/google-storage-control/src/v2/storage_control_client.ts b/owl-bot-staging/google-storage-control/src/v2/storage_control_client.ts new file mode 100644 index 00000000000..eeeacf58476 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/storage_control_client.ts @@ -0,0 +1,4635 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 * 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'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/storage_control_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './storage_control_client_config.json'; +const version = require('../../../package.json').version; + +/** + * StorageControl service includes selected control plane operations. + * @class + * @memberof v2 + */ +export class StorageControlClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('storage-control'); + + 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; + storageControlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of StorageControlClient. + * + * @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://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new StorageControlClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof StorageControlClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'storage.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + anywhereCachePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}' + ), + bucketPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/buckets/{bucket}' + ), + folderPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/buckets/{bucket}/folders/{folder=**}' + ), + folderLocationIntelligenceConfigPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/intelligenceConfig' + ), + managedFolderPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}' + ), + orgLocationIntelligenceConfigPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{org}/locations/{location}/intelligenceConfig' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationIntelligenceConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/intelligenceConfig' + ), + storageLayoutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/buckets/{bucket}/storageLayout' + ), + }; + + // 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 = { + listFolders: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'folders'), + listManagedFolders: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'managedFolders'), + listAnywhereCaches: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'anywhereCaches') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = []; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const renameFolderResponse = protoFilesRoot.lookup( + '.google.storage.control.v2.Folder') as gax.protobuf.Type; + const renameFolderMetadata = protoFilesRoot.lookup( + '.google.storage.control.v2.RenameFolderMetadata') as gax.protobuf.Type; + const deleteFolderRecursiveResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFolderRecursiveMetadata = protoFilesRoot.lookup( + '.google.storage.control.v2.DeleteFolderRecursiveMetadata') as gax.protobuf.Type; + const createAnywhereCacheResponse = protoFilesRoot.lookup( + '.google.storage.control.v2.AnywhereCache') as gax.protobuf.Type; + const createAnywhereCacheMetadata = protoFilesRoot.lookup( + '.google.storage.control.v2.CreateAnywhereCacheMetadata') as gax.protobuf.Type; + const updateAnywhereCacheResponse = protoFilesRoot.lookup( + '.google.storage.control.v2.AnywhereCache') as gax.protobuf.Type; + const updateAnywhereCacheMetadata = protoFilesRoot.lookup( + '.google.storage.control.v2.UpdateAnywhereCacheMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + renameFolder: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + renameFolderResponse.decode.bind(renameFolderResponse), + renameFolderMetadata.decode.bind(renameFolderMetadata)), + deleteFolderRecursive: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFolderRecursiveResponse.decode.bind(deleteFolderRecursiveResponse), + deleteFolderRecursiveMetadata.decode.bind(deleteFolderRecursiveMetadata)), + createAnywhereCache: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAnywhereCacheResponse.decode.bind(createAnywhereCacheResponse), + createAnywhereCacheMetadata.decode.bind(createAnywhereCacheMetadata)), + updateAnywhereCache: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAnywhereCacheResponse.decode.bind(updateAnywhereCacheResponse), + updateAnywhereCacheMetadata.decode.bind(updateAnywhereCacheMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.storage.control.v2.StorageControl', 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.storageControlStub) { + return this.storageControlStub; + } + + // Put together the "service stub" for + // google.storage.control.v2.StorageControl. + this.storageControlStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.storage.control.v2.StorageControl') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.storage.control.v2.StorageControl, + 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 storageControlStubMethods = + ['createFolder', 'deleteFolder', 'getFolder', 'listFolders', 'renameFolder', 'deleteFolderRecursive', 'getStorageLayout', 'createManagedFolder', 'deleteManagedFolder', 'getManagedFolder', 'listManagedFolders', 'createAnywhereCache', 'updateAnywhereCache', 'disableAnywhereCache', 'pauseAnywhereCache', 'resumeAnywhereCache', 'getAnywhereCache', 'listAnywhereCaches', 'getProjectIntelligenceConfig', 'updateProjectIntelligenceConfig', 'getFolderIntelligenceConfig', 'updateFolderIntelligenceConfig', 'getOrganizationIntelligenceConfig', 'updateOrganizationIntelligenceConfig', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; + for (const methodName of storageControlStubMethods) { + const callPromise = this.storageControlStub.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.storageControlStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'storage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'storage.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/devstorage.full_control', + 'https://www.googleapis.com/auth/devstorage.read_only', + 'https://www.googleapis.com/auth/devstorage.read_write' + ]; + } + + 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 -- + // ------------------- +/** + * Creates a new folder. This operation is only applicable to a hierarchical + * namespace enabled bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the bucket in which the folder will reside. The bucket + * must be a hierarchical namespace enabled bucket. + * @param {google.storage.control.v2.Folder} request.folder + * Required. Properties of the new folder being created. + * The bucket and name of the folder are specified in the parent and folder_id + * fields, respectively. Populating those fields in `folder` will result in an + * error. + * @param {string} request.folderId + * Required. The full name of a folder, including all its parent folders. + * Folders use single '/' characters as a delimiter. + * The folder_id must end with a slash. + * For example, the folder_id of "books/biographies/" would create a new + * "biographies/" folder under the "books/" folder. + * @param {boolean} [request.recursive] + * Optional. If true, parent folder doesn't have to be present and all missing + * ancestor folders will be created atomically. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.Folder|Folder}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.create_folder.js + * region_tag:storage_v2_generated_StorageControl_CreateFolder_async + */ + createFolder( + request?: protos.google.storage.control.v2.ICreateFolderRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|undefined, {}|undefined + ]>; + createFolder( + request: protos.google.storage.control.v2.ICreateFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|null|undefined, + {}|null|undefined>): void; + createFolder( + request: protos.google.storage.control.v2.ICreateFolderRequest, + callback: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|null|undefined, + {}|null|undefined>): void; + createFolder( + request?: protos.google.storage.control.v2.ICreateFolderRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('createFolder request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFolder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createFolder(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.ICreateFolderRequest|undefined, + {}|undefined + ]) => { + this._log.info('createFolder response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Permanently deletes an empty folder. This operation is only applicable to a + * hierarchical namespace enabled bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the folder. + * Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + * @param {number} request.ifMetagenerationMatch + * Makes the operation only succeed conditional on whether the folder's + * current metageneration matches the given value. + * @param {number} request.ifMetagenerationNotMatch + * Makes the operation only succeed conditional on whether the folder's + * current metageneration does not match the given value. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.delete_folder.js + * region_tag:storage_v2_generated_StorageControl_DeleteFolder_async + */ + deleteFolder( + request?: protos.google.storage.control.v2.IDeleteFolderRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|undefined, {}|undefined + ]>; + deleteFolder( + request: protos.google.storage.control.v2.IDeleteFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|null|undefined, + {}|null|undefined>): void; + deleteFolder( + request: protos.google.storage.control.v2.IDeleteFolderRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|null|undefined, + {}|null|undefined>): void; + deleteFolder( + request?: protos.google.storage.control.v2.IDeleteFolderRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('deleteFolder request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFolder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteFolder(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteFolderRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteFolder response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns metadata for the specified folder. This operation is only + * applicable to a hierarchical namespace enabled bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the folder. + * Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + * @param {number} request.ifMetagenerationMatch + * Makes the operation only succeed conditional on whether the folder's + * current metageneration matches the given value. + * @param {number} request.ifMetagenerationNotMatch + * Makes the operation only succeed conditional on whether the folder's + * current metageneration does not match the given value. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.Folder|Folder}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_folder.js + * region_tag:storage_v2_generated_StorageControl_GetFolder_async + */ + getFolder( + request?: protos.google.storage.control.v2.IGetFolderRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|undefined, {}|undefined + ]>; + getFolder( + request: protos.google.storage.control.v2.IGetFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|null|undefined, + {}|null|undefined>): void; + getFolder( + request: protos.google.storage.control.v2.IGetFolderRequest, + callback: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|null|undefined, + {}|null|undefined>): void; + getFolder( + request?: protos.google.storage.control.v2.IGetFolderRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getFolder request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFolder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getFolder(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IFolder, + protos.google.storage.control.v2.IGetFolderRequest|undefined, + {}|undefined + ]) => { + this._log.info('getFolder response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the storage layout configuration for a given bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the StorageLayout resource. + * Format: `projects/{project}/buckets/{bucket}/storageLayout` + * @param {string} request.prefix + * An optional prefix used for permission check. It is useful when the caller + * only has limited permissions under a specific prefix. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.StorageLayout|StorageLayout}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_storage_layout.js + * region_tag:storage_v2_generated_StorageControl_GetStorageLayout_async + */ + getStorageLayout( + request?: protos.google.storage.control.v2.IGetStorageLayoutRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|undefined, {}|undefined + ]>; + getStorageLayout( + request: protos.google.storage.control.v2.IGetStorageLayoutRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|null|undefined, + {}|null|undefined>): void; + getStorageLayout( + request: protos.google.storage.control.v2.IGetStorageLayoutRequest, + callback: Callback< + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|null|undefined, + {}|null|undefined>): void; + getStorageLayout( + request?: protos.google.storage.control.v2.IGetStorageLayoutRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getStorageLayout request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getStorageLayout response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getStorageLayout(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IStorageLayout, + protos.google.storage.control.v2.IGetStorageLayoutRequest|undefined, + {}|undefined + ]) => { + this._log.info('getStorageLayout response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new managed folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the bucket this managed folder belongs to. + * @param {google.storage.control.v2.ManagedFolder} request.managedFolder + * Required. Properties of the managed folder being created. + * The bucket and managed folder names are specified in the `parent` and + * `managed_folder_id` fields. Populating these fields in `managed_folder` + * will result in an error. + * @param {string} request.managedFolderId + * Required. The name of the managed folder. It uses a single `/` as delimiter + * and leading and trailing `/` are allowed. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.ManagedFolder|ManagedFolder}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.create_managed_folder.js + * region_tag:storage_v2_generated_StorageControl_CreateManagedFolder_async + */ + createManagedFolder( + request?: protos.google.storage.control.v2.ICreateManagedFolderRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|undefined, {}|undefined + ]>; + createManagedFolder( + request: protos.google.storage.control.v2.ICreateManagedFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|null|undefined, + {}|null|undefined>): void; + createManagedFolder( + request: protos.google.storage.control.v2.ICreateManagedFolderRequest, + callback: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|null|undefined, + {}|null|undefined>): void; + createManagedFolder( + request?: protos.google.storage.control.v2.ICreateManagedFolderRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('createManagedFolder request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createManagedFolder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createManagedFolder(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.ICreateManagedFolderRequest|undefined, + {}|undefined + ]) => { + this._log.info('createManagedFolder response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Permanently deletes an empty managed folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the managed folder. + * Format: + * `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + * @param {number} request.ifMetagenerationMatch + * The operation succeeds conditional on the managed folder's current + * metageneration matching the value here specified. + * @param {number} request.ifMetagenerationNotMatch + * The operation succeeds conditional on the managed folder's current + * metageneration NOT matching the value here specified. + * @param {boolean} request.allowNonEmpty + * Allows deletion of a managed folder even if it is not empty. + * A managed folder is empty if it manages no child managed folders or + * objects. Caller must have permission for + * storage.managedFolders.setIamPolicy. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.delete_managed_folder.js + * region_tag:storage_v2_generated_StorageControl_DeleteManagedFolder_async + */ + deleteManagedFolder( + request?: protos.google.storage.control.v2.IDeleteManagedFolderRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|undefined, {}|undefined + ]>; + deleteManagedFolder( + request: protos.google.storage.control.v2.IDeleteManagedFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|null|undefined, + {}|null|undefined>): void; + deleteManagedFolder( + request: protos.google.storage.control.v2.IDeleteManagedFolderRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|null|undefined, + {}|null|undefined>): void; + deleteManagedFolder( + request?: protos.google.storage.control.v2.IDeleteManagedFolderRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('deleteManagedFolder request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteManagedFolder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteManagedFolder(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.storage.control.v2.IDeleteManagedFolderRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteManagedFolder response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns metadata for the specified managed folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the managed folder. + * Format: + * `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + * @param {number} request.ifMetagenerationMatch + * The operation succeeds conditional on the managed folder's current + * metageneration matching the value here specified. + * @param {number} request.ifMetagenerationNotMatch + * The operation succeeds conditional on the managed folder's current + * metageneration NOT matching the value here specified. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.ManagedFolder|ManagedFolder}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_managed_folder.js + * region_tag:storage_v2_generated_StorageControl_GetManagedFolder_async + */ + getManagedFolder( + request?: protos.google.storage.control.v2.IGetManagedFolderRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|undefined, {}|undefined + ]>; + getManagedFolder( + request: protos.google.storage.control.v2.IGetManagedFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|null|undefined, + {}|null|undefined>): void; + getManagedFolder( + request: protos.google.storage.control.v2.IGetManagedFolderRequest, + callback: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|null|undefined, + {}|null|undefined>): void; + getManagedFolder( + request?: protos.google.storage.control.v2.IGetManagedFolderRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getManagedFolder request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getManagedFolder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getManagedFolder(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IManagedFolder, + protos.google.storage.control.v2.IGetManagedFolderRequest|undefined, + {}|undefined + ]) => { + this._log.info('getManagedFolder response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Disables an Anywhere Cache instance. A disabled instance is read-only. The + * disablement could be revoked by calling ResumeAnywhereCache. The cache + * instance will be deleted automatically if it remains in the disabled state + * for at least one hour. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.disable_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_DisableAnywhereCache_async + */ + disableAnywhereCache( + request?: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|undefined, {}|undefined + ]>; + disableAnywhereCache( + request: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + disableAnywhereCache( + request: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + disableAnywhereCache( + request?: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('disableAnywhereCache request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('disableAnywhereCache response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.disableAnywhereCache(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IDisableAnywhereCacheRequest|undefined, + {}|undefined + ]) => { + this._log.info('disableAnywhereCache response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Pauses an Anywhere Cache instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.pause_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_PauseAnywhereCache_async + */ + pauseAnywhereCache( + request?: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|undefined, {}|undefined + ]>; + pauseAnywhereCache( + request: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + pauseAnywhereCache( + request: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + pauseAnywhereCache( + request?: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('pauseAnywhereCache request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('pauseAnywhereCache response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.pauseAnywhereCache(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IPauseAnywhereCacheRequest|undefined, + {}|undefined + ]) => { + this._log.info('pauseAnywhereCache response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Resumes a disabled or paused Anywhere Cache instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.resume_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_ResumeAnywhereCache_async + */ + resumeAnywhereCache( + request?: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|undefined, {}|undefined + ]>; + resumeAnywhereCache( + request: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + resumeAnywhereCache( + request: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + resumeAnywhereCache( + request?: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('resumeAnywhereCache request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('resumeAnywhereCache response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.resumeAnywhereCache(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IResumeAnywhereCacheRequest|undefined, + {}|undefined + ]) => { + this._log.info('resumeAnywhereCache response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets an Anywhere Cache instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name field in the request should be: + * `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_GetAnywhereCache_async + */ + getAnywhereCache( + request?: protos.google.storage.control.v2.IGetAnywhereCacheRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|undefined, {}|undefined + ]>; + getAnywhereCache( + request: protos.google.storage.control.v2.IGetAnywhereCacheRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + getAnywhereCache( + request: protos.google.storage.control.v2.IGetAnywhereCacheRequest, + callback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|null|undefined, + {}|null|undefined>): void; + getAnywhereCache( + request?: protos.google.storage.control.v2.IGetAnywhereCacheRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getAnywhereCache request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAnywhereCache response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAnywhereCache(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IAnywhereCache, + protos.google.storage.control.v2.IGetAnywhereCacheRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAnywhereCache response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the Project scoped singleton IntelligenceConfig resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `IntelligenceConfig` resource associated with + * your project. + * + * Format: `projects/{id}/locations/global/intelligenceConfig` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.IntelligenceConfig|IntelligenceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_project_intelligence_config.js + * region_tag:storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_async + */ + getProjectIntelligenceConfig( + request?: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|undefined, {}|undefined + ]>; + getProjectIntelligenceConfig( + request: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + getProjectIntelligenceConfig( + request: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + getProjectIntelligenceConfig( + request?: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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().catch(err => {throw err}); + this._log.info('getProjectIntelligenceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProjectIntelligenceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProjectIntelligenceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProjectIntelligenceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the Project scoped singleton IntelligenceConfig resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storage.control.v2.IntelligenceConfig} request.intelligenceConfig + * Required. The `IntelligenceConfig` resource to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The `update_mask` that specifies the fields within the + * `IntelligenceConfig` resource that should be modified by this update. Only + * the listed fields are updated. + * @param {string} [request.requestId] + * Optional. The ID that uniquely identifies the request, preventing duplicate + * processing. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.IntelligenceConfig|IntelligenceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.update_project_intelligence_config.js + * region_tag:storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_async + */ + updateProjectIntelligenceConfig( + request?: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|undefined, {}|undefined + ]>; + updateProjectIntelligenceConfig( + request: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + updateProjectIntelligenceConfig( + request: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + updateProjectIntelligenceConfig( + request?: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intelligence_config.name': request.intelligenceConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateProjectIntelligenceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateProjectIntelligenceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateProjectIntelligenceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateProjectIntelligenceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the Folder scoped singleton IntelligenceConfig resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `IntelligenceConfig` resource associated with + * your folder. + * + * Format: `folders/{id}/locations/global/intelligenceConfig` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.IntelligenceConfig|IntelligenceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_folder_intelligence_config.js + * region_tag:storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_async + */ + getFolderIntelligenceConfig( + request?: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|undefined, {}|undefined + ]>; + getFolderIntelligenceConfig( + request: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + getFolderIntelligenceConfig( + request: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + getFolderIntelligenceConfig( + request?: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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().catch(err => {throw err}); + this._log.info('getFolderIntelligenceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFolderIntelligenceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getFolderIntelligenceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getFolderIntelligenceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the Folder scoped singleton IntelligenceConfig resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storage.control.v2.IntelligenceConfig} request.intelligenceConfig + * Required. The `IntelligenceConfig` resource to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The `update_mask` that specifies the fields within the + * `IntelligenceConfig` resource that should be modified by this update. Only + * the listed fields are updated. + * @param {string} [request.requestId] + * Optional. The ID that uniquely identifies the request, preventing duplicate + * processing. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.IntelligenceConfig|IntelligenceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.update_folder_intelligence_config.js + * region_tag:storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_async + */ + updateFolderIntelligenceConfig( + request?: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|undefined, {}|undefined + ]>; + updateFolderIntelligenceConfig( + request: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + updateFolderIntelligenceConfig( + request: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + updateFolderIntelligenceConfig( + request?: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intelligence_config.name': request.intelligenceConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateFolderIntelligenceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFolderIntelligenceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateFolderIntelligenceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateFolderIntelligenceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns the Organization scoped singleton IntelligenceConfig resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `IntelligenceConfig` resource associated with + * your organization. + * + * Format: `organizations/{org_id}/locations/global/intelligenceConfig` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.IntelligenceConfig|IntelligenceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_organization_intelligence_config.js + * region_tag:storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_async + */ + getOrganizationIntelligenceConfig( + request?: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|undefined, {}|undefined + ]>; + getOrganizationIntelligenceConfig( + request: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + getOrganizationIntelligenceConfig( + request: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + getOrganizationIntelligenceConfig( + request?: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as 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().catch(err => {throw err}); + this._log.info('getOrganizationIntelligenceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrganizationIntelligenceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getOrganizationIntelligenceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getOrganizationIntelligenceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the Organization scoped singleton IntelligenceConfig resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storage.control.v2.IntelligenceConfig} request.intelligenceConfig + * Required. The `IntelligenceConfig` resource to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The `update_mask` that specifies the fields within the + * `IntelligenceConfig` resource that should be modified by this update. Only + * the listed fields are updated. + * @param {string} [request.requestId] + * Optional. The ID that uniquely identifies the request, preventing duplicate + * processing. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.storage.control.v2.IntelligenceConfig|IntelligenceConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.update_organization_intelligence_config.js + * region_tag:storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_async + */ + updateOrganizationIntelligenceConfig( + request?: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|undefined, {}|undefined + ]>; + updateOrganizationIntelligenceConfig( + request: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + updateOrganizationIntelligenceConfig( + request: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, + callback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): void; + updateOrganizationIntelligenceConfig( + request?: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intelligence_config.name': request.intelligenceConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateOrganizationIntelligenceConfig request %j', request); + const wrappedCallback: Callback< + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateOrganizationIntelligenceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateOrganizationIntelligenceConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.storage.control.v2.IIntelligenceConfig, + protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateOrganizationIntelligenceConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the IAM policy for a specified bucket. + * The `resource` field in the request should be + * `projects/_/buckets/{bucket}` for a bucket, or + * `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + * for a managed folder. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.get_iam_policy.js + * region_tag:storage_v2_generated_StorageControl_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates an IAM policy for the specified bucket. + * The `resource` field in the request should be + * `projects/_/buckets/{bucket}` for a bucket, or + * `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + * for a managed folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.set_iam_policy.js + * region_tag:storage_v2_generated_StorageControl_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Tests a set of permissions on the given bucket, object, or managed folder + * to see which, if any, are held by the caller. + * The `resource` field in the request should be + * `projects/_/buckets/{bucket}` for a bucket, + * `projects/_/buckets/{bucket}/objects/{object}` for an object, or + * `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + * for a managed folder. + * + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.test_iam_permissions.js + * region_tag:storage_v2_generated_StorageControl_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)/objects(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + { + const fieldValue = request.resource; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)/managedFolders(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Renames a source folder to a destination folder. This operation is only + * applicable to a hierarchical namespace enabled bucket. During a rename, the + * source and destination folders are locked until the long running operation + * completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the source folder being renamed. + * Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + * @param {string} request.destinationFolderId + * Required. The destination folder ID, e.g. `foo/bar/`. + * @param {number} request.ifMetagenerationMatch + * Makes the operation only succeed conditional on whether the source + * folder's current metageneration matches the given value. + * @param {number} request.ifMetagenerationNotMatch + * Makes the operation only succeed conditional on whether the source + * folder's current metageneration does not match the given value. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.rename_folder.js + * region_tag:storage_v2_generated_StorageControl_RenameFolder_async + */ + renameFolder( + request?: protos.google.storage.control.v2.IRenameFolderRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + renameFolder( + request: protos.google.storage.control.v2.IRenameFolderRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + renameFolder( + request: protos.google.storage.control.v2.IRenameFolderRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + renameFolder( + request?: protos.google.storage.control.v2.IRenameFolderRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('renameFolder response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('renameFolder request %j', request); + return this.innerApiCalls.renameFolder(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('renameFolder response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `renameFolder()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.rename_folder.js + * region_tag:storage_v2_generated_StorageControl_RenameFolder_async + */ + async checkRenameFolderProgress(name: string): Promise>{ + this._log.info('renameFolder long-running'); + 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.renameFolder, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a folder recursively. This operation is only applicable to a + * hierarchical namespace enabled bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the folder being deleted, however all of its contents + * will be deleted too. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @param {number} [request.ifMetagenerationMatch] + * Optional. Makes the operation only succeed conditional on whether the root + * folder's current metageneration matches the given value. + * @param {number} [request.ifMetagenerationNotMatch] + * Optional. Makes the operation only succeed conditional on whether the root + * folder's current metageneration does not match the given value. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.delete_folder_recursive.js + * region_tag:storage_v2_generated_StorageControl_DeleteFolderRecursive_async + */ + deleteFolderRecursive( + request?: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFolderRecursive( + request: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFolderRecursive( + request: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFolderRecursive( + request?: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteFolderRecursive response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteFolderRecursive request %j', request); + return this.innerApiCalls.deleteFolderRecursive(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteFolderRecursive response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteFolderRecursive()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.delete_folder_recursive.js + * region_tag:storage_v2_generated_StorageControl_DeleteFolderRecursive_async + */ + async checkDeleteFolderRecursiveProgress(name: string): Promise>{ + this._log.info('deleteFolderRecursive long-running'); + 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.deleteFolderRecursive, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an Anywhere Cache instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The bucket to which this cache belongs. + * Format: `projects/{project}/buckets/{bucket}` + * @param {google.storage.control.v2.AnywhereCache} request.anywhereCache + * Required. Properties of the Anywhere Cache instance being created. + * The parent bucket name is specified in the `parent` field. Server uses the + * default value of `ttl` or `admission_policy` if not specified in + * request. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.create_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_CreateAnywhereCache_async + */ + createAnywhereCache( + request?: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createAnywhereCache( + request: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createAnywhereCache( + request: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createAnywhereCache( + request?: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAnywhereCache response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAnywhereCache request %j', request); + return this.innerApiCalls.createAnywhereCache(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createAnywhereCache response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createAnywhereCache()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.create_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_CreateAnywhereCache_async + */ + async checkCreateAnywhereCacheProgress(name: string): Promise>{ + this._log.info('createAnywhereCache long-running'); + 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.createAnywhereCache, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an Anywhere Cache instance. Mutable fields include `ttl` and + * `admission_policy`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storage.control.v2.AnywhereCache} request.anywhereCache + * Required. The Anywhere Cache instance to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. List of fields to be updated. Mutable fields of AnywhereCache + * include `ttl` and `admission_policy`. + * + * To specify ALL fields, specify a single field with the value `*`. Note: We + * recommend against doing this. If a new field is introduced at a later time, + * an older client updating with the `*` may accidentally reset the new + * field's value. + * + * Not specifying any fields is an error. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. This request is only + * idempotent if a `request_id` is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.update_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_UpdateAnywhereCache_async + */ + updateAnywhereCache( + request?: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateAnywhereCache( + request: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateAnywhereCache( + request: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateAnywhereCache( + request?: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.anywhereCache?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/buckets/[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAnywhereCache response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAnywhereCache request %j', request); + return this.innerApiCalls.updateAnywhereCache(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateAnywhereCache response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateAnywhereCache()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.update_anywhere_cache.js + * region_tag:storage_v2_generated_StorageControl_UpdateAnywhereCache_async + */ + async checkUpdateAnywhereCacheProgress(name: string): Promise>{ + this._log.info('updateAnywhereCache long-running'); + 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.updateAnywhereCache, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Retrieves a list of folders. This operation is only applicable to a + * hierarchical namespace enabled bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the bucket in which to look for folders. The bucket must + * be a hierarchical namespace enabled bucket. + * @param {number} [request.pageSize] + * Optional. Maximum number of folders to return in a single response. The + * service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to folders whose names begin with this prefix. + * If set, the value must either be an empty string or end with a '/'. + * @param {string} [request.delimiter] + * Optional. If set, returns results in a directory-like mode. The results + * will only include folders that either exactly match the above prefix, or + * are one level below the prefix. The only supported value is '/'. + * @param {string} [request.lexicographicStart] + * Optional. Filter results to folders whose names are lexicographically equal + * to or after lexicographic_start. If lexicographic_end is also set, the + * folders listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + * @param {string} [request.lexicographicEnd] + * Optional. Filter results to folders whose names are lexicographically + * before lexicographic_end. If lexicographic_start is also set, the folders + * listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.storage.control.v2.Folder|Folder}. + * 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 `listFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFolders( + request?: protos.google.storage.control.v2.IListFoldersRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IFolder[], + protos.google.storage.control.v2.IListFoldersRequest|null, + protos.google.storage.control.v2.IListFoldersResponse + ]>; + listFolders( + request: protos.google.storage.control.v2.IListFoldersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storage.control.v2.IListFoldersRequest, + protos.google.storage.control.v2.IListFoldersResponse|null|undefined, + protos.google.storage.control.v2.IFolder>): void; + listFolders( + request: protos.google.storage.control.v2.IListFoldersRequest, + callback: PaginationCallback< + protos.google.storage.control.v2.IListFoldersRequest, + protos.google.storage.control.v2.IListFoldersResponse|null|undefined, + protos.google.storage.control.v2.IFolder>): void; + listFolders( + request?: protos.google.storage.control.v2.IListFoldersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.storage.control.v2.IListFoldersRequest, + protos.google.storage.control.v2.IListFoldersResponse|null|undefined, + protos.google.storage.control.v2.IFolder>, + callback?: PaginationCallback< + protos.google.storage.control.v2.IListFoldersRequest, + protos.google.storage.control.v2.IListFoldersResponse|null|undefined, + protos.google.storage.control.v2.IFolder>): + Promise<[ + protos.google.storage.control.v2.IFolder[], + protos.google.storage.control.v2.IListFoldersRequest|null, + protos.google.storage.control.v2.IListFoldersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.storage.control.v2.IListFoldersRequest, + protos.google.storage.control.v2.IListFoldersResponse|null|undefined, + protos.google.storage.control.v2.IFolder>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFolders values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFolders request %j', request); + return this.innerApiCalls + .listFolders(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.storage.control.v2.IFolder[], + protos.google.storage.control.v2.IListFoldersRequest|null, + protos.google.storage.control.v2.IListFoldersResponse + ]) => { + this._log.info('listFolders values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFolders`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the bucket in which to look for folders. The bucket must + * be a hierarchical namespace enabled bucket. + * @param {number} [request.pageSize] + * Optional. Maximum number of folders to return in a single response. The + * service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to folders whose names begin with this prefix. + * If set, the value must either be an empty string or end with a '/'. + * @param {string} [request.delimiter] + * Optional. If set, returns results in a directory-like mode. The results + * will only include folders that either exactly match the above prefix, or + * are one level below the prefix. The only supported value is '/'. + * @param {string} [request.lexicographicStart] + * Optional. Filter results to folders whose names are lexicographically equal + * to or after lexicographic_start. If lexicographic_end is also set, the + * folders listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + * @param {string} [request.lexicographicEnd] + * Optional. Filter results to folders whose names are lexicographically + * before lexicographic_end. If lexicographic_start is also set, the folders + * listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.storage.control.v2.Folder|Folder} 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 `listFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFoldersStream( + request?: protos.google.storage.control.v2.IListFoldersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFolders stream %j', request); + return this.descriptors.page.listFolders.createStream( + this.innerApiCalls.listFolders as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFolders`, 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. Name of the bucket in which to look for folders. The bucket must + * be a hierarchical namespace enabled bucket. + * @param {number} [request.pageSize] + * Optional. Maximum number of folders to return in a single response. The + * service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to folders whose names begin with this prefix. + * If set, the value must either be an empty string or end with a '/'. + * @param {string} [request.delimiter] + * Optional. If set, returns results in a directory-like mode. The results + * will only include folders that either exactly match the above prefix, or + * are one level below the prefix. The only supported value is '/'. + * @param {string} [request.lexicographicStart] + * Optional. Filter results to folders whose names are lexicographically equal + * to or after lexicographic_start. If lexicographic_end is also set, the + * folders listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + * @param {string} [request.lexicographicEnd] + * Optional. Filter results to folders whose names are lexicographically + * before lexicographic_end. If lexicographic_start is also set, the folders + * listed have names between lexicographic_start (inclusive) and + * lexicographic_end (exclusive). + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.storage.control.v2.Folder|Folder}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.list_folders.js + * region_tag:storage_v2_generated_StorageControl_ListFolders_async + */ + listFoldersAsync( + request?: protos.google.storage.control.v2.IListFoldersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFolders iterate %j', request); + return this.descriptors.page.listFolders.asyncIterate( + this.innerApiCalls['listFolders'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a list of managed folders for a given bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the bucket this managed folder belongs to. + * @param {number} [request.pageSize] + * Optional. Maximum number of managed folders to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to match managed folders with name starting with + * this prefix. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.storage.control.v2.ManagedFolder|ManagedFolder}. + * 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 `listManagedFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listManagedFolders( + request?: protos.google.storage.control.v2.IListManagedFoldersRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IManagedFolder[], + protos.google.storage.control.v2.IListManagedFoldersRequest|null, + protos.google.storage.control.v2.IListManagedFoldersResponse + ]>; + listManagedFolders( + request: protos.google.storage.control.v2.IListManagedFoldersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storage.control.v2.IListManagedFoldersRequest, + protos.google.storage.control.v2.IListManagedFoldersResponse|null|undefined, + protos.google.storage.control.v2.IManagedFolder>): void; + listManagedFolders( + request: protos.google.storage.control.v2.IListManagedFoldersRequest, + callback: PaginationCallback< + protos.google.storage.control.v2.IListManagedFoldersRequest, + protos.google.storage.control.v2.IListManagedFoldersResponse|null|undefined, + protos.google.storage.control.v2.IManagedFolder>): void; + listManagedFolders( + request?: protos.google.storage.control.v2.IListManagedFoldersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.storage.control.v2.IListManagedFoldersRequest, + protos.google.storage.control.v2.IListManagedFoldersResponse|null|undefined, + protos.google.storage.control.v2.IManagedFolder>, + callback?: PaginationCallback< + protos.google.storage.control.v2.IListManagedFoldersRequest, + protos.google.storage.control.v2.IListManagedFoldersResponse|null|undefined, + protos.google.storage.control.v2.IManagedFolder>): + Promise<[ + protos.google.storage.control.v2.IManagedFolder[], + protos.google.storage.control.v2.IListManagedFoldersRequest|null, + protos.google.storage.control.v2.IListManagedFoldersResponse + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.storage.control.v2.IListManagedFoldersRequest, + protos.google.storage.control.v2.IListManagedFoldersResponse|null|undefined, + protos.google.storage.control.v2.IManagedFolder>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listManagedFolders values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listManagedFolders request %j', request); + return this.innerApiCalls + .listManagedFolders(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.storage.control.v2.IManagedFolder[], + protos.google.storage.control.v2.IListManagedFoldersRequest|null, + protos.google.storage.control.v2.IListManagedFoldersResponse + ]) => { + this._log.info('listManagedFolders values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listManagedFolders`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the bucket this managed folder belongs to. + * @param {number} [request.pageSize] + * Optional. Maximum number of managed folders to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to match managed folders with name starting with + * this prefix. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.storage.control.v2.ManagedFolder|ManagedFolder} 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 `listManagedFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listManagedFoldersStream( + request?: protos.google.storage.control.v2.IListManagedFoldersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listManagedFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listManagedFolders stream %j', request); + return this.descriptors.page.listManagedFolders.createStream( + this.innerApiCalls.listManagedFolders as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listManagedFolders`, 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. Name of the bucket this managed folder belongs to. + * @param {number} [request.pageSize] + * Optional. Maximum number of managed folders to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} [request.pageToken] + * Optional. A previously-returned page token representing part of the larger + * set of results to view. + * @param {string} [request.prefix] + * Optional. Filter results to match managed folders with name starting with + * this prefix. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.storage.control.v2.ManagedFolder|ManagedFolder}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.list_managed_folders.js + * region_tag:storage_v2_generated_StorageControl_ListManagedFolders_async + */ + listManagedFoldersAsync( + request?: protos.google.storage.control.v2.IListManagedFoldersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listManagedFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listManagedFolders iterate %j', request); + return this.descriptors.page.listManagedFolders.asyncIterate( + this.innerApiCalls['listManagedFolders'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Anywhere Cache instances for a given bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The bucket to which this cache belongs. + * @param {number} request.pageSize + * Maximum number of caches to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} request.pageToken + * A previously-returned page token representing part of the larger set of + * results to view. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. + * 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 `listAnywhereCachesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAnywhereCaches( + request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, + options?: CallOptions): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache[], + protos.google.storage.control.v2.IListAnywhereCachesRequest|null, + protos.google.storage.control.v2.IListAnywhereCachesResponse + ]>; + listAnywhereCaches( + request: protos.google.storage.control.v2.IListAnywhereCachesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storage.control.v2.IListAnywhereCachesRequest, + protos.google.storage.control.v2.IListAnywhereCachesResponse|null|undefined, + protos.google.storage.control.v2.IAnywhereCache>): void; + listAnywhereCaches( + request: protos.google.storage.control.v2.IListAnywhereCachesRequest, + callback: PaginationCallback< + protos.google.storage.control.v2.IListAnywhereCachesRequest, + protos.google.storage.control.v2.IListAnywhereCachesResponse|null|undefined, + protos.google.storage.control.v2.IAnywhereCache>): void; + listAnywhereCaches( + request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.storage.control.v2.IListAnywhereCachesRequest, + protos.google.storage.control.v2.IListAnywhereCachesResponse|null|undefined, + protos.google.storage.control.v2.IAnywhereCache>, + callback?: PaginationCallback< + protos.google.storage.control.v2.IListAnywhereCachesRequest, + protos.google.storage.control.v2.IListAnywhereCachesResponse|null|undefined, + protos.google.storage.control.v2.IAnywhereCache>): + Promise<[ + protos.google.storage.control.v2.IAnywhereCache[], + protos.google.storage.control.v2.IListAnywhereCachesRequest|null, + protos.google.storage.control.v2.IListAnywhereCachesResponse + ]>|void { + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.storage.control.v2.IListAnywhereCachesRequest, + protos.google.storage.control.v2.IListAnywhereCachesResponse|null|undefined, + protos.google.storage.control.v2.IAnywhereCache>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAnywhereCaches values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAnywhereCaches request %j', request); + return this.innerApiCalls + .listAnywhereCaches(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.storage.control.v2.IAnywhereCache[], + protos.google.storage.control.v2.IListAnywhereCachesRequest|null, + protos.google.storage.control.v2.IListAnywhereCachesResponse + ]) => { + this._log.info('listAnywhereCaches values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAnywhereCaches`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The bucket to which this cache belongs. + * @param {number} request.pageSize + * Maximum number of caches to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} request.pageToken + * A previously-returned page token representing part of the larger set of + * results to view. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache} 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 `listAnywhereCachesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAnywhereCachesStream( + request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listAnywhereCaches']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAnywhereCaches stream %j', request); + return this.descriptors.page.listAnywhereCaches.createStream( + this.innerApiCalls.listAnywhereCaches as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAnywhereCaches`, 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 bucket to which this cache belongs. + * @param {number} request.pageSize + * Maximum number of caches to return in a single response. + * The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string} request.pageToken + * A previously-returned page token representing part of the larger set of + * results to view. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. UUID is the recommended + * format, but other formats are still accepted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/storage_control.list_anywhere_caches.js + * region_tag:storage_v2_generated_StorageControl_ListAnywhereCaches_async + */ + listAnywhereCachesAsync( + request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + if (!request.requestId) { + request.requestId = gax.makeUUID(); + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('(?(?:.*)?)')); + if (match) { + const parameterValue = match.groups?.['bucket'] ?? fieldValue; + Object.assign(routingParameter, { bucket: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listAnywhereCaches']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAnywhereCaches iterate %j', request); + return this.descriptors.page.listAnywhereCaches.asyncIterate( + this.innerApiCalls['listAnywhereCaches'] 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, + optionsOrCallback?: + | 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]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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 { + 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 ?? '', + }); + 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + 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, + optionsOrCallback?: + | 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 { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified anywhereCache resource name string. + * + * @param {string} project + * @param {string} bucket + * @param {string} anywhere_cache + * @returns {string} Resource name string. + */ + anywhereCachePath(project:string,bucket:string,anywhereCache:string) { + return this.pathTemplates.anywhereCachePathTemplate.render({ + project: project, + bucket: bucket, + anywhere_cache: anywhereCache, + }); + } + + /** + * Parse the project from AnywhereCache resource. + * + * @param {string} anywhereCacheName + * A fully-qualified path representing AnywhereCache resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnywhereCacheName(anywhereCacheName: string) { + return this.pathTemplates.anywhereCachePathTemplate.match(anywhereCacheName).project; + } + + /** + * Parse the bucket from AnywhereCache resource. + * + * @param {string} anywhereCacheName + * A fully-qualified path representing AnywhereCache resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromAnywhereCacheName(anywhereCacheName: string) { + return this.pathTemplates.anywhereCachePathTemplate.match(anywhereCacheName).bucket; + } + + /** + * Parse the anywhere_cache from AnywhereCache resource. + * + * @param {string} anywhereCacheName + * A fully-qualified path representing AnywhereCache resource. + * @returns {string} A string representing the anywhere_cache. + */ + matchAnywhereCacheFromAnywhereCacheName(anywhereCacheName: string) { + return this.pathTemplates.anywhereCachePathTemplate.match(anywhereCacheName).anywhere_cache; + } + + /** + * Return a fully-qualified bucket resource name string. + * + * @param {string} project + * @param {string} bucket + * @returns {string} Resource name string. + */ + bucketPath(project:string,bucket:string) { + return this.pathTemplates.bucketPathTemplate.render({ + project: project, + bucket: bucket, + }); + } + + /** + * Parse the project from Bucket resource. + * + * @param {string} bucketName + * A fully-qualified path representing Bucket resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBucketName(bucketName: string) { + return this.pathTemplates.bucketPathTemplate.match(bucketName).project; + } + + /** + * Parse the bucket from Bucket resource. + * + * @param {string} bucketName + * A fully-qualified path representing Bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBucketName(bucketName: string) { + return this.pathTemplates.bucketPathTemplate.match(bucketName).bucket; + } + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} project + * @param {string} bucket + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(project:string,bucket:string,folder:string) { + return this.pathTemplates.folderPathTemplate.render({ + project: project, + bucket: bucket, + folder: folder, + }); + } + + /** + * Parse the project from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).project; + } + + /** + * Parse the bucket from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).bucket; + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified folderLocationIntelligenceConfig resource name string. + * + * @param {string} folder + * @param {string} location + * @returns {string} Resource name string. + */ + folderLocationIntelligenceConfigPath(folder:string,location:string) { + return this.pathTemplates.folderLocationIntelligenceConfigPathTemplate.render({ + folder: folder, + location: location, + }); + } + + /** + * Parse the folder from FolderLocationIntelligenceConfig resource. + * + * @param {string} folderLocationIntelligenceConfigName + * A fully-qualified path representing folder_location_intelligenceConfig resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName: string) { + return this.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match(folderLocationIntelligenceConfigName).folder; + } + + /** + * Parse the location from FolderLocationIntelligenceConfig resource. + * + * @param {string} folderLocationIntelligenceConfigName + * A fully-qualified path representing folder_location_intelligenceConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName: string) { + return this.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match(folderLocationIntelligenceConfigName).location; + } + + /** + * Return a fully-qualified managedFolder resource name string. + * + * @param {string} project + * @param {string} bucket + * @param {string} managed_folder + * @returns {string} Resource name string. + */ + managedFolderPath(project:string,bucket:string,managedFolder:string) { + return this.pathTemplates.managedFolderPathTemplate.render({ + project: project, + bucket: bucket, + managed_folder: managedFolder, + }); + } + + /** + * Parse the project from ManagedFolder resource. + * + * @param {string} managedFolderName + * A fully-qualified path representing ManagedFolder resource. + * @returns {string} A string representing the project. + */ + matchProjectFromManagedFolderName(managedFolderName: string) { + return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName).project; + } + + /** + * Parse the bucket from ManagedFolder resource. + * + * @param {string} managedFolderName + * A fully-qualified path representing ManagedFolder resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromManagedFolderName(managedFolderName: string) { + return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName).bucket; + } + + /** + * Parse the managed_folder from ManagedFolder resource. + * + * @param {string} managedFolderName + * A fully-qualified path representing ManagedFolder resource. + * @returns {string} A string representing the managed_folder. + */ + matchManagedFolderFromManagedFolderName(managedFolderName: string) { + return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName).managed_folder; + } + + /** + * Return a fully-qualified orgLocationIntelligenceConfig resource name string. + * + * @param {string} org + * @param {string} location + * @returns {string} Resource name string. + */ + orgLocationIntelligenceConfigPath(org:string,location:string) { + return this.pathTemplates.orgLocationIntelligenceConfigPathTemplate.render({ + org: org, + location: location, + }); + } + + /** + * Parse the org from OrgLocationIntelligenceConfig resource. + * + * @param {string} orgLocationIntelligenceConfigName + * A fully-qualified path representing org_location_intelligenceConfig resource. + * @returns {string} A string representing the org. + */ + matchOrgFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName: string) { + return this.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match(orgLocationIntelligenceConfigName).org; + } + + /** + * Parse the location from OrgLocationIntelligenceConfig resource. + * + * @param {string} orgLocationIntelligenceConfigName + * A fully-qualified path representing org_location_intelligenceConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName: string) { + return this.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match(orgLocationIntelligenceConfigName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationIntelligenceConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationIntelligenceConfigPath(project:string,location:string) { + return this.pathTemplates.projectLocationIntelligenceConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocationIntelligenceConfig resource. + * + * @param {string} projectLocationIntelligenceConfigName + * A fully-qualified path representing project_location_intelligenceConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName: string) { + return this.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match(projectLocationIntelligenceConfigName).project; + } + + /** + * Parse the location from ProjectLocationIntelligenceConfig resource. + * + * @param {string} projectLocationIntelligenceConfigName + * A fully-qualified path representing project_location_intelligenceConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName: string) { + return this.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match(projectLocationIntelligenceConfigName).location; + } + + /** + * Return a fully-qualified storageLayout resource name string. + * + * @param {string} project + * @param {string} bucket + * @returns {string} Resource name string. + */ + storageLayoutPath(project:string,bucket:string) { + return this.pathTemplates.storageLayoutPathTemplate.render({ + project: project, + bucket: bucket, + }); + } + + /** + * Parse the project from StorageLayout resource. + * + * @param {string} storageLayoutName + * A fully-qualified path representing StorageLayout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStorageLayoutName(storageLayoutName: string) { + return this.pathTemplates.storageLayoutPathTemplate.match(storageLayoutName).project; + } + + /** + * Parse the bucket from StorageLayout resource. + * + * @param {string} storageLayoutName + * A fully-qualified path representing StorageLayout resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromStorageLayoutName(storageLayoutName: string) { + return this.pathTemplates.storageLayoutPathTemplate.match(storageLayoutName).bucket; + } + + /** + * 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.storageControlStub && !this._terminated) { + return this.storageControlStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-storage-control/src/v2/storage_control_client_config.json b/owl-bot-staging/google-storage-control/src/v2/storage_control_client_config.json new file mode 100644 index 00000000000..fe364c53427 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/storage_control_client_config.json @@ -0,0 +1,177 @@ +{ + "interfaces": { + "google.storage.control.v2.StorageControl": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_deadline_exceeded_resource_exhausted_internal_unavailable": [ + "UNKNOWN", + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "INTERNAL", + "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 + }, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateFolder": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFolder": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListFolders": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "RenameFolder": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteFolderRecursive": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetStorageLayout": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateManagedFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteManagedFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetManagedFolder": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListManagedFolders": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateAnywhereCache": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateAnywhereCache": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DisableAnywhereCache": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "PauseAnywhereCache": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ResumeAnywhereCache": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetAnywhereCache": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListAnywhereCaches": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetProjectIntelligenceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateProjectIntelligenceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetFolderIntelligenceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateFolderIntelligenceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetOrganizationIntelligenceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateOrganizationIntelligenceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_deadline_exceeded_resource_exhausted_internal_unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-storage-control/src/v2/storage_control_proto_list.json b/owl-bot-staging/google-storage-control/src/v2/storage_control_proto_list.json new file mode 100644 index 00000000000..0063e918eb1 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/storage_control_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/storage/control/v2/storage_control.proto" +] diff --git a/owl-bot-staging/google-storage-control/src/v2/storage_proto_list.json b/owl-bot-staging/google-storage-control/src/v2/storage_proto_list.json new file mode 100644 index 00000000000..7f1061d47f0 --- /dev/null +++ b/owl-bot-staging/google-storage-control/src/v2/storage_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/storage/v2/storage.proto" +] diff --git a/owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..323d572225d --- /dev/null +++ b/owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 control = require('@google-cloud/storage-control'); + +function main() { + const storageControlClient = new control.StorageControlClient(); +} + +main(); diff --git a/owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..5334c6f6734 --- /dev/null +++ b/owl-bot-staging/google-storage-control/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {StorageControlClient} from '@google-cloud/storage-control'; + +// check that the client class type name can be used +function doStuffWithStorageControlClient(client: StorageControlClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const storageControlClient = new StorageControlClient(); + doStuffWithStorageControlClient(storageControlClient); +} + +main(); diff --git a/owl-bot-staging/google-storage-control/system-test/install.ts b/owl-bot-staging/google-storage-control/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-storage-control/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-storage-control/test/gapic_storage_control_v2.ts b/owl-bot-staging/google-storage-control/test/gapic_storage_control_v2.ts new file mode 100644 index 00000000000..da5179b398b --- /dev/null +++ b/owl-bot-staging/google-storage-control/test/gapic_storage_control_v2.ts @@ -0,0 +1,4477 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 storagecontrolModule 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('v2.StorageControlClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new storagecontrolModule.v2.StorageControlClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'storage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new storagecontrolModule.v2.StorageControlClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = storagecontrolModule.v2.StorageControlClient.servicePath; + assert.strictEqual(servicePath, 'storage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = storagecontrolModule.v2.StorageControlClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'storage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new storagecontrolModule.v2.StorageControlClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new storagecontrolModule.v2.StorageControlClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new storagecontrolModule.v2.StorageControlClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new storagecontrolModule.v2.StorageControlClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new storagecontrolModule.v2.StorageControlClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = storagecontrolModule.v2.StorageControlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new storagecontrolModule.v2.StorageControlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageControlStub, undefined); + await client.initialize(); + assert(client.storageControlStub); + }); + + it('has close method for the initialized client', done => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.storageControlStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageControlStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new storagecontrolModule.v2.StorageControlClient({ + 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 storagecontrolModule.v2.StorageControlClient({ + 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('createFolder', () => { + it('invokes createFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.Folder() + ); + client.innerApiCalls.createFolder = stubSimpleCall(expectedResponse); + const [response] = await client.createFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.Folder() + ); + client.innerApiCalls.createFolder = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFolder( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IFolder|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createFolder with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createFolder with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createFolder(request), expectedError); + }); + }); + + describe('deleteFolder', () => { + it('invokes deleteFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFolder = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFolder = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFolder( + 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.deleteFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteFolder with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteFolder with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteFolder(request), expectedError); + }); + }); + + describe('getFolder', () => { + it('invokes getFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.Folder() + ); + client.innerApiCalls.getFolder = stubSimpleCall(expectedResponse); + const [response] = await client.getFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.Folder() + ); + client.innerApiCalls.getFolder = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFolder( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IFolder|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getFolder with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.getFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getFolder with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getFolder(request), expectedError); + }); + }); + + describe('getStorageLayout', () => { + it('invokes getStorageLayout without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetStorageLayoutRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.StorageLayout() + ); + client.innerApiCalls.getStorageLayout = stubSimpleCall(expectedResponse); + const [response] = await client.getStorageLayout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getStorageLayout without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetStorageLayoutRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.StorageLayout() + ); + client.innerApiCalls.getStorageLayout = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStorageLayout( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IStorageLayout|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getStorageLayout with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetStorageLayoutRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.getStorageLayout = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStorageLayout(request), expectedError); + const actualRequest = (client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getStorageLayout as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getStorageLayout with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetStorageLayoutRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getStorageLayout(request), expectedError); + }); + }); + + describe('createManagedFolder', () => { + it('invokes createManagedFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateManagedFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.ManagedFolder() + ); + client.innerApiCalls.createManagedFolder = stubSimpleCall(expectedResponse); + const [response] = await client.createManagedFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createManagedFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateManagedFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.ManagedFolder() + ); + client.innerApiCalls.createManagedFolder = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createManagedFolder( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IManagedFolder|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createManagedFolder with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateManagedFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagedFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createManagedFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createManagedFolder with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateManagedFolderRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createManagedFolder(request), expectedError); + }); + }); + + describe('deleteManagedFolder', () => { + it('invokes deleteManagedFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteManagedFolder = stubSimpleCall(expectedResponse); + const [response] = await client.deleteManagedFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteManagedFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteManagedFolder = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteManagedFolder( + 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.deleteManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteManagedFolder with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagedFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteManagedFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteManagedFolder with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteManagedFolder(request), expectedError); + }); + }); + + describe('getManagedFolder', () => { + it('invokes getManagedFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.ManagedFolder() + ); + client.innerApiCalls.getManagedFolder = stubSimpleCall(expectedResponse); + const [response] = await client.getManagedFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getManagedFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.ManagedFolder() + ); + client.innerApiCalls.getManagedFolder = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getManagedFolder( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IManagedFolder|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getManagedFolder with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.getManagedFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getManagedFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getManagedFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getManagedFolder with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetManagedFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getManagedFolder(request), expectedError); + }); + }); + + describe('disableAnywhereCache', () => { + it('invokes disableAnywhereCache without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DisableAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.disableAnywhereCache = stubSimpleCall(expectedResponse); + const [response] = await client.disableAnywhereCache(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes disableAnywhereCache without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DisableAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.disableAnywhereCache = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableAnywhereCache( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IAnywhereCache|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes disableAnywhereCache with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DisableAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.disableAnywhereCache = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.disableAnywhereCache(request), expectedError); + const actualRequest = (client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.disableAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes disableAnywhereCache with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DisableAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.disableAnywhereCache(request), expectedError); + }); + }); + + describe('pauseAnywhereCache', () => { + it('invokes pauseAnywhereCache without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.PauseAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.pauseAnywhereCache = stubSimpleCall(expectedResponse); + const [response] = await client.pauseAnywhereCache(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes pauseAnywhereCache without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.PauseAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.pauseAnywhereCache = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseAnywhereCache( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IAnywhereCache|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes pauseAnywhereCache with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.PauseAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseAnywhereCache = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseAnywhereCache(request), expectedError); + const actualRequest = (client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.pauseAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes pauseAnywhereCache with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.PauseAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.pauseAnywhereCache(request), expectedError); + }); + }); + + describe('resumeAnywhereCache', () => { + it('invokes resumeAnywhereCache without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ResumeAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.resumeAnywhereCache = stubSimpleCall(expectedResponse); + const [response] = await client.resumeAnywhereCache(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes resumeAnywhereCache without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ResumeAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.resumeAnywhereCache = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeAnywhereCache( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IAnywhereCache|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes resumeAnywhereCache with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ResumeAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeAnywhereCache = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeAnywhereCache(request), expectedError); + const actualRequest = (client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.resumeAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes resumeAnywhereCache with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ResumeAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.resumeAnywhereCache(request), expectedError); + }); + }); + + describe('getAnywhereCache', () => { + it('invokes getAnywhereCache without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.getAnywhereCache = stubSimpleCall(expectedResponse); + const [response] = await client.getAnywhereCache(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getAnywhereCache without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.AnywhereCache() + ); + client.innerApiCalls.getAnywhereCache = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnywhereCache( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IAnywhereCache|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getAnywhereCache with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnywhereCache = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAnywhereCache(request), expectedError); + const actualRequest = (client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.getAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes getAnywhereCache with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetAnywhereCacheRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAnywhereCache(request), expectedError); + }); + }); + + describe('getProjectIntelligenceConfig', () => { + it('invokes getProjectIntelligenceConfig without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetProjectIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetProjectIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.getProjectIntelligenceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getProjectIntelligenceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProjectIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProjectIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProjectIntelligenceConfig without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetProjectIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetProjectIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.getProjectIntelligenceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProjectIntelligenceConfig( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IIntelligenceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProjectIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProjectIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProjectIntelligenceConfig with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetProjectIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetProjectIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProjectIntelligenceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProjectIntelligenceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getProjectIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProjectIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProjectIntelligenceConfig with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetProjectIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetProjectIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProjectIntelligenceConfig(request), expectedError); + }); + }); + + describe('updateProjectIntelligenceConfig', () => { + it('invokes updateProjectIntelligenceConfig without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.updateProjectIntelligenceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateProjectIntelligenceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateProjectIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProjectIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProjectIntelligenceConfig without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.updateProjectIntelligenceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProjectIntelligenceConfig( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IIntelligenceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateProjectIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProjectIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProjectIntelligenceConfig with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProjectIntelligenceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateProjectIntelligenceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateProjectIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateProjectIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProjectIntelligenceConfig with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateProjectIntelligenceConfig(request), expectedError); + }); + }); + + describe('getFolderIntelligenceConfig', () => { + it('invokes getFolderIntelligenceConfig without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetFolderIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.getFolderIntelligenceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getFolderIntelligenceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFolderIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFolderIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFolderIntelligenceConfig without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetFolderIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.getFolderIntelligenceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFolderIntelligenceConfig( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IIntelligenceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFolderIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFolderIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFolderIntelligenceConfig with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetFolderIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFolderIntelligenceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFolderIntelligenceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getFolderIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFolderIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFolderIntelligenceConfig with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetFolderIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetFolderIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getFolderIntelligenceConfig(request), expectedError); + }); + }); + + describe('updateFolderIntelligenceConfig', () => { + it('invokes updateFolderIntelligenceConfig without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.updateFolderIntelligenceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateFolderIntelligenceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFolderIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFolderIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFolderIntelligenceConfig without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.updateFolderIntelligenceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFolderIntelligenceConfig( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IIntelligenceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFolderIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFolderIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFolderIntelligenceConfig with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFolderIntelligenceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFolderIntelligenceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFolderIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFolderIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFolderIntelligenceConfig with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateFolderIntelligenceConfig(request), expectedError); + }); + }); + + describe('getOrganizationIntelligenceConfig', () => { + it('invokes getOrganizationIntelligenceConfig without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.getOrganizationIntelligenceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getOrganizationIntelligenceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationIntelligenceConfig without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.getOrganizationIntelligenceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOrganizationIntelligenceConfig( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IIntelligenceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationIntelligenceConfig with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganizationIntelligenceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOrganizationIntelligenceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganizationIntelligenceConfig with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getOrganizationIntelligenceConfig(request), expectedError); + }); + }); + + describe('updateOrganizationIntelligenceConfig', () => { + it('invokes updateOrganizationIntelligenceConfig without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.updateOrganizationIntelligenceConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateOrganizationIntelligenceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationIntelligenceConfig without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.storage.control.v2.IntelligenceConfig() + ); + client.innerApiCalls.updateOrganizationIntelligenceConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateOrganizationIntelligenceConfig( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IIntelligenceConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationIntelligenceConfig with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedHeaderRequestParams = `intelligence_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateOrganizationIntelligenceConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateOrganizationIntelligenceConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateOrganizationIntelligenceConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateOrganizationIntelligenceConfig with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest() + ); + request.intelligenceConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest', ['intelligenceConfig', 'name']); + request.intelligenceConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateOrganizationIntelligenceConfig(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/** + request.resource = 'projects/value/buckets/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/objects/** + request.resource = 'projects/value/buckets/value/objects/value'; + // path template: {bucket=projects/*/buckets/*}/managedFolders/** + request.resource = 'projects/value/buckets/value/managedFolders/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/objects/** + request.resource = 'projects/value/buckets/value/objects/value'; + // path template: {bucket=projects/*/buckets/*}/managedFolders/** + request.resource = 'projects/value/buckets/value/managedFolders/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/objects/** + request.resource = 'projects/value/buckets/value/objects/value'; + // path template: {bucket=projects/*/buckets/*}/managedFolders/** + request.resource = 'projects/value/buckets/value/managedFolders/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + // path template: {bucket=**} + request.resource = 'value'; + // path template: {bucket=projects/*/buckets/*}/objects/** + request.resource = 'projects/value/buckets/value/objects/value'; + // path template: {bucket=projects/*/buckets/*}/managedFolders/** + request.resource = 'projects/value/buckets/value/managedFolders/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('renameFolder', () => { + it('invokes renameFolder without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.RenameFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.renameFolder = stubLongRunningCall(expectedResponse); + const [operation] = await client.renameFolder(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes renameFolder without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.RenameFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.renameFolder = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.renameFolder( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes renameFolder with call error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.RenameFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.renameFolder = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.renameFolder(request), expectedError); + const actualRequest = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes renameFolder with LRO error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.RenameFolderRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.renameFolder = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.renameFolder(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.renameFolder as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes checkRenameFolderProgress without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.checkRenameFolderProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRenameFolderProgress with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRenameFolderProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFolderRecursive', () => { + it('invokes deleteFolderRecursive without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRecursiveRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFolderRecursive = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFolderRecursive(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteFolderRecursive without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRecursiveRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFolderRecursive = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFolderRecursive( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteFolderRecursive with call error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRecursiveRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFolderRecursive = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFolderRecursive(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes deleteFolderRecursive with LRO error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.DeleteFolderRecursiveRequest() + ); + // path template: {bucket=projects/*/buckets/*}/** + request.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFolderRecursive = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFolderRecursive(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.deleteFolderRecursive as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes checkDeleteFolderRecursiveProgress without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.checkDeleteFolderRecursiveProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFolderRecursiveProgress with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFolderRecursiveProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createAnywhereCache', () => { + it('invokes createAnywhereCache without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateAnywhereCacheRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAnywhereCache = stubLongRunningCall(expectedResponse); + const [operation] = await client.createAnywhereCache(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createAnywhereCache without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateAnywhereCacheRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAnywhereCache = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAnywhereCache( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createAnywhereCache with call error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateAnywhereCacheRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnywhereCache = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createAnywhereCache(request), expectedError); + const actualRequest = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes createAnywhereCache with LRO error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.CreateAnywhereCacheRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnywhereCache = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createAnywhereCache(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.createAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes checkCreateAnywhereCacheProgress without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.checkCreateAnywhereCacheProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAnywhereCacheProgress with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateAnywhereCacheProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateAnywhereCache', () => { + it('invokes updateAnywhereCache without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateAnywhereCacheRequest() + ); + request.anywhereCache = {}; + // path template: {bucket=projects/*/buckets/*}/** + request.anywhereCache.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAnywhereCache = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAnywhereCache(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes updateAnywhereCache without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateAnywhereCacheRequest() + ); + request.anywhereCache = {}; + // path template: {bucket=projects/*/buckets/*}/** + request.anywhereCache.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAnywhereCache = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAnywhereCache( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes updateAnywhereCache with call error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateAnywhereCacheRequest() + ); + request.anywhereCache = {}; + // path template: {bucket=projects/*/buckets/*}/** + request.anywhereCache.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnywhereCache = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateAnywhereCache(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes updateAnywhereCache with LRO error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.UpdateAnywhereCacheRequest() + ); + request.anywhereCache = {}; + // path template: {bucket=projects/*/buckets/*}/** + request.anywhereCache.name = 'projects/value/buckets/value/value'; + const expectedHeaderRequestParams = 'bucket=projects%2Fvalue%2Fbuckets%2Fvalue'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnywhereCache = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateAnywhereCache(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.updateAnywhereCache as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes checkUpdateAnywhereCacheProgress without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.checkUpdateAnywhereCacheProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAnywhereCacheProgress with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateAnywhereCacheProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listFolders', () => { + it('invokes listFolders without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + ]; + client.innerApiCalls.listFolders = stubSimpleCall(expectedResponse); + const [response] = await client.listFolders(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFolders as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFolders as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFolders without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + ]; + client.innerApiCalls.listFolders = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFolders( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IFolder[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFolders as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFolders as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFolders with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listFolders = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFolders(request), expectedError); + const actualRequest = (client.innerApiCalls.listFolders as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFolders as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFoldersStream without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + ]; + client.descriptors.page.listFolders.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.control.v2.Folder[] = []; + stream.on('data', (response: protos.google.storage.control.v2.Folder) => { + 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.listFolders.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFolders, request)); + assert( + (client.descriptors.page.listFolders.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFoldersStream with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listFolders.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.control.v2.Folder[] = []; + stream.on('data', (response: protos.google.storage.control.v2.Folder) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFolders.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFolders, request)); + assert( + (client.descriptors.page.listFolders.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFolders without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + generateSampleMessage(new protos.google.storage.control.v2.Folder()), + ]; + client.descriptors.page.listFolders.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storage.control.v2.IFolder[] = []; + const iterable = client.listFoldersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFolders.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFolders.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFolders with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listFolders.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFoldersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storage.control.v2.IFolder[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFolders.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFolders.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listManagedFolders', () => { + it('invokes listManagedFolders without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + ]; + client.innerApiCalls.listManagedFolders = stubSimpleCall(expectedResponse); + const [response] = await client.listManagedFolders(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes listManagedFolders without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + ]; + client.innerApiCalls.listManagedFolders = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listManagedFolders( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IManagedFolder[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes listManagedFolders with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listManagedFolders = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listManagedFolders(request), expectedError); + const actualRequest = (client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.listManagedFolders as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes listManagedFoldersStream without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + ]; + client.descriptors.page.listManagedFolders.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listManagedFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.control.v2.ManagedFolder[] = []; + stream.on('data', (response: protos.google.storage.control.v2.ManagedFolder) => { + 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.listManagedFolders.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listManagedFolders, request)); + assert( + (client.descriptors.page.listManagedFolders.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listManagedFoldersStream with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listManagedFolders.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listManagedFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.control.v2.ManagedFolder[] = []; + stream.on('data', (response: protos.google.storage.control.v2.ManagedFolder) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listManagedFolders.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listManagedFolders, request)); + assert( + (client.descriptors.page.listManagedFolders.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagedFolders without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + generateSampleMessage(new protos.google.storage.control.v2.ManagedFolder()), + ]; + client.descriptors.page.listManagedFolders.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storage.control.v2.IManagedFolder[] = []; + const iterable = client.listManagedFoldersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listManagedFolders.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listManagedFolders.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + assert.match((client.descriptors.page.listManagedFolders.asyncIterate as SinonStub) + .getCall(0).args[1].requestId, /[a-z0-9-]{36}/) + }); + + it('uses async iteration with listManagedFolders with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListManagedFoldersRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listManagedFolders.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listManagedFoldersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storage.control.v2.IManagedFolder[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listManagedFolders.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listManagedFolders.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + assert.match((client.descriptors.page.listManagedFolders.asyncIterate as SinonStub) + .getCall(0).args[1].requestId, /[a-z0-9-]{36}/) + }); + }); + + describe('listAnywhereCaches', () => { + it('invokes listAnywhereCaches without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + ]; + client.innerApiCalls.listAnywhereCaches = stubSimpleCall(expectedResponse); + const [response] = await client.listAnywhereCaches(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes listAnywhereCaches without error using callback', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + ]; + client.innerApiCalls.listAnywhereCaches = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnywhereCaches( + request, + (err?: Error|null, result?: protos.google.storage.control.v2.IAnywhereCache[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes listAnywhereCaches with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnywhereCaches = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAnywhereCaches(request), expectedError); + const actualRequest = (client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert.match((client.innerApiCalls.listAnywhereCaches as SinonStub) + .getCall(0).args[0].requestId, /[a-z0-9-]{36}/) + }); + + it('invokes listAnywhereCachesStream without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + ]; + client.descriptors.page.listAnywhereCaches.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAnywhereCachesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.control.v2.AnywhereCache[] = []; + stream.on('data', (response: protos.google.storage.control.v2.AnywhereCache) => { + 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.listAnywhereCaches.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnywhereCaches, request)); + assert( + (client.descriptors.page.listAnywhereCaches.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAnywhereCachesStream with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listAnywhereCaches.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnywhereCachesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.control.v2.AnywhereCache[] = []; + stream.on('data', (response: protos.google.storage.control.v2.AnywhereCache) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAnywhereCaches.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnywhereCaches, request)); + assert( + (client.descriptors.page.listAnywhereCaches.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnywhereCaches without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + generateSampleMessage(new protos.google.storage.control.v2.AnywhereCache()), + ]; + client.descriptors.page.listAnywhereCaches.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storage.control.v2.IAnywhereCache[] = []; + const iterable = client.listAnywhereCachesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAnywhereCaches.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAnywhereCaches.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + assert.match((client.descriptors.page.listAnywhereCaches.asyncIterate as SinonStub) + .getCall(0).args[1].requestId, /[a-z0-9-]{36}/) + }); + + it('uses async iteration with listAnywhereCaches with error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.control.v2.ListAnywhereCachesRequest() + ); + // path template: {bucket=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listAnywhereCaches.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnywhereCachesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storage.control.v2.IAnywhereCache[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAnywhereCaches.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAnywhereCaches.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + assert.match((client.descriptors.page.listAnywhereCaches.asyncIterate as SinonStub) + .getCall(0).args[1].requestId, /[a-z0-9-]{36}/) + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 storagecontrolModule.v2.StorageControlClient({ + 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); + } + }).catch(err => {throw err}); + }); + 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 storagecontrolModule.v2.StorageControlClient({ + 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 storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 storagecontrolModule.v2.StorageControlClient({ + 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); + } + }).catch(err => {throw err}); + }); + 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 storagecontrolModule.v2.StorageControlClient({ + 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 storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 storagecontrolModule.v2.StorageControlClient({ + 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); + } + }).catch(err => {throw err}); + }); + 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 storagecontrolModule.v2.StorageControlClient({ + 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 storagecontrolModule.v2.StorageControlClient({ + 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.IOperation[] = []; + 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 storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.IOperation[] = []; + 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('anywhereCache', async () => { + const fakePath = "/rendered/path/anywhereCache"; + const expectedParameters = { + project: "projectValue", + bucket: "bucketValue", + anywhere_cache: "anywhereCacheValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.anywhereCachePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.anywhereCachePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('anywhereCachePath', () => { + const result = client.anywhereCachePath("projectValue", "bucketValue", "anywhereCacheValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.anywhereCachePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnywhereCacheName', () => { + const result = client.matchProjectFromAnywhereCacheName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.anywhereCachePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBucketFromAnywhereCacheName', () => { + const result = client.matchBucketFromAnywhereCacheName(fakePath); + assert.strictEqual(result, "bucketValue"); + assert((client.pathTemplates.anywhereCachePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnywhereCacheFromAnywhereCacheName', () => { + const result = client.matchAnywhereCacheFromAnywhereCacheName(fakePath); + assert.strictEqual(result, "anywhereCacheValue"); + assert((client.pathTemplates.anywhereCachePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('bucket', async () => { + const fakePath = "/rendered/path/bucket"; + const expectedParameters = { + project: "projectValue", + bucket: "bucketValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.bucketPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.bucketPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('bucketPath', () => { + const result = client.bucketPath("projectValue", "bucketValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.bucketPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBucketName', () => { + const result = client.matchProjectFromBucketName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.bucketPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBucketFromBucketName', () => { + const result = client.matchBucketFromBucketName(fakePath); + assert.strictEqual(result, "bucketValue"); + assert((client.pathTemplates.bucketPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folder', async () => { + const fakePath = "/rendered/path/folder"; + const expectedParameters = { + project: "projectValue", + bucket: "bucketValue", + folder: "folderValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath("projectValue", "bucketValue", "folderValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFolderName', () => { + const result = client.matchProjectFromFolderName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBucketFromFolderName', () => { + const result = client.matchBucketFromFolderName(fakePath); + assert.strictEqual(result, "bucketValue"); + assert((client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderLocationIntelligenceConfig', async () => { + const fakePath = "/rendered/path/folderLocationIntelligenceConfig"; + const expectedParameters = { + folder: "folderValue", + location: "locationValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationIntelligenceConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationIntelligenceConfigPath', () => { + const result = client.folderLocationIntelligenceConfigPath("folderValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderLocationIntelligenceConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderLocationIntelligenceConfigName', () => { + const result = client.matchFolderFromFolderLocationIntelligenceConfigName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFolderLocationIntelligenceConfigName', () => { + const result = client.matchLocationFromFolderLocationIntelligenceConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('managedFolder', async () => { + const fakePath = "/rendered/path/managedFolder"; + const expectedParameters = { + project: "projectValue", + bucket: "bucketValue", + managed_folder: "managedFolderValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.managedFolderPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.managedFolderPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('managedFolderPath', () => { + const result = client.managedFolderPath("projectValue", "bucketValue", "managedFolderValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.managedFolderPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromManagedFolderName', () => { + const result = client.matchProjectFromManagedFolderName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.managedFolderPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBucketFromManagedFolderName', () => { + const result = client.matchBucketFromManagedFolderName(fakePath); + assert.strictEqual(result, "bucketValue"); + assert((client.pathTemplates.managedFolderPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchManagedFolderFromManagedFolderName', () => { + const result = client.matchManagedFolderFromManagedFolderName(fakePath); + assert.strictEqual(result, "managedFolderValue"); + assert((client.pathTemplates.managedFolderPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('orgLocationIntelligenceConfig', async () => { + const fakePath = "/rendered/path/orgLocationIntelligenceConfig"; + const expectedParameters = { + org: "orgValue", + location: "locationValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.orgLocationIntelligenceConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('orgLocationIntelligenceConfigPath', () => { + const result = client.orgLocationIntelligenceConfigPath("orgValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.orgLocationIntelligenceConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrgFromOrgLocationIntelligenceConfigName', () => { + const result = client.matchOrgFromOrgLocationIntelligenceConfigName(fakePath); + assert.strictEqual(result, "orgValue"); + assert((client.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrgLocationIntelligenceConfigName', () => { + const result = client.matchLocationFromOrgLocationIntelligenceConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationIntelligenceConfig', async () => { + const fakePath = "/rendered/path/projectLocationIntelligenceConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationIntelligenceConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationIntelligenceConfigPath', () => { + const result = client.projectLocationIntelligenceConfigPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationIntelligenceConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationIntelligenceConfigName', () => { + const result = client.matchProjectFromProjectLocationIntelligenceConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationIntelligenceConfigName', () => { + const result = client.matchLocationFromProjectLocationIntelligenceConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('storageLayout', async () => { + const fakePath = "/rendered/path/storageLayout"; + const expectedParameters = { + project: "projectValue", + bucket: "bucketValue", + }; + const client = new storagecontrolModule.v2.StorageControlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.storageLayoutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.storageLayoutPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('storageLayoutPath', () => { + const result = client.storageLayoutPath("projectValue", "bucketValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.storageLayoutPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStorageLayoutName', () => { + const result = client.matchProjectFromStorageLayoutName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.storageLayoutPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBucketFromStorageLayoutName', () => { + const result = client.matchBucketFromStorageLayoutName(fakePath); + assert.strictEqual(result, "bucketValue"); + assert((client.pathTemplates.storageLayoutPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-storage-control/test/gapic_storage_v2.ts b/owl-bot-staging/google-storage-control/test/gapic_storage_v2.ts new file mode 100644 index 00000000000..09d90a95b04 --- /dev/null +++ b/owl-bot-staging/google-storage-control/test/gapic_storage_v2.ts @@ -0,0 +1,1160 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 storageModule 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.StorageClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new storageModule.v2.StorageClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'storage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new storageModule.v2.StorageClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = storageModule.v2.StorageClient.servicePath; + assert.strictEqual(servicePath, 'storage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = storageModule.v2.StorageClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'storage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new storageModule.v2.StorageClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new storageModule.v2.StorageClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new storageModule.v2.StorageClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new storageModule.v2.StorageClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'storage.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new storageModule.v2.StorageClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = storageModule.v2.StorageClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new storageModule.v2.StorageClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new storageModule.v2.StorageClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageStub, undefined); + await client.initialize(); + assert(client.storageStub); + }); + + it('has close method for the initialized client', done => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.storageStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new storageModule.v2.StorageClient({ + 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 storageModule.v2.StorageClient({ + 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('deleteBucket', () => { + it('invokes deleteBucket without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.DeleteBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBucket = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBucket without error using callback', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.DeleteBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBucket = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBucket( + 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.deleteBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBucket with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.DeleteBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBucket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteBucket(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBucket with closed client', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.DeleteBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteBucket(request), expectedError); + }); + }); + + describe('getBucket', () => { + it('invokes getBucket without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.GetBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.getBucket = stubSimpleCall(expectedResponse); + const [response] = await client.getBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBucket without error using callback', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.GetBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.getBucket = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBucket( + request, + (err?: Error|null, result?: protos.google.storage.v2.IBucket|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBucket with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.GetBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.getBucket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBucket(request), expectedError); + const actualRequest = (client.innerApiCalls.getBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBucket with closed client', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.GetBucketRequest() + ); + // path template: {bucket=**} + request.name = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBucket(request), expectedError); + }); + }); + + describe('createBucket', () => { + it('invokes createBucket without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.CreateBucketRequest() + ); + // path template: {project=**} + request.parent = 'value'; + request.bucket = {}; + // path template: {project=**} + request.bucket.project = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.createBucket = stubSimpleCall(expectedResponse); + const [response] = await client.createBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucket without error using callback', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.CreateBucketRequest() + ); + // path template: {project=**} + request.parent = 'value'; + request.bucket = {}; + // path template: {project=**} + request.bucket.project = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.createBucket = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBucket( + request, + (err?: Error|null, result?: protos.google.storage.v2.IBucket|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucket with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.CreateBucketRequest() + ); + // path template: {project=**} + request.parent = 'value'; + request.bucket = {}; + // path template: {project=**} + request.bucket.project = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createBucket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createBucket(request), expectedError); + const actualRequest = (client.innerApiCalls.createBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucket with closed client', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.CreateBucketRequest() + ); + // path template: {project=**} + request.parent = 'value'; + request.bucket = {}; + // path template: {project=**} + request.bucket.project = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createBucket(request), expectedError); + }); + }); + + describe('lockBucketRetentionPolicy', () => { + it('invokes lockBucketRetentionPolicy without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.LockBucketRetentionPolicyRequest() + ); + // path template: {bucket=**} + request.bucket = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.lockBucketRetentionPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.lockBucketRetentionPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lockBucketRetentionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lockBucketRetentionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lockBucketRetentionPolicy without error using callback', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.LockBucketRetentionPolicyRequest() + ); + // path template: {bucket=**} + request.bucket = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.lockBucketRetentionPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lockBucketRetentionPolicy( + request, + (err?: Error|null, result?: protos.google.storage.v2.IBucket|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lockBucketRetentionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lockBucketRetentionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lockBucketRetentionPolicy with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.LockBucketRetentionPolicyRequest() + ); + // path template: {bucket=**} + request.bucket = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.lockBucketRetentionPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lockBucketRetentionPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.lockBucketRetentionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lockBucketRetentionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lockBucketRetentionPolicy with closed client', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.LockBucketRetentionPolicyRequest() + ); + // path template: {bucket=**} + request.bucket = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.lockBucketRetentionPolicy(request), expectedError); + }); + }); + + describe('updateBucket', () => { + it('invokes updateBucket without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.UpdateBucketRequest() + ); + request.bucket = {}; + // path template: {bucket=**} + request.bucket.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.updateBucket = stubSimpleCall(expectedResponse); + const [response] = await client.updateBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucket without error using callback', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.UpdateBucketRequest() + ); + request.bucket = {}; + // path template: {bucket=**} + request.bucket.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedResponse = generateSampleMessage( + new protos.google.storage.v2.Bucket() + ); + client.innerApiCalls.updateBucket = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBucket( + request, + (err?: Error|null, result?: protos.google.storage.v2.IBucket|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucket with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.UpdateBucketRequest() + ); + request.bucket = {}; + // path template: {bucket=**} + request.bucket.name = 'value'; + const expectedHeaderRequestParams = 'bucket=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBucket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateBucket(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBucket as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBucket as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucket with closed client', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.UpdateBucketRequest() + ); + request.bucket = {}; + // path template: {bucket=**} + request.bucket.name = 'value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateBucket(request), expectedError); + }); + }); + + describe('listBuckets', () => { + it('invokes listBuckets without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + ]; + client.innerApiCalls.listBuckets = stubSimpleCall(expectedResponse); + const [response] = await client.listBuckets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBuckets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBuckets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuckets without error using callback', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value';const expectedResponse = [ + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + ]; + client.innerApiCalls.listBuckets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBuckets( + request, + (err?: Error|null, result?: protos.google.storage.v2.IBucket[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBuckets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBuckets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuckets with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listBuckets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBuckets(request), expectedError); + const actualRequest = (client.innerApiCalls.listBuckets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBuckets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBucketsStream without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + ]; + client.descriptors.page.listBuckets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBucketsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.v2.Bucket[] = []; + stream.on('data', (response: protos.google.storage.v2.Bucket) => { + 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.listBuckets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBuckets, request)); + assert( + (client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBucketsStream with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listBuckets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBucketsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storage.v2.Bucket[] = []; + stream.on('data', (response: protos.google.storage.v2.Bucket) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBuckets, request)); + assert( + (client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBuckets without error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + generateSampleMessage(new protos.google.storage.v2.Bucket()), + ]; + client.descriptors.page.listBuckets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storage.v2.IBucket[] = []; + const iterable = client.listBucketsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBuckets with error', async () => { + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.storage.v2.ListBucketsRequest() + ); + // path template: {project=**} + request.parent = 'value'; + const expectedHeaderRequestParams = 'project=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listBuckets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBucketsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storage.v2.IBucket[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('bucket', async () => { + const fakePath = "/rendered/path/bucket"; + const expectedParameters = { + project: "projectValue", + bucket: "bucketValue", + }; + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.bucketPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.bucketPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('bucketPath', () => { + const result = client.bucketPath("projectValue", "bucketValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.bucketPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBucketName', () => { + const result = client.matchProjectFromBucketName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.bucketPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBucketFromBucketName', () => { + const result = client.matchBucketFromBucketName(fakePath); + assert.strictEqual(result, "bucketValue"); + assert((client.pathTemplates.bucketPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new storageModule.v2.StorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-storage-control/tsconfig.json b/owl-bot-staging/google-storage-control/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-storage-control/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-storage-control/webpack.config.js b/owl-bot-staging/google-storage-control/webpack.config.js new file mode 100644 index 00000000000..6d961022fce --- /dev/null +++ b/owl-bot-staging/google-storage-control/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: 'StorageControl', + filename: './storage-control.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 3e12af93b7b8e0259a380004af87785dc5036d21 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 8 Apr 2026 18:18:31 +0000 Subject: [PATCH 2/2] chore: migrate generator to google-cloud-node chore: update generator system tests PiperOrigin-RevId: 896174961 Source-Link: https://github.com/googleapis/googleapis/commit/2233f63baf69c2a481f30180045fcf036242781d Source-Link: https://github.com/googleapis/googleapis-gen/commit/c4a8c4eef959aa744fb1c6714875fa295e06aad3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXN0b3JhZ2UtY29udHJvbC8uT3dsQm90LnlhbWwiLCJoIjoiYzRhOGM0ZWVmOTU5YWE3NDRmYjFjNjcxNDg3NWZhMjk1ZTA2YWFkMyJ9 --- owl-bot-staging/google-storage-control/.eslintrc.json | 3 ++- owl-bot-staging/google-storage-control/system-test/install.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/owl-bot-staging/google-storage-control/.eslintrc.json b/owl-bot-staging/google-storage-control/.eslintrc.json index 78215349546..3e8d97ccb39 100644 --- a/owl-bot-staging/google-storage-control/.eslintrc.json +++ b/owl-bot-staging/google-storage-control/.eslintrc.json @@ -1,3 +1,4 @@ { - "extends": "./node_modules/gts" + "extends": "./node_modules/gts", + "root": true } diff --git a/owl-bot-staging/google-storage-control/system-test/install.ts b/owl-bot-staging/google-storage-control/system-test/install.ts index 394f3362d20..f66069aa394 100644 --- a/owl-bot-staging/google-storage-control/system-test/install.ts +++ b/owl-bot-staging/google-storage-control/system-test/install.ts @@ -40,7 +40,7 @@ describe('📦 pack-n-play test', () => { packageDir: process.cwd(), sample: { description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + cjs: readFileSync('./system-test/fixtures/sample/src/index.js').toString() } }; await packNTest(options);