diff --git a/librarian.yaml b/librarian.yaml index 00b71e76dcee..ea321933238c 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -2006,9 +2006,17 @@ libraries: - name: google-storage-control version: 0.10.0 apis: + - path: google/storage/v2 - path: google/storage/control/v2 copyright_year: "2026" - skip_generate: true + keep: + - src/util/ast_utils.ts + - src/util/index_fix_utils.ts + - src/util/proto_utils.ts + - src/util/samples_and_doc_fix_utils.ts + - src/util/storage_control_utils.ts + - src/util/uber_client_builder.ts + - test/storage_control_compatibility.ts nodejs: default_version: v2 package_name: '@google-cloud/storage-control' diff --git a/packages/google-storage-control/.OwlBot.yaml b/packages/google-storage-control/.OwlBot.yaml deleted file mode 100644 index 688844a25c13..000000000000 --- a/packages/google-storage-control/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# 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/packages/google-storage-control/.gitattributes b/packages/google-storage-control/.gitattributes deleted file mode 100644 index 33739cb74e44..000000000000 --- a/packages/google-storage-control/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-storage-control/.repo-metadata.json b/packages/google-storage-control/.repo-metadata.json index d2cc18fb57ce..294d7fc08720 100644 --- a/packages/google-storage-control/.repo-metadata.json +++ b/packages/google-storage-control/.repo-metadata.json @@ -1,17 +1,16 @@ { - "name": "storage", - "name_pretty": "Cloud Storage API", - "product_documentation": "https://cloud.google.com/storage/docs/reference/rpc", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/storage-control/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "stable", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-cloud/storage-control", - "api_id": "storage.googleapis.com", - "default_version": "v2", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "storage" -} - + "api_description": "Lets you store and retrieve potentially-large, immutable data objects.", + "api_id": "storage.googleapis.com", + "api_shortname": "storage", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/storage-control/latest", + "default_version": "v2", + "distribution_name": "@google-cloud/storage-control", + "issue_tracker": "https://issuetracker.google.com/issues/new?component=187243&template=1162869", + "language": "nodejs", + "library_type": "GAPIC_AUTO", + "name": "storage", + "name_pretty": "Cloud Storage", + "product_documentation": "https://cloud.google.com/storage/docs", + "release_level": "preview", + "repo": "googleapis/google-cloud-node" +} \ No newline at end of file diff --git a/packages/google-storage-control/CODE_OF_CONDUCT.md b/packages/google-storage-control/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a812..000000000000 --- a/packages/google-storage-control/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-storage-control/CONTRIBUTING.md b/packages/google-storage-control/CONTRIBUTING.md deleted file mode 100644 index 09c4066f4293..000000000000 --- a/packages/google-storage-control/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# 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/packages/google-storage-control/LICENSE b/packages/google-storage-control/LICENSE deleted file mode 100644 index d64569567334..000000000000 --- a/packages/google-storage-control/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/google-storage-control/librarian.js b/packages/google-storage-control/librarian.js index 3656f8e87fb2..b9cc1b6e9bc0 100644 --- a/packages/google-storage-control/librarian.js +++ b/packages/google-storage-control/librarian.js @@ -20,7 +20,9 @@ const packageRoot = __dirname; const utilDir = path.join(packageRoot, 'src', 'util'); try { - execSync('npm install', {cwd: packageRoot, stdio: 'inherit'}); + // --ignore-scripts: prevents recursive build loops and race conditions (stops npm from running the "prepare" script). + // --cache=/tmp/npm-cache: redirects cache to a writable directory, avoiding permission crashes in non-root Docker environments. + execSync('npm install --ignore-scripts --cache=/tmp/npm-cache', {cwd: packageRoot, stdio: 'inherit'}); const tscPath = path.join(packageRoot, 'node_modules', '.bin', 'tsc'); execSync(`${tscPath} src/util/storage_control_utils.ts`, { diff --git a/packages/google-storage-control/protos/protos.js b/packages/google-storage-control/protos/protos.js index 45084309d156..c72a3114140a 100644 --- a/packages/google-storage-control/protos/protos.js +++ b/packages/google-storage-control/protos/protos.js @@ -28,7 +28,7 @@ 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"] = {}); + var $root = $protobuf.roots._google_cloud_storage_control_protos || ($protobuf.roots._google_cloud_storage_control_protos = {}); $root.google = (function() { @@ -118,7 +118,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.createFolder = function createFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, createFolder, $root.google.storage.control.v2.CreateFolderRequest, $root.google.storage.control.v2.Folder, request, callback); + return this.rpcCall(createFolder, $root.google.storage.control.v2.CreateFolderRequest, $root.google.storage.control.v2.Folder, request, callback); }, "name", { value: "CreateFolder" }); /** @@ -151,7 +151,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.deleteFolder = function deleteFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteFolder, $root.google.storage.control.v2.DeleteFolderRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteFolder, $root.google.storage.control.v2.DeleteFolderRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteFolder" }); /** @@ -184,7 +184,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getFolder = function getFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getFolder, $root.google.storage.control.v2.GetFolderRequest, $root.google.storage.control.v2.Folder, request, callback); + return this.rpcCall(getFolder, $root.google.storage.control.v2.GetFolderRequest, $root.google.storage.control.v2.Folder, request, callback); }, "name", { value: "GetFolder" }); /** @@ -217,7 +217,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.listFolders = function listFolders(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listFolders, $root.google.storage.control.v2.ListFoldersRequest, $root.google.storage.control.v2.ListFoldersResponse, request, callback); + return this.rpcCall(listFolders, $root.google.storage.control.v2.ListFoldersRequest, $root.google.storage.control.v2.ListFoldersResponse, request, callback); }, "name", { value: "ListFolders" }); /** @@ -250,7 +250,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.renameFolder = function renameFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, renameFolder, $root.google.storage.control.v2.RenameFolderRequest, $root.google.longrunning.Operation, request, callback); + return this.rpcCall(renameFolder, $root.google.storage.control.v2.RenameFolderRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "RenameFolder" }); /** @@ -283,7 +283,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.deleteFolderRecursive = function deleteFolderRecursive(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteFolderRecursive, $root.google.storage.control.v2.DeleteFolderRecursiveRequest, $root.google.longrunning.Operation, request, callback); + return this.rpcCall(deleteFolderRecursive, $root.google.storage.control.v2.DeleteFolderRecursiveRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "DeleteFolderRecursive" }); /** @@ -316,7 +316,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getStorageLayout = function getStorageLayout(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getStorageLayout, $root.google.storage.control.v2.GetStorageLayoutRequest, $root.google.storage.control.v2.StorageLayout, request, callback); + return this.rpcCall(getStorageLayout, $root.google.storage.control.v2.GetStorageLayoutRequest, $root.google.storage.control.v2.StorageLayout, request, callback); }, "name", { value: "GetStorageLayout" }); /** @@ -349,7 +349,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.createManagedFolder = function createManagedFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, createManagedFolder, $root.google.storage.control.v2.CreateManagedFolderRequest, $root.google.storage.control.v2.ManagedFolder, request, callback); + return this.rpcCall(createManagedFolder, $root.google.storage.control.v2.CreateManagedFolderRequest, $root.google.storage.control.v2.ManagedFolder, request, callback); }, "name", { value: "CreateManagedFolder" }); /** @@ -382,7 +382,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.deleteManagedFolder = function deleteManagedFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteManagedFolder, $root.google.storage.control.v2.DeleteManagedFolderRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteManagedFolder, $root.google.storage.control.v2.DeleteManagedFolderRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteManagedFolder" }); /** @@ -415,7 +415,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getManagedFolder = function getManagedFolder(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getManagedFolder, $root.google.storage.control.v2.GetManagedFolderRequest, $root.google.storage.control.v2.ManagedFolder, request, callback); + return this.rpcCall(getManagedFolder, $root.google.storage.control.v2.GetManagedFolderRequest, $root.google.storage.control.v2.ManagedFolder, request, callback); }, "name", { value: "GetManagedFolder" }); /** @@ -448,7 +448,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.listManagedFolders = function listManagedFolders(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listManagedFolders, $root.google.storage.control.v2.ListManagedFoldersRequest, $root.google.storage.control.v2.ListManagedFoldersResponse, request, callback); + return this.rpcCall(listManagedFolders, $root.google.storage.control.v2.ListManagedFoldersRequest, $root.google.storage.control.v2.ListManagedFoldersResponse, request, callback); }, "name", { value: "ListManagedFolders" }); /** @@ -481,7 +481,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.createAnywhereCache = function createAnywhereCache(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, createAnywhereCache, $root.google.storage.control.v2.CreateAnywhereCacheRequest, $root.google.longrunning.Operation, request, callback); + return this.rpcCall(createAnywhereCache, $root.google.storage.control.v2.CreateAnywhereCacheRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateAnywhereCache" }); /** @@ -514,7 +514,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.updateAnywhereCache = function updateAnywhereCache(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateAnywhereCache, $root.google.storage.control.v2.UpdateAnywhereCacheRequest, $root.google.longrunning.Operation, request, callback); + return this.rpcCall(updateAnywhereCache, $root.google.storage.control.v2.UpdateAnywhereCacheRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateAnywhereCache" }); /** @@ -547,7 +547,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.disableAnywhereCache = function disableAnywhereCache(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, disableAnywhereCache, $root.google.storage.control.v2.DisableAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + return this.rpcCall(disableAnywhereCache, $root.google.storage.control.v2.DisableAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); }, "name", { value: "DisableAnywhereCache" }); /** @@ -580,7 +580,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.pauseAnywhereCache = function pauseAnywhereCache(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, pauseAnywhereCache, $root.google.storage.control.v2.PauseAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + return this.rpcCall(pauseAnywhereCache, $root.google.storage.control.v2.PauseAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); }, "name", { value: "PauseAnywhereCache" }); /** @@ -613,7 +613,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.resumeAnywhereCache = function resumeAnywhereCache(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, resumeAnywhereCache, $root.google.storage.control.v2.ResumeAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + return this.rpcCall(resumeAnywhereCache, $root.google.storage.control.v2.ResumeAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); }, "name", { value: "ResumeAnywhereCache" }); /** @@ -646,7 +646,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getAnywhereCache = function getAnywhereCache(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getAnywhereCache, $root.google.storage.control.v2.GetAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); + return this.rpcCall(getAnywhereCache, $root.google.storage.control.v2.GetAnywhereCacheRequest, $root.google.storage.control.v2.AnywhereCache, request, callback); }, "name", { value: "GetAnywhereCache" }); /** @@ -679,7 +679,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.listAnywhereCaches = function listAnywhereCaches(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listAnywhereCaches, $root.google.storage.control.v2.ListAnywhereCachesRequest, $root.google.storage.control.v2.ListAnywhereCachesResponse, request, callback); + return this.rpcCall(listAnywhereCaches, $root.google.storage.control.v2.ListAnywhereCachesRequest, $root.google.storage.control.v2.ListAnywhereCachesResponse, request, callback); }, "name", { value: "ListAnywhereCaches" }); /** @@ -712,7 +712,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getProjectIntelligenceConfig = function getProjectIntelligenceConfig(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getProjectIntelligenceConfig, $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + return this.rpcCall(getProjectIntelligenceConfig, $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); }, "name", { value: "GetProjectIntelligenceConfig" }); /** @@ -745,7 +745,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.updateProjectIntelligenceConfig = function updateProjectIntelligenceConfig(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateProjectIntelligenceConfig, $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + return this.rpcCall(updateProjectIntelligenceConfig, $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); }, "name", { value: "UpdateProjectIntelligenceConfig" }); /** @@ -778,7 +778,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getFolderIntelligenceConfig = function getFolderIntelligenceConfig(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getFolderIntelligenceConfig, $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + return this.rpcCall(getFolderIntelligenceConfig, $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); }, "name", { value: "GetFolderIntelligenceConfig" }); /** @@ -811,7 +811,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.updateFolderIntelligenceConfig = function updateFolderIntelligenceConfig(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateFolderIntelligenceConfig, $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + return this.rpcCall(updateFolderIntelligenceConfig, $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); }, "name", { value: "UpdateFolderIntelligenceConfig" }); /** @@ -844,7 +844,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getOrganizationIntelligenceConfig = function getOrganizationIntelligenceConfig(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getOrganizationIntelligenceConfig, $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + return this.rpcCall(getOrganizationIntelligenceConfig, $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); }, "name", { value: "GetOrganizationIntelligenceConfig" }); /** @@ -877,7 +877,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.updateOrganizationIntelligenceConfig = function updateOrganizationIntelligenceConfig(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateOrganizationIntelligenceConfig, $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); + return this.rpcCall(updateOrganizationIntelligenceConfig, $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest, $root.google.storage.control.v2.IntelligenceConfig, request, callback); }, "name", { value: "UpdateOrganizationIntelligenceConfig" }); /** @@ -910,7 +910,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** @@ -943,7 +943,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** @@ -976,7 +976,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** @@ -1009,7 +1009,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getIntelligenceFinding = function getIntelligenceFinding(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIntelligenceFinding, $root.google.storage.control.v2.GetIntelligenceFindingRequest, $root.google.storage.control.v2.IntelligenceFinding, request, callback); + return this.rpcCall(getIntelligenceFinding, $root.google.storage.control.v2.GetIntelligenceFindingRequest, $root.google.storage.control.v2.IntelligenceFinding, request, callback); }, "name", { value: "GetIntelligenceFinding" }); /** @@ -1042,7 +1042,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.listIntelligenceFindings = function listIntelligenceFindings(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listIntelligenceFindings, $root.google.storage.control.v2.ListIntelligenceFindingsRequest, $root.google.storage.control.v2.ListIntelligenceFindingsResponse, request, callback); + return this.rpcCall(listIntelligenceFindings, $root.google.storage.control.v2.ListIntelligenceFindingsRequest, $root.google.storage.control.v2.ListIntelligenceFindingsResponse, request, callback); }, "name", { value: "ListIntelligenceFindings" }); /** @@ -1075,7 +1075,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.summarizeIntelligenceFindings = function summarizeIntelligenceFindings(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, summarizeIntelligenceFindings, $root.google.storage.control.v2.SummarizeIntelligenceFindingsRequest, $root.google.storage.control.v2.SummarizeIntelligenceFindingsResponse, request, callback); + return this.rpcCall(summarizeIntelligenceFindings, $root.google.storage.control.v2.SummarizeIntelligenceFindingsRequest, $root.google.storage.control.v2.SummarizeIntelligenceFindingsResponse, request, callback); }, "name", { value: "SummarizeIntelligenceFindings" }); /** @@ -1108,7 +1108,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.getIntelligenceFindingRevision = function getIntelligenceFindingRevision(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIntelligenceFindingRevision, $root.google.storage.control.v2.GetIntelligenceFindingRevisionRequest, $root.google.storage.control.v2.IntelligenceFindingRevision, request, callback); + return this.rpcCall(getIntelligenceFindingRevision, $root.google.storage.control.v2.GetIntelligenceFindingRevisionRequest, $root.google.storage.control.v2.IntelligenceFindingRevision, request, callback); }, "name", { value: "GetIntelligenceFindingRevision" }); /** @@ -1141,7 +1141,7 @@ * @variation 1 */ Object.defineProperty(StorageControl.prototype.listIntelligenceFindingRevisions = function listIntelligenceFindingRevisions(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listIntelligenceFindingRevisions, $root.google.storage.control.v2.ListIntelligenceFindingRevisionsRequest, $root.google.storage.control.v2.ListIntelligenceFindingRevisionsResponse, request, callback); + return this.rpcCall(listIntelligenceFindingRevisions, $root.google.storage.control.v2.ListIntelligenceFindingRevisionsRequest, $root.google.storage.control.v2.ListIntelligenceFindingRevisionsResponse, request, callback); }, "name", { value: "ListIntelligenceFindingRevisions" }); /** @@ -1210,13 +1210,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PendingRenameInfo.encode = function encode(message, writer, q) { + PendingRenameInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); return writer; @@ -1232,7 +1228,7 @@ * @returns {$protobuf.Writer} Writer */ PendingRenameInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -1302,7 +1298,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + if (message.operation != null && message.hasOwnProperty("operation")) if (!$util.isString(message.operation)) return "operation: string expected"; return null; @@ -1319,8 +1315,6 @@ PendingRenameInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.PendingRenameInfo) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.PendingRenameInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1340,17 +1334,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PendingRenameInfo.toObject = function toObject(message, options, q) { + PendingRenameInfo.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.operation = ""; - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + if (message.operation != null && message.hasOwnProperty("operation")) object.operation = message.operation; return object; }; @@ -1473,23 +1463,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Folder.encode = function encode(message, writer, q) { + Folder.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.control.v2.PendingRenameInfo.encode(message.pendingRenameInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -1503,7 +1489,7 @@ * @returns {$protobuf.Writer} Writer */ Folder.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -1589,23 +1575,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + 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 && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.pendingRenameInfo != null && Object.hasOwnProperty.call(message, "pendingRenameInfo")) { + if (message.pendingRenameInfo != null && message.hasOwnProperty("pendingRenameInfo")) { var error = $root.google.storage.control.v2.PendingRenameInfo.verify(message.pendingRenameInfo, long + 1); if (error) return "pendingRenameInfo." + error; @@ -1624,8 +1610,6 @@ Folder.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.Folder) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.Folder: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1635,7 +1619,7 @@ message.name = String(object.name); if (object.metageneration != null) if ($util.Long) - message.metageneration = $util.Long.fromValue(object.metageneration, false); + (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") @@ -1643,17 +1627,17 @@ 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 (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.Folder.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.Folder.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } if (object.pendingRenameInfo != null) { - if (!$util.isObject(object.pendingRenameInfo)) + 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, long + 1); } @@ -1669,40 +1653,34 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Folder.toObject = function toObject(message, options, q) { + Folder.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.metageneration = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.metageneration = options.longs === String ? "0" : 0; object.createTime = null; object.updateTime = null; object.pendingRenameInfo = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.metageneration = typeof message.metageneration === "number" ? BigInt(message.metageneration) : $util.Long.fromBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0, false).toBigInt(); - else if (typeof message.metageneration === "number") + 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 && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.pendingRenameInfo != null && Object.hasOwnProperty.call(message, "pendingRenameInfo")) - object.pendingRenameInfo = $root.google.storage.control.v2.PendingRenameInfo.toObject(message.pendingRenameInfo, options, q + 1); + 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; }; @@ -1830,13 +1808,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFolderRequest.encode = function encode(message, writer, q) { + GetFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -1858,7 +1832,7 @@ * @returns {$protobuf.Writer} Writer */ GetFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -1941,20 +1915,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -1971,8 +1945,6 @@ GetFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1982,7 +1954,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -1991,7 +1963,7 @@ 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, false); + (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") @@ -2012,41 +1984,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFolderRequest.toObject = function toObject(message, options, q) { + GetFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.requestId = ""; object.name = ""; } - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -2169,17 +2133,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFolderRequest.encode = function encode(message, writer, q) { + CreateFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -2199,7 +2159,7 @@ * @returns {$protobuf.Writer} Writer */ CreateFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -2285,21 +2245,21 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) { + if (message.folder != null && message.hasOwnProperty("folder")) { var error = $root.google.storage.control.v2.Folder.verify(message.folder, long + 1); if (error) return "folder." + error; } - if (message.folderId != null && Object.hasOwnProperty.call(message, "folderId")) + if (message.folderId != null && message.hasOwnProperty("folderId")) if (!$util.isString(message.folderId)) return "folderId: string expected"; - if (message.recursive != null && Object.hasOwnProperty.call(message, "recursive")) + if (message.recursive != null && message.hasOwnProperty("recursive")) if (typeof message.recursive !== "boolean") return "recursive: boolean expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -2316,8 +2276,6 @@ CreateFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.CreateFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.CreateFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2326,7 +2284,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.folder != null) { - if (!$util.isObject(object.folder)) + 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, long + 1); } @@ -2348,13 +2306,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFolderRequest.toObject = function toObject(message, options, q) { + CreateFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -2363,15 +2317,15 @@ object.recursive = false; object.requestId = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) - object.folder = $root.google.storage.control.v2.Folder.toObject(message.folder, options, q + 1); - if (message.folderId != null && Object.hasOwnProperty.call(message, "folderId")) + 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 && Object.hasOwnProperty.call(message, "recursive")) + if (message.recursive != null && message.hasOwnProperty("recursive")) object.recursive = message.recursive; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -2500,13 +2454,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFolderRequest.encode = function encode(message, writer, q) { + DeleteFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -2528,7 +2478,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -2611,20 +2561,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -2641,8 +2591,6 @@ DeleteFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.DeleteFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.DeleteFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2652,7 +2600,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -2661,7 +2609,7 @@ 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, false); + (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") @@ -2682,41 +2630,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFolderRequest.toObject = function toObject(message, options, q) { + DeleteFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.requestId = ""; object.name = ""; } - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -2866,13 +2806,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFoldersRequest.encode = function encode(message, writer, q) { + ListFoldersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -2902,7 +2838,7 @@ * @returns {$protobuf.Writer} Writer */ ListFoldersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -3000,28 +2936,28 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + if (message.delimiter != null && message.hasOwnProperty("delimiter")) if (!$util.isString(message.delimiter)) return "delimiter: string expected"; - if (message.lexicographicStart != null && Object.hasOwnProperty.call(message, "lexicographicStart")) + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) if (!$util.isString(message.lexicographicStart)) return "lexicographicStart: string expected"; - if (message.lexicographicEnd != null && Object.hasOwnProperty.call(message, "lexicographicEnd")) + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) if (!$util.isString(message.lexicographicEnd)) return "lexicographicEnd: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -3038,8 +2974,6 @@ ListFoldersRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListFoldersRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListFoldersRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3073,13 +3007,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFoldersRequest.toObject = function toObject(message, options, q) { + ListFoldersRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -3091,21 +3021,21 @@ object.delimiter = ""; object.requestId = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.lexicographicStart != null && Object.hasOwnProperty.call(message, "lexicographicStart")) + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) object.lexicographicStart = message.lexicographicStart; - if (message.lexicographicEnd != null && Object.hasOwnProperty.call(message, "lexicographicEnd")) + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) object.lexicographicEnd = message.lexicographicEnd; - if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + if (message.delimiter != null && message.hasOwnProperty("delimiter")) object.delimiter = message.delimiter; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -3202,16 +3132,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFoldersResponse.encode = function encode(message, writer, q) { + ListFoldersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -3227,7 +3153,7 @@ * @returns {$protobuf.Writer} Writer */ ListFoldersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -3303,7 +3229,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.folders != null && Object.hasOwnProperty.call(message, "folders")) { + 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) { @@ -3312,7 +3238,7 @@ return "folders." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -3329,8 +3255,6 @@ ListFoldersResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListFoldersResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListFoldersResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3341,7 +3265,7 @@ throw TypeError(".google.storage.control.v2.ListFoldersResponse.folders: array expected"); message.folders = []; for (var i = 0; i < object.folders.length; ++i) { - if (!$util.isObject(object.folders[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], long + 1); } @@ -3360,13 +3284,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFoldersResponse.toObject = function toObject(message, options, q) { + ListFoldersResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.folders = []; @@ -3375,9 +3295,9 @@ 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, q + 1); + object.folders[j] = $root.google.storage.control.v2.Folder.toObject(message.folders[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -3515,13 +3435,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RenameFolderRequest.encode = function encode(message, writer, q) { + RenameFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -3545,7 +3461,7 @@ * @returns {$protobuf.Writer} Writer */ RenameFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -3632,23 +3548,23 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.destinationFolderId != null && Object.hasOwnProperty.call(message, "destinationFolderId")) + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) if (!$util.isString(message.destinationFolderId)) return "destinationFolderId: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -3665,8 +3581,6 @@ RenameFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.RenameFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.RenameFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3678,7 +3592,7 @@ message.destinationFolderId = String(object.destinationFolderId); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -3687,7 +3601,7 @@ 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, false); + (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") @@ -3708,44 +3622,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RenameFolderRequest.toObject = function toObject(message, options, q) { + RenameFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.requestId = ""; object.name = ""; object.destinationFolderId = ""; } - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.destinationFolderId != null && Object.hasOwnProperty.call(message, "destinationFolderId")) + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) object.destinationFolderId = message.destinationFolderId; return object; }; @@ -3874,13 +3780,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFolderRecursiveRequest.encode = function encode(message, writer, q) { + DeleteFolderRecursiveRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -3902,7 +3804,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteFolderRecursiveRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -3985,20 +3887,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -4015,8 +3917,6 @@ DeleteFolderRecursiveRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.DeleteFolderRecursiveRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.DeleteFolderRecursiveRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4026,7 +3926,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -4035,7 +3935,7 @@ 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, false); + (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") @@ -4056,41 +3956,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFolderRecursiveRequest.toObject = function toObject(message, options, q) { + DeleteFolderRecursiveRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.requestId = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -4222,19 +4114,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommonLongRunningOperationMetadata.encode = function encode(message, writer, q) { + CommonLongRunningOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -4254,7 +4142,7 @@ * @returns {$protobuf.Writer} Writer */ CommonLongRunningOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -4344,28 +4232,28 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + if (message.endTime != null && message.hasOwnProperty("endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) if (typeof message.requestedCancellation !== "boolean") return "requestedCancellation: boolean expected"; - if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) if (!$util.isInteger(message.progressPercent)) return "progressPercent: integer expected"; return null; @@ -4382,25 +4270,23 @@ CommonLongRunningOperationMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.CommonLongRunningOperationMetadata) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.CommonLongRunningOperationMetadata(); if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.endTime != null) { - if (!$util.isObject(object.endTime)) + if (typeof object.endTime !== "object") throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.CommonLongRunningOperationMetadata.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -4422,13 +4308,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommonLongRunningOperationMetadata.toObject = function toObject(message, options, q) { + CommonLongRunningOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.createTime = null; @@ -4438,17 +4320,17 @@ object.requestedCancellation = false; object.progressPercent = 0; } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + 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 && Object.hasOwnProperty.call(message, "requestedCancellation")) + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) object.requestedCancellation = message.requestedCancellation; - if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) object.progressPercent = message.progressPercent; return object; }; @@ -4553,15 +4435,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RenameFolderMetadata.encode = function encode(message, writer, q) { + RenameFolderMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -4579,7 +4457,7 @@ * @returns {$protobuf.Writer} Writer */ RenameFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -4657,15 +4535,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) { + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata, long + 1); if (error) return "commonMetadata." + error; } - if (message.sourceFolderId != null && Object.hasOwnProperty.call(message, "sourceFolderId")) + if (message.sourceFolderId != null && message.hasOwnProperty("sourceFolderId")) if (!$util.isString(message.sourceFolderId)) return "sourceFolderId: string expected"; - if (message.destinationFolderId != null && Object.hasOwnProperty.call(message, "destinationFolderId")) + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) if (!$util.isString(message.destinationFolderId)) return "destinationFolderId: string expected"; return null; @@ -4682,15 +4560,13 @@ RenameFolderMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.RenameFolderMetadata) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.RenameFolderMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.RenameFolderMetadata(); if (object.commonMetadata != null) { - if (!$util.isObject(object.commonMetadata)) + 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, long + 1); } @@ -4710,24 +4586,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RenameFolderMetadata.toObject = function toObject(message, options, q) { + RenameFolderMetadata.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.commonMetadata = null; object.sourceFolderId = ""; object.destinationFolderId = ""; } - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options, q + 1); - if (message.sourceFolderId != null && Object.hasOwnProperty.call(message, "sourceFolderId")) + 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 && Object.hasOwnProperty.call(message, "destinationFolderId")) + if (message.destinationFolderId != null && message.hasOwnProperty("destinationFolderId")) object.destinationFolderId = message.destinationFolderId; return object; }; @@ -4823,15 +4695,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFolderRecursiveMetadata.encode = function encode(message, writer, q) { + DeleteFolderRecursiveMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -4847,7 +4715,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteFolderRecursiveMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -4921,12 +4789,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) { + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata, long + 1); if (error) return "commonMetadata." + error; } - if (message.folderId != null && Object.hasOwnProperty.call(message, "folderId")) + if (message.folderId != null && message.hasOwnProperty("folderId")) if (!$util.isString(message.folderId)) return "folderId: string expected"; return null; @@ -4943,15 +4811,13 @@ DeleteFolderRecursiveMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.DeleteFolderRecursiveMetadata) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.DeleteFolderRecursiveMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.DeleteFolderRecursiveMetadata(); if (object.commonMetadata != null) { - if (!$util.isObject(object.commonMetadata)) + 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, long + 1); } @@ -4969,21 +4835,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFolderRecursiveMetadata.toObject = function toObject(message, options, q) { + DeleteFolderRecursiveMetadata.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.commonMetadata = null; object.folderId = ""; } - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options, q + 1); - if (message.folderId != null && Object.hasOwnProperty.call(message, "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; }; @@ -5106,13 +4968,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StorageLayout.encode = function encode(message, writer, q) { + StorageLayout.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -5120,9 +4978,9 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.encode(message.hierarchicalNamespace, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -5136,7 +4994,7 @@ * @returns {$protobuf.Writer} Writer */ StorageLayout.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -5222,21 +5080,21 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (message.location != null && message.hasOwnProperty("location")) if (!$util.isString(message.location)) return "location: string expected"; - if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + if (message.locationType != null && message.hasOwnProperty("locationType")) if (!$util.isString(message.locationType)) return "locationType: string expected"; - if (message.customPlacementConfig != null && Object.hasOwnProperty.call(message, "customPlacementConfig")) { + if (message.customPlacementConfig != null && message.hasOwnProperty("customPlacementConfig")) { var error = $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.verify(message.customPlacementConfig, long + 1); if (error) return "customPlacementConfig." + error; } - if (message.hierarchicalNamespace != null && Object.hasOwnProperty.call(message, "hierarchicalNamespace")) { + if (message.hierarchicalNamespace != null && message.hasOwnProperty("hierarchicalNamespace")) { var error = $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.verify(message.hierarchicalNamespace, long + 1); if (error) return "hierarchicalNamespace." + error; @@ -5255,8 +5113,6 @@ StorageLayout.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.StorageLayout) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.StorageLayout: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5269,12 +5125,12 @@ if (object.locationType != null) message.locationType = String(object.locationType); if (object.customPlacementConfig != null) { - if (!$util.isObject(object.customPlacementConfig)) + 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, long + 1); } if (object.hierarchicalNamespace != null) { - if (!$util.isObject(object.hierarchicalNamespace)) + 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, long + 1); } @@ -5290,13 +5146,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StorageLayout.toObject = function toObject(message, options, q) { + StorageLayout.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -5305,16 +5157,16 @@ object.customPlacementConfig = null; object.hierarchicalNamespace = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (message.location != null && message.hasOwnProperty("location")) object.location = message.location; - if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + if (message.locationType != null && message.hasOwnProperty("locationType")) object.locationType = message.locationType; - if (message.customPlacementConfig != null && Object.hasOwnProperty.call(message, "customPlacementConfig")) - object.customPlacementConfig = $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig.toObject(message.customPlacementConfig, options, q + 1); - if (message.hierarchicalNamespace != null && Object.hasOwnProperty.call(message, "hierarchicalNamespace")) - object.hierarchicalNamespace = $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace.toObject(message.hierarchicalNamespace, options, q + 1); + 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; }; @@ -5398,13 +5250,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomPlacementConfig.encode = function encode(message, writer, q) { + CustomPlacementConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -5421,7 +5269,7 @@ * @returns {$protobuf.Writer} Writer */ CustomPlacementConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -5493,7 +5341,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dataLocations != null && Object.hasOwnProperty.call(message, "dataLocations")) { + 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) @@ -5514,8 +5362,6 @@ CustomPlacementConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.StorageLayout.CustomPlacementConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.StorageLayout.CustomPlacementConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5540,13 +5386,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomPlacementConfig.toObject = function toObject(message, options, q) { + CustomPlacementConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.dataLocations = []; @@ -5640,13 +5482,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HierarchicalNamespace.encode = function encode(message, writer, q) { + HierarchicalNamespace.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); return writer; @@ -5662,7 +5500,7 @@ * @returns {$protobuf.Writer} Writer */ HierarchicalNamespace.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -5732,7 +5570,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; return null; @@ -5749,8 +5587,6 @@ HierarchicalNamespace.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.StorageLayout.HierarchicalNamespace) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.StorageLayout.HierarchicalNamespace: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5770,17 +5606,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HierarchicalNamespace.toObject = function toObject(message, options, q) { + HierarchicalNamespace.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.enabled = false; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; return object; }; @@ -5888,13 +5720,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetStorageLayoutRequest.encode = function encode(message, writer, q) { + GetStorageLayoutRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -5914,7 +5742,7 @@ * @returns {$protobuf.Writer} Writer */ GetStorageLayoutRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -5992,13 +5820,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -6015,8 +5843,6 @@ GetStorageLayoutRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetStorageLayoutRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetStorageLayoutRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6040,24 +5866,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetStorageLayoutRequest.toObject = function toObject(message, options, q) { + GetStorageLayoutRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.prefix = ""; object.requestId = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -6171,21 +5993,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ManagedFolder.encode = function encode(message, writer, q) { + ManagedFolder.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -6199,7 +6017,7 @@ * @returns {$protobuf.Writer} Writer */ ManagedFolder.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -6281,18 +6099,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + 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 && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; @@ -6311,8 +6129,6 @@ ManagedFolder.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ManagedFolder) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ManagedFolder: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6322,7 +6138,7 @@ message.name = String(object.name); if (object.metageneration != null) if ($util.Long) - message.metageneration = $util.Long.fromValue(object.metageneration, false); + (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") @@ -6330,12 +6146,12 @@ 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 (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.ManagedFolder.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.ManagedFolder.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -6351,37 +6167,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ManagedFolder.toObject = function toObject(message, options, q) { + ManagedFolder.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.metageneration = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.metageneration = options.longs === String ? "0" : 0; object.createTime = null; object.updateTime = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.metageneration = typeof message.metageneration === "number" ? BigInt(message.metageneration) : $util.Long.fromBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0, false).toBigInt(); - else if (typeof message.metageneration === "number") + 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 && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + 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; }; @@ -6509,13 +6319,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetManagedFolderRequest.encode = function encode(message, writer, q) { + GetManagedFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -6537,7 +6343,7 @@ * @returns {$protobuf.Writer} Writer */ GetManagedFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -6620,20 +6426,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -6650,8 +6456,6 @@ GetManagedFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetManagedFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetManagedFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6661,7 +6465,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -6670,7 +6474,7 @@ 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, false); + (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") @@ -6691,41 +6495,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetManagedFolderRequest.toObject = function toObject(message, options, q) { + GetManagedFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.requestId = ""; object.name = ""; } - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -6839,17 +6635,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateManagedFolderRequest.encode = function encode(message, writer, q) { + CreateManagedFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -6867,7 +6659,7 @@ * @returns {$protobuf.Writer} Writer */ CreateManagedFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -6949,18 +6741,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.managedFolder != null && Object.hasOwnProperty.call(message, "managedFolder")) { + if (message.managedFolder != null && message.hasOwnProperty("managedFolder")) { var error = $root.google.storage.control.v2.ManagedFolder.verify(message.managedFolder, long + 1); if (error) return "managedFolder." + error; } - if (message.managedFolderId != null && Object.hasOwnProperty.call(message, "managedFolderId")) + if (message.managedFolderId != null && message.hasOwnProperty("managedFolderId")) if (!$util.isString(message.managedFolderId)) return "managedFolderId: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -6977,8 +6769,6 @@ CreateManagedFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.CreateManagedFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.CreateManagedFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6987,7 +6777,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.managedFolder != null) { - if (!$util.isObject(object.managedFolder)) + 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, long + 1); } @@ -7007,13 +6797,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateManagedFolderRequest.toObject = function toObject(message, options, q) { + CreateManagedFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -7021,13 +6807,13 @@ object.managedFolderId = ""; object.requestId = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.managedFolder != null && Object.hasOwnProperty.call(message, "managedFolder")) - object.managedFolder = $root.google.storage.control.v2.ManagedFolder.toObject(message.managedFolder, options, q + 1); - if (message.managedFolderId != null && Object.hasOwnProperty.call(message, "managedFolderId")) + 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 && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -7165,13 +6951,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteManagedFolderRequest.encode = function encode(message, writer, q) { + DeleteManagedFolderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -7195,7 +6977,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteManagedFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -7282,23 +7064,23 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "allowNonEmpty")) + if (message.allowNonEmpty != null && message.hasOwnProperty("allowNonEmpty")) if (typeof message.allowNonEmpty !== "boolean") return "allowNonEmpty: boolean expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -7315,8 +7097,6 @@ DeleteManagedFolderRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.DeleteManagedFolderRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.DeleteManagedFolderRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7326,7 +7106,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -7335,7 +7115,7 @@ 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, false); + (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") @@ -7358,44 +7138,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteManagedFolderRequest.toObject = function toObject(message, options, q) { + DeleteManagedFolderRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.allowNonEmpty = false; object.requestId = ""; object.name = ""; } - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "allowNonEmpty")) + if (message.allowNonEmpty != null && message.hasOwnProperty("allowNonEmpty")) object.allowNonEmpty = message.allowNonEmpty; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -7518,13 +7290,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListManagedFoldersRequest.encode = function encode(message, writer, q) { + ListManagedFoldersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -7548,7 +7316,7 @@ * @returns {$protobuf.Writer} Writer */ ListManagedFoldersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -7634,19 +7402,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -7663,8 +7431,6 @@ ListManagedFoldersRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListManagedFoldersRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListManagedFoldersRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7692,13 +7458,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListManagedFoldersRequest.toObject = function toObject(message, options, q) { + ListManagedFoldersRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -7707,15 +7469,15 @@ object.prefix = ""; object.requestId = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -7812,16 +7574,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListManagedFoldersResponse.encode = function encode(message, writer, q) { + ListManagedFoldersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -7837,7 +7595,7 @@ * @returns {$protobuf.Writer} Writer */ ListManagedFoldersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -7913,7 +7671,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.managedFolders != null && Object.hasOwnProperty.call(message, "managedFolders")) { + 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) { @@ -7922,7 +7680,7 @@ return "managedFolders." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -7939,8 +7697,6 @@ ListManagedFoldersResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListManagedFoldersResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListManagedFoldersResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7951,7 +7707,7 @@ throw TypeError(".google.storage.control.v2.ListManagedFoldersResponse.managedFolders: array expected"); message.managedFolders = []; for (var i = 0; i < object.managedFolders.length; ++i) { - if (!$util.isObject(object.managedFolders[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], long + 1); } @@ -7970,13 +7726,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListManagedFoldersResponse.toObject = function toObject(message, options, q) { + ListManagedFoldersResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.managedFolders = []; @@ -7985,9 +7737,9 @@ 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, q + 1); + object.managedFolders[j] = $root.google.storage.control.v2.ManagedFolder.toObject(message.managedFolders[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -8137,19 +7889,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateAnywhereCacheMetadata.encode = function encode(message, writer, q) { + CreateAnywhereCacheMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -8167,7 +7915,7 @@ * @returns {$protobuf.Writer} Writer */ CreateAnywhereCacheMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -8254,22 +8002,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) { + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata, long + 1); if (error) return "commonMetadata." + error; } - if (message.anywhereCacheId != null && Object.hasOwnProperty.call(message, "anywhereCacheId")) { + if (message.anywhereCacheId != null && message.hasOwnProperty("anywhereCacheId")) { properties._anywhereCacheId = 1; if (!$util.isString(message.anywhereCacheId)) return "anywhereCacheId: string expected"; } - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) { + if (message.zone != null && message.hasOwnProperty("zone")) { properties._zone = 1; if (!$util.isString(message.zone)) return "zone: string expected"; } - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) { + if (message.ttl != null && message.hasOwnProperty("ttl")) { properties._ttl = 1; { var error = $root.google.protobuf.Duration.verify(message.ttl, long + 1); @@ -8277,7 +8025,7 @@ return "ttl." + error; } } - if (message.admissionPolicy != null && Object.hasOwnProperty.call(message, "admissionPolicy")) { + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { properties._admissionPolicy = 1; if (!$util.isString(message.admissionPolicy)) return "admissionPolicy: string expected"; @@ -8296,15 +8044,13 @@ CreateAnywhereCacheMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.CreateAnywhereCacheMetadata) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.CreateAnywhereCacheMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.CreateAnywhereCacheMetadata(); if (object.commonMetadata != null) { - if (!$util.isObject(object.commonMetadata)) + 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, long + 1); } @@ -8313,7 +8059,7 @@ if (object.zone != null) message.zone = String(object.zone); if (object.ttl != null) { - if (!$util.isObject(object.ttl)) + if (typeof object.ttl !== "object") throw TypeError(".google.storage.control.v2.CreateAnywhereCacheMetadata.ttl: object expected"); message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl, long + 1); } @@ -8331,34 +8077,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateAnywhereCacheMetadata.toObject = function toObject(message, options, q) { + CreateAnywhereCacheMetadata.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.commonMetadata = null; - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options, q + 1); - if (message.anywhereCacheId != null && Object.hasOwnProperty.call(message, "anywhereCacheId")) { + 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 && Object.hasOwnProperty.call(message, "ttl")) { - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "admissionPolicy")) { + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { object.admissionPolicy = message.admissionPolicy; if (options.oneofs) object._admissionPolicy = "admissionPolicy"; } - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) { + if (message.zone != null && message.hasOwnProperty("zone")) { object.zone = message.zone; if (options.oneofs) object._zone = "zone"; @@ -8511,19 +8253,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateAnywhereCacheMetadata.encode = function encode(message, writer, q) { + UpdateAnywhereCacheMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -8541,7 +8279,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateAnywhereCacheMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -8628,22 +8366,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) { + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { var error = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.verify(message.commonMetadata, long + 1); if (error) return "commonMetadata." + error; } - if (message.anywhereCacheId != null && Object.hasOwnProperty.call(message, "anywhereCacheId")) { + if (message.anywhereCacheId != null && message.hasOwnProperty("anywhereCacheId")) { properties._anywhereCacheId = 1; if (!$util.isString(message.anywhereCacheId)) return "anywhereCacheId: string expected"; } - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) { + if (message.zone != null && message.hasOwnProperty("zone")) { properties._zone = 1; if (!$util.isString(message.zone)) return "zone: string expected"; } - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) { + if (message.ttl != null && message.hasOwnProperty("ttl")) { properties._ttl = 1; { var error = $root.google.protobuf.Duration.verify(message.ttl, long + 1); @@ -8651,7 +8389,7 @@ return "ttl." + error; } } - if (message.admissionPolicy != null && Object.hasOwnProperty.call(message, "admissionPolicy")) { + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { properties._admissionPolicy = 1; if (!$util.isString(message.admissionPolicy)) return "admissionPolicy: string expected"; @@ -8670,15 +8408,13 @@ UpdateAnywhereCacheMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.UpdateAnywhereCacheMetadata) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.UpdateAnywhereCacheMetadata(); if (object.commonMetadata != null) { - if (!$util.isObject(object.commonMetadata)) + 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, long + 1); } @@ -8687,7 +8423,7 @@ if (object.zone != null) message.zone = String(object.zone); if (object.ttl != null) { - if (!$util.isObject(object.ttl)) + if (typeof object.ttl !== "object") throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheMetadata.ttl: object expected"); message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl, long + 1); } @@ -8705,34 +8441,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateAnywhereCacheMetadata.toObject = function toObject(message, options, q) { + UpdateAnywhereCacheMetadata.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.commonMetadata = null; - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - object.commonMetadata = $root.google.storage.control.v2.CommonLongRunningOperationMetadata.toObject(message.commonMetadata, options, q + 1); - if (message.anywhereCacheId != null && Object.hasOwnProperty.call(message, "anywhereCacheId")) { + 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 && Object.hasOwnProperty.call(message, "ttl")) { - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "admissionPolicy")) { + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) { object.admissionPolicy = message.admissionPolicy; if (options.oneofs) object._admissionPolicy = "admissionPolicy"; } - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) { + if (message.zone != null && message.hasOwnProperty("zone")) { object.zone = message.zone; if (options.oneofs) object._zone = "zone"; @@ -8885,23 +8617,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnywhereCache.encode = function encode(message, writer, q) { + AnywhereCache.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -8921,7 +8649,7 @@ * @returns {$protobuf.Writer} Writer */ AnywhereCache.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -9019,34 +8747,34 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + if (message.zone != null && message.hasOwnProperty("zone")) if (!$util.isString(message.zone)) return "zone: string expected"; - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) { + if (message.ttl != null && message.hasOwnProperty("ttl")) { var error = $root.google.protobuf.Duration.verify(message.ttl, long + 1); if (error) return "ttl." + error; } - if (message.admissionPolicy != null && Object.hasOwnProperty.call(message, "admissionPolicy")) + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) if (!$util.isString(message.admissionPolicy)) return "admissionPolicy: string expected"; - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) if (!$util.isString(message.state)) return "state: string expected"; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.pendingUpdate != null && Object.hasOwnProperty.call(message, "pendingUpdate")) + if (message.pendingUpdate != null && message.hasOwnProperty("pendingUpdate")) if (typeof message.pendingUpdate !== "boolean") return "pendingUpdate: boolean expected"; return null; @@ -9063,8 +8791,6 @@ AnywhereCache.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.AnywhereCache) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.AnywhereCache: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -9075,7 +8801,7 @@ if (object.zone != null) message.zone = String(object.zone); if (object.ttl != null) { - if (!$util.isObject(object.ttl)) + if (typeof object.ttl !== "object") throw TypeError(".google.storage.control.v2.AnywhereCache.ttl: object expected"); message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl, long + 1); } @@ -9084,12 +8810,12 @@ if (object.state != null) message.state = String(object.state); if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.AnywhereCache.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.AnywhereCache.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -9107,13 +8833,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnywhereCache.toObject = function toObject(message, options, q) { + AnywhereCache.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -9125,21 +8847,21 @@ object.admissionPolicy = ""; object.zone = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options, q + 1); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + 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 && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.pendingUpdate != null && Object.hasOwnProperty.call(message, "pendingUpdate")) + 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 && Object.hasOwnProperty.call(message, "admissionPolicy")) + if (message.admissionPolicy != null && message.hasOwnProperty("admissionPolicy")) object.admissionPolicy = message.admissionPolicy; - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + if (message.zone != null && message.hasOwnProperty("zone")) object.zone = message.zone; return object; }; @@ -9244,17 +8966,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateAnywhereCacheRequest.encode = function encode(message, writer, q) { + CreateAnywhereCacheRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -9270,7 +8988,7 @@ * @returns {$protobuf.Writer} Writer */ CreateAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -9348,15 +9066,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.anywhereCache != null && Object.hasOwnProperty.call(message, "anywhereCache")) { + if (message.anywhereCache != null && message.hasOwnProperty("anywhereCache")) { var error = $root.google.storage.control.v2.AnywhereCache.verify(message.anywhereCache, long + 1); if (error) return "anywhereCache." + error; } - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -9373,8 +9091,6 @@ CreateAnywhereCacheRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.CreateAnywhereCacheRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.CreateAnywhereCacheRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -9383,7 +9099,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.anywhereCache != null) { - if (!$util.isObject(object.anywhereCache)) + 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, long + 1); } @@ -9401,24 +9117,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateAnywhereCacheRequest.toObject = function toObject(message, options, q) { + CreateAnywhereCacheRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.anywhereCache = null; object.requestId = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.anywhereCache != null && Object.hasOwnProperty.call(message, "anywhereCache")) - object.anywhereCache = $root.google.storage.control.v2.AnywhereCache.toObject(message.anywhereCache, options, q + 1); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + 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; }; @@ -9523,17 +9235,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateAnywhereCacheRequest.encode = function encode(message, writer, q) { + UpdateAnywhereCacheRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -9549,7 +9257,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -9627,17 +9335,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.anywhereCache != null && Object.hasOwnProperty.call(message, "anywhereCache")) { + if (message.anywhereCache != null && message.hasOwnProperty("anywhereCache")) { var error = $root.google.storage.control.v2.AnywhereCache.verify(message.anywhereCache, long + 1); if (error) return "anywhereCache." + error; } - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; } - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -9654,20 +9362,18 @@ UpdateAnywhereCacheRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.UpdateAnywhereCacheRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.UpdateAnywhereCacheRequest(); if (object.anywhereCache != null) { - if (!$util.isObject(object.anywhereCache)) + 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, long + 1); } if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.storage.control.v2.UpdateAnywhereCacheRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -9685,24 +9391,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateAnywhereCacheRequest.toObject = function toObject(message, options, q) { + UpdateAnywhereCacheRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.anywhereCache = null; object.updateMask = null; object.requestId = ""; } - if (message.anywhereCache != null && Object.hasOwnProperty.call(message, "anywhereCache")) - object.anywhereCache = $root.google.storage.control.v2.AnywhereCache.toObject(message.anywhereCache, options, q + 1); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); - if (message.requestId != null && Object.hasOwnProperty.call(message, "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; }; @@ -9798,13 +9500,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisableAnywhereCacheRequest.encode = function encode(message, writer, q) { + DisableAnywhereCacheRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -9822,7 +9520,7 @@ * @returns {$protobuf.Writer} Writer */ DisableAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -9896,10 +9594,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -9916,8 +9614,6 @@ DisableAnywhereCacheRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.DisableAnywhereCacheRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.DisableAnywhereCacheRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -9939,21 +9635,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DisableAnywhereCacheRequest.toObject = function toObject(message, options, q) { + DisableAnywhereCacheRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.requestId = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -10049,13 +9741,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PauseAnywhereCacheRequest.encode = function encode(message, writer, q) { + PauseAnywhereCacheRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -10073,7 +9761,7 @@ * @returns {$protobuf.Writer} Writer */ PauseAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -10147,10 +9835,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -10167,8 +9855,6 @@ PauseAnywhereCacheRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.PauseAnywhereCacheRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.PauseAnywhereCacheRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10190,21 +9876,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PauseAnywhereCacheRequest.toObject = function toObject(message, options, q) { + PauseAnywhereCacheRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.requestId = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -10300,13 +9982,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeAnywhereCacheRequest.encode = function encode(message, writer, q) { + ResumeAnywhereCacheRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -10324,7 +10002,7 @@ * @returns {$protobuf.Writer} Writer */ ResumeAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -10398,10 +10076,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -10418,8 +10096,6 @@ ResumeAnywhereCacheRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ResumeAnywhereCacheRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ResumeAnywhereCacheRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10441,21 +10117,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResumeAnywhereCacheRequest.toObject = function toObject(message, options, q) { + ResumeAnywhereCacheRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.requestId = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -10551,13 +10223,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAnywhereCacheRequest.encode = function encode(message, writer, q) { + GetAnywhereCacheRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -10575,7 +10243,7 @@ * @returns {$protobuf.Writer} Writer */ GetAnywhereCacheRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -10649,10 +10317,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -10669,8 +10337,6 @@ GetAnywhereCacheRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetAnywhereCacheRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetAnywhereCacheRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10692,21 +10358,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetAnywhereCacheRequest.toObject = function toObject(message, options, q) { + GetAnywhereCacheRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.requestId = ""; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -10820,13 +10482,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAnywhereCachesRequest.encode = function encode(message, writer, q) { + ListAnywhereCachesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -10848,7 +10506,7 @@ * @returns {$protobuf.Writer} Writer */ ListAnywhereCachesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -10930,16 +10588,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -10956,8 +10614,6 @@ ListAnywhereCachesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListAnywhereCachesRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListAnywhereCachesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10983,13 +10639,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAnywhereCachesRequest.toObject = function toObject(message, options, q) { + ListAnywhereCachesRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -10997,13 +10649,13 @@ object.pageToken = ""; object.requestId = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; @@ -11100,16 +10752,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAnywhereCachesResponse.encode = function encode(message, writer, q) { + ListAnywhereCachesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -11125,7 +10773,7 @@ * @returns {$protobuf.Writer} Writer */ ListAnywhereCachesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -11201,7 +10849,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.anywhereCaches != null && Object.hasOwnProperty.call(message, "anywhereCaches")) { + 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) { @@ -11210,7 +10858,7 @@ return "anywhereCaches." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -11227,8 +10875,6 @@ ListAnywhereCachesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListAnywhereCachesResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListAnywhereCachesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -11239,7 +10885,7 @@ throw TypeError(".google.storage.control.v2.ListAnywhereCachesResponse.anywhereCaches: array expected"); message.anywhereCaches = []; for (var i = 0; i < object.anywhereCaches.length; ++i) { - if (!$util.isObject(object.anywhereCaches[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], long + 1); } @@ -11258,13 +10904,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAnywhereCachesResponse.toObject = function toObject(message, options, q) { + ListAnywhereCachesResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.anywhereCaches = []; @@ -11273,9 +10915,9 @@ 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, q + 1); + object.anywhereCaches[j] = $root.google.storage.control.v2.AnywhereCache.toObject(message.anywhereCaches[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -11407,25 +11049,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntelligenceConfig.encode = function encode(message, writer, q) { + IntelligenceConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.encode(message.trialConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -11439,7 +11077,7 @@ * @returns {$protobuf.Writer} Writer */ IntelligenceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -11529,10 +11167,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.editionConfig != null && Object.hasOwnProperty.call(message, "editionConfig")) + if (message.editionConfig != null && message.hasOwnProperty("editionConfig")) switch (message.editionConfig) { default: return "editionConfig: enum value expected"; @@ -11543,22 +11181,22 @@ case 5: break; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) { + if (message.filter != null && message.hasOwnProperty("filter")) { var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.verify(message.filter, long + 1); if (error) return "filter." + error; } - if (message.effectiveIntelligenceConfig != null && Object.hasOwnProperty.call(message, "effectiveIntelligenceConfig")) { + if (message.effectiveIntelligenceConfig != null && message.hasOwnProperty("effectiveIntelligenceConfig")) { var error = $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.verify(message.effectiveIntelligenceConfig, long + 1); if (error) return "effectiveIntelligenceConfig." + error; } - if (message.trialConfig != null && Object.hasOwnProperty.call(message, "trialConfig")) { + if (message.trialConfig != null && message.hasOwnProperty("trialConfig")) { var error = $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.verify(message.trialConfig, long + 1); if (error) return "trialConfig." + error; @@ -11577,8 +11215,6 @@ IntelligenceConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -11615,22 +11251,22 @@ break; } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.IntelligenceConfig.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } if (object.filter != null) { - if (!$util.isObject(object.filter)) + 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, long + 1); } if (object.effectiveIntelligenceConfig != null) { - if (!$util.isObject(object.effectiveIntelligenceConfig)) + 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, long + 1); } if (object.trialConfig != null) { - if (!$util.isObject(object.trialConfig)) + 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, long + 1); } @@ -11646,13 +11282,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IntelligenceConfig.toObject = function toObject(message, options, q) { + IntelligenceConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -11662,18 +11294,18 @@ object.effectiveIntelligenceConfig = null; object.trialConfig = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.editionConfig != null && Object.hasOwnProperty.call(message, "editionConfig")) + 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 && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - object.filter = $root.google.storage.control.v2.IntelligenceConfig.Filter.toObject(message.filter, options, q + 1); - if (message.effectiveIntelligenceConfig != null && Object.hasOwnProperty.call(message, "effectiveIntelligenceConfig")) - object.effectiveIntelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.toObject(message.effectiveIntelligenceConfig, options, q + 1); - if (message.trialConfig != null && Object.hasOwnProperty.call(message, "trialConfig")) - object.trialConfig = $root.google.storage.control.v2.IntelligenceConfig.TrialConfig.toObject(message.trialConfig, options, q + 1); + 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; }; @@ -11828,21 +11460,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Filter.encode = function encode(message, writer, q) { + Filter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.encode(message.excludedCloudStorageBuckets, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -11856,7 +11484,7 @@ * @returns {$protobuf.Writer} Writer */ Filter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -11939,7 +11567,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.includedCloudStorageLocations != null && Object.hasOwnProperty.call(message, "includedCloudStorageLocations")) { + if (message.includedCloudStorageLocations != null && message.hasOwnProperty("includedCloudStorageLocations")) { properties.cloudStorageLocations = 1; { var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.verify(message.includedCloudStorageLocations, long + 1); @@ -11947,7 +11575,7 @@ return "includedCloudStorageLocations." + error; } } - if (message.excludedCloudStorageLocations != null && Object.hasOwnProperty.call(message, "excludedCloudStorageLocations")) { + if (message.excludedCloudStorageLocations != null && message.hasOwnProperty("excludedCloudStorageLocations")) { if (properties.cloudStorageLocations === 1) return "cloudStorageLocations: multiple values"; properties.cloudStorageLocations = 1; @@ -11957,7 +11585,7 @@ return "excludedCloudStorageLocations." + error; } } - if (message.includedCloudStorageBuckets != null && Object.hasOwnProperty.call(message, "includedCloudStorageBuckets")) { + if (message.includedCloudStorageBuckets != null && message.hasOwnProperty("includedCloudStorageBuckets")) { properties.cloudStorageBuckets = 1; { var error = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.verify(message.includedCloudStorageBuckets, long + 1); @@ -11965,7 +11593,7 @@ return "includedCloudStorageBuckets." + error; } } - if (message.excludedCloudStorageBuckets != null && Object.hasOwnProperty.call(message, "excludedCloudStorageBuckets")) { + if (message.excludedCloudStorageBuckets != null && message.hasOwnProperty("excludedCloudStorageBuckets")) { if (properties.cloudStorageBuckets === 1) return "cloudStorageBuckets: multiple values"; properties.cloudStorageBuckets = 1; @@ -11989,30 +11617,28 @@ Filter.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.Filter) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.IntelligenceConfig.Filter(); if (object.includedCloudStorageLocations != null) { - if (!$util.isObject(object.includedCloudStorageLocations)) + 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, long + 1); } if (object.excludedCloudStorageLocations != null) { - if (!$util.isObject(object.excludedCloudStorageLocations)) + 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, long + 1); } if (object.includedCloudStorageBuckets != null) { - if (!$util.isObject(object.includedCloudStorageBuckets)) + 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, long + 1); } if (object.excludedCloudStorageBuckets != null) { - if (!$util.isObject(object.excludedCloudStorageBuckets)) + 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, long + 1); } @@ -12028,31 +11654,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Filter.toObject = function toObject(message, options, q) { + Filter.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.includedCloudStorageLocations != null && Object.hasOwnProperty.call(message, "includedCloudStorageLocations")) { - object.includedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.toObject(message.includedCloudStorageLocations, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "excludedCloudStorageLocations")) { - object.excludedCloudStorageLocations = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations.toObject(message.excludedCloudStorageLocations, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "includedCloudStorageBuckets")) { - object.includedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.toObject(message.includedCloudStorageBuckets, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "excludedCloudStorageBuckets")) { - object.excludedCloudStorageBuckets = $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets.toObject(message.excludedCloudStorageBuckets, options, q + 1); + 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"; } @@ -12139,13 +11761,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudStorageLocations.encode = function encode(message, writer, q) { + CloudStorageLocations.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -12162,7 +11780,7 @@ * @returns {$protobuf.Writer} Writer */ CloudStorageLocations.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -12234,7 +11852,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.locations != null && Object.hasOwnProperty.call(message, "locations")) { + 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) @@ -12255,8 +11873,6 @@ CloudStorageLocations.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12281,13 +11897,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudStorageLocations.toObject = function toObject(message, options, q) { + CloudStorageLocations.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.locations = []; @@ -12382,13 +11994,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudStorageBuckets.encode = function encode(message, writer, q) { + CloudStorageBuckets.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -12405,7 +12013,7 @@ * @returns {$protobuf.Writer} Writer */ CloudStorageBuckets.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -12477,7 +12085,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.bucketIdRegexes != null && Object.hasOwnProperty.call(message, "bucketIdRegexes")) { + 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) @@ -12498,8 +12106,6 @@ CloudStorageBuckets.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12524,13 +12130,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudStorageBuckets.toObject = function toObject(message, options, q) { + CloudStorageBuckets.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.bucketIdRegexes = []; @@ -12636,13 +12238,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EffectiveIntelligenceConfig.encode = function encode(message, writer, q) { + EffectiveIntelligenceConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -12660,7 +12258,7 @@ * @returns {$protobuf.Writer} Writer */ EffectiveIntelligenceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -12734,7 +12332,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.effectiveEdition != null && Object.hasOwnProperty.call(message, "effectiveEdition")) + if (message.effectiveEdition != null && message.hasOwnProperty("effectiveEdition")) switch (message.effectiveEdition) { default: return "effectiveEdition: enum value expected"; @@ -12743,7 +12341,7 @@ case 2: break; } - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) if (!$util.isString(message.intelligenceConfig)) return "intelligenceConfig: string expected"; return null; @@ -12760,8 +12358,6 @@ EffectiveIntelligenceConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12801,21 +12397,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EffectiveIntelligenceConfig.toObject = function toObject(message, options, q) { + EffectiveIntelligenceConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.effectiveEdition = options.enums === String ? "EFFECTIVE_EDITION_UNSPECIFIED" : 0; object.intelligenceConfig = ""; } - if (message.effectiveEdition != null && Object.hasOwnProperty.call(message, "effectiveEdition")) + 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 && Object.hasOwnProperty.call(message, "intelligenceConfig")) + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) object.intelligenceConfig = message.intelligenceConfig; return object; }; @@ -12918,15 +12510,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrialConfig.encode = function encode(message, writer, q) { + TrialConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -12940,7 +12528,7 @@ * @returns {$protobuf.Writer} Writer */ TrialConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -13010,7 +12598,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; @@ -13029,15 +12617,13 @@ TrialConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceConfig.TrialConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceConfig.TrialConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.IntelligenceConfig.TrialConfig(); if (object.expireTime != null) { - if (!$util.isObject(object.expireTime)) + 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, long + 1); } @@ -13053,18 +12639,14 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TrialConfig.toObject = function toObject(message, options, q) { + TrialConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.expireTime = null; - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); return object; }; @@ -13171,17 +12753,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateOrganizationIntelligenceConfigRequest.encode = function encode(message, writer, q) { + UpdateOrganizationIntelligenceConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -13197,7 +12775,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateOrganizationIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -13275,17 +12853,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) { + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) { var error = $root.google.storage.control.v2.IntelligenceConfig.verify(message.intelligenceConfig, long + 1); if (error) return "intelligenceConfig." + error; } - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; } - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -13302,20 +12880,18 @@ UpdateOrganizationIntelligenceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest(); if (object.intelligenceConfig != null) { - if (!$util.isObject(object.intelligenceConfig)) + 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, long + 1); } if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -13333,24 +12909,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateOrganizationIntelligenceConfigRequest.toObject = function toObject(message, options, q) { + UpdateOrganizationIntelligenceConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.intelligenceConfig = null; object.updateMask = null; object.requestId = ""; } - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) - object.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.toObject(message.intelligenceConfig, options, q + 1); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); - if (message.requestId != null && Object.hasOwnProperty.call(message, "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; }; @@ -13455,17 +13027,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFolderIntelligenceConfigRequest.encode = function encode(message, writer, q) { + UpdateFolderIntelligenceConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -13481,7 +13049,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateFolderIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -13559,17 +13127,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) { + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) { var error = $root.google.storage.control.v2.IntelligenceConfig.verify(message.intelligenceConfig, long + 1); if (error) return "intelligenceConfig." + error; } - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; } - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -13586,20 +13154,18 @@ UpdateFolderIntelligenceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.UpdateFolderIntelligenceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest(); if (object.intelligenceConfig != null) { - if (!$util.isObject(object.intelligenceConfig)) + 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, long + 1); } if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.storage.control.v2.UpdateFolderIntelligenceConfigRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -13617,24 +13183,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFolderIntelligenceConfigRequest.toObject = function toObject(message, options, q) { + UpdateFolderIntelligenceConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.intelligenceConfig = null; object.updateMask = null; object.requestId = ""; } - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) - object.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.toObject(message.intelligenceConfig, options, q + 1); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); - if (message.requestId != null && Object.hasOwnProperty.call(message, "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; }; @@ -13739,17 +13301,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProjectIntelligenceConfigRequest.encode = function encode(message, writer, q) { + UpdateProjectIntelligenceConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -13765,7 +13323,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateProjectIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -13843,17 +13401,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) { + if (message.intelligenceConfig != null && message.hasOwnProperty("intelligenceConfig")) { var error = $root.google.storage.control.v2.IntelligenceConfig.verify(message.intelligenceConfig, long + 1); if (error) return "intelligenceConfig." + error; } - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; } - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; return null; @@ -13870,20 +13428,18 @@ UpdateProjectIntelligenceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.UpdateProjectIntelligenceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest(); if (object.intelligenceConfig != null) { - if (!$util.isObject(object.intelligenceConfig)) + 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, long + 1); } if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.storage.control.v2.UpdateProjectIntelligenceConfigRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -13901,24 +13457,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateProjectIntelligenceConfigRequest.toObject = function toObject(message, options, q) { + UpdateProjectIntelligenceConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.intelligenceConfig = null; object.updateMask = null; object.requestId = ""; } - if (message.intelligenceConfig != null && Object.hasOwnProperty.call(message, "intelligenceConfig")) - object.intelligenceConfig = $root.google.storage.control.v2.IntelligenceConfig.toObject(message.intelligenceConfig, options, q + 1); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); - if (message.requestId != null && Object.hasOwnProperty.call(message, "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; }; @@ -14005,13 +13557,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOrganizationIntelligenceConfigRequest.encode = function encode(message, writer, q) { + GetOrganizationIntelligenceConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -14027,7 +13575,7 @@ * @returns {$protobuf.Writer} Writer */ GetOrganizationIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -14097,7 +13645,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -14114,8 +13662,6 @@ GetOrganizationIntelligenceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetOrganizationIntelligenceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14135,17 +13681,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOrganizationIntelligenceConfigRequest.toObject = function toObject(message, options, q) { + GetOrganizationIntelligenceConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -14232,13 +13774,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFolderIntelligenceConfigRequest.encode = function encode(message, writer, q) { + GetFolderIntelligenceConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -14254,7 +13792,7 @@ * @returns {$protobuf.Writer} Writer */ GetFolderIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -14324,7 +13862,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -14341,8 +13879,6 @@ GetFolderIntelligenceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetFolderIntelligenceConfigRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetFolderIntelligenceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14362,17 +13898,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFolderIntelligenceConfigRequest.toObject = function toObject(message, options, q) { + GetFolderIntelligenceConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -14459,13 +13991,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProjectIntelligenceConfigRequest.encode = function encode(message, writer, q) { + GetProjectIntelligenceConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -14481,7 +14009,7 @@ * @returns {$protobuf.Writer} Writer */ GetProjectIntelligenceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -14551,7 +14079,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -14568,8 +14096,6 @@ GetProjectIntelligenceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetProjectIntelligenceConfigRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetProjectIntelligenceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14589,17 +14115,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetProjectIntelligenceConfigRequest.toObject = function toObject(message, options, q) { + GetProjectIntelligenceConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -14818,13 +14340,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntelligenceFinding.encode = function encode(message, writer, q) { + IntelligenceFinding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.description != null && Object.hasOwnProperty.call(message, "description")) @@ -14836,24 +14354,24 @@ if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.severity); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.targetResource); if (message.associatedResources != null && message.associatedResources.length) for (var i = 0; i < message.associatedResources.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).string(message.associatedResources[i]); if (message.observationPeriod != null && Object.hasOwnProperty.call(message, "observationPeriod")) - $root.google.type.Interval.encode(message.observationPeriod, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + $root.google.type.Interval.encode(message.observationPeriod, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.coldlineAndArchivalStorageOperationsSpike != null && Object.hasOwnProperty.call(message, "coldlineAndArchivalStorageOperationsSpike")) - $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.encode(message.coldlineAndArchivalStorageOperationsSpike, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.encode(message.coldlineAndArchivalStorageOperationsSpike, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.throttledRequestsSpike != null && Object.hasOwnProperty.call(message, "throttledRequestsSpike")) - $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.encode(message.throttledRequestsSpike, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.encode(message.throttledRequestsSpike, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.crossRegionEgressSpike != null && Object.hasOwnProperty.call(message, "crossRegionEgressSpike")) - $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.encode(message.crossRegionEgressSpike, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.encode(message.crossRegionEgressSpike, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.storageGrowthAboveTrend != null && Object.hasOwnProperty.call(message, "storageGrowthAboveTrend")) - $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.encode(message.storageGrowthAboveTrend, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.encode(message.storageGrowthAboveTrend, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -14867,7 +14385,7 @@ * @returns {$protobuf.Writer} Writer */ IntelligenceFinding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -14992,13 +14510,13 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; @@ -15009,7 +14527,7 @@ case 4: break; } - if (message.category != null && Object.hasOwnProperty.call(message, "category")) + if (message.category != null && message.hasOwnProperty("category")) switch (message.category) { default: return "category: enum value expected"; @@ -15018,7 +14536,7 @@ case 2: break; } - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + if (message.severity != null && message.hasOwnProperty("severity")) switch (message.severity) { default: return "severity: enum value expected"; @@ -15026,32 +14544,32 @@ case 1: break; } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + if (message.targetResource != null && message.hasOwnProperty("targetResource")) if (!$util.isString(message.targetResource)) return "targetResource: string expected"; - if (message.associatedResources != null && Object.hasOwnProperty.call(message, "associatedResources")) { + if (message.associatedResources != null && message.hasOwnProperty("associatedResources")) { if (!Array.isArray(message.associatedResources)) return "associatedResources: array expected"; for (var i = 0; i < message.associatedResources.length; ++i) if (!$util.isString(message.associatedResources[i])) return "associatedResources: string[] expected"; } - if (message.observationPeriod != null && Object.hasOwnProperty.call(message, "observationPeriod")) { + if (message.observationPeriod != null && message.hasOwnProperty("observationPeriod")) { var error = $root.google.type.Interval.verify(message.observationPeriod, long + 1); if (error) return "observationPeriod." + error; } - if (message.coldlineAndArchivalStorageOperationsSpike != null && Object.hasOwnProperty.call(message, "coldlineAndArchivalStorageOperationsSpike")) { + if (message.coldlineAndArchivalStorageOperationsSpike != null && message.hasOwnProperty("coldlineAndArchivalStorageOperationsSpike")) { properties.intelligenceFindingDetails = 1; { var error = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.verify(message.coldlineAndArchivalStorageOperationsSpike, long + 1); @@ -15059,7 +14577,7 @@ return "coldlineAndArchivalStorageOperationsSpike." + error; } } - if (message.throttledRequestsSpike != null && Object.hasOwnProperty.call(message, "throttledRequestsSpike")) { + if (message.throttledRequestsSpike != null && message.hasOwnProperty("throttledRequestsSpike")) { if (properties.intelligenceFindingDetails === 1) return "intelligenceFindingDetails: multiple values"; properties.intelligenceFindingDetails = 1; @@ -15069,7 +14587,7 @@ return "throttledRequestsSpike." + error; } } - if (message.crossRegionEgressSpike != null && Object.hasOwnProperty.call(message, "crossRegionEgressSpike")) { + if (message.crossRegionEgressSpike != null && message.hasOwnProperty("crossRegionEgressSpike")) { if (properties.intelligenceFindingDetails === 1) return "intelligenceFindingDetails: multiple values"; properties.intelligenceFindingDetails = 1; @@ -15079,7 +14597,7 @@ return "crossRegionEgressSpike." + error; } } - if (message.storageGrowthAboveTrend != null && Object.hasOwnProperty.call(message, "storageGrowthAboveTrend")) { + if (message.storageGrowthAboveTrend != null && message.hasOwnProperty("storageGrowthAboveTrend")) { if (properties.intelligenceFindingDetails === 1) return "intelligenceFindingDetails: multiple values"; properties.intelligenceFindingDetails = 1; @@ -15103,8 +14621,6 @@ IntelligenceFinding.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15179,12 +14695,12 @@ break; } if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -15198,27 +14714,27 @@ message.associatedResources[i] = String(object.associatedResources[i]); } if (object.observationPeriod != null) { - if (!$util.isObject(object.observationPeriod)) + if (typeof object.observationPeriod !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.observationPeriod: object expected"); message.observationPeriod = $root.google.type.Interval.fromObject(object.observationPeriod, long + 1); } if (object.coldlineAndArchivalStorageOperationsSpike != null) { - if (!$util.isObject(object.coldlineAndArchivalStorageOperationsSpike)) + if (typeof object.coldlineAndArchivalStorageOperationsSpike !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.coldlineAndArchivalStorageOperationsSpike: object expected"); message.coldlineAndArchivalStorageOperationsSpike = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.fromObject(object.coldlineAndArchivalStorageOperationsSpike, long + 1); } if (object.throttledRequestsSpike != null) { - if (!$util.isObject(object.throttledRequestsSpike)) + if (typeof object.throttledRequestsSpike !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.throttledRequestsSpike: object expected"); message.throttledRequestsSpike = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.fromObject(object.throttledRequestsSpike, long + 1); } if (object.crossRegionEgressSpike != null) { - if (!$util.isObject(object.crossRegionEgressSpike)) + if (typeof object.crossRegionEgressSpike !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.crossRegionEgressSpike: object expected"); message.crossRegionEgressSpike = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.fromObject(object.crossRegionEgressSpike, long + 1); } if (object.storageGrowthAboveTrend != null) { - if (!$util.isObject(object.storageGrowthAboveTrend)) + if (typeof object.storageGrowthAboveTrend !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.storageGrowthAboveTrend: object expected"); message.storageGrowthAboveTrend = $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.fromObject(object.storageGrowthAboveTrend, long + 1); } @@ -15234,13 +14750,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IntelligenceFinding.toObject = function toObject(message, options, q) { + IntelligenceFinding.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.associatedResources = []; @@ -15255,46 +14767,46 @@ object.targetResource = ""; object.observationPeriod = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.storage.control.v2.FindingType[message.type] === undefined ? message.type : $root.google.storage.control.v2.FindingType[message.type] : message.type; - if (message.category != null && Object.hasOwnProperty.call(message, "category")) + if (message.category != null && message.hasOwnProperty("category")) object.category = options.enums === String ? $root.google.storage.control.v2.FindingCategory[message.category] === undefined ? message.category : $root.google.storage.control.v2.FindingCategory[message.category] : message.category; - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + if (message.severity != null && message.hasOwnProperty("severity")) object.severity = options.enums === String ? $root.google.storage.control.v2.FindingSeverity[message.severity] === undefined ? message.severity : $root.google.storage.control.v2.FindingSeverity[message.severity] : message.severity; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + 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.targetResource != null && message.hasOwnProperty("targetResource")) object.targetResource = message.targetResource; if (message.associatedResources && message.associatedResources.length) { object.associatedResources = []; for (var j = 0; j < message.associatedResources.length; ++j) object.associatedResources[j] = message.associatedResources[j]; } - if (message.observationPeriod != null && Object.hasOwnProperty.call(message, "observationPeriod")) - object.observationPeriod = $root.google.type.Interval.toObject(message.observationPeriod, options, q + 1); - if (message.coldlineAndArchivalStorageOperationsSpike != null && Object.hasOwnProperty.call(message, "coldlineAndArchivalStorageOperationsSpike")) { - object.coldlineAndArchivalStorageOperationsSpike = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.toObject(message.coldlineAndArchivalStorageOperationsSpike, options, q + 1); + if (message.observationPeriod != null && message.hasOwnProperty("observationPeriod")) + object.observationPeriod = $root.google.type.Interval.toObject(message.observationPeriod, options); + if (message.coldlineAndArchivalStorageOperationsSpike != null && message.hasOwnProperty("coldlineAndArchivalStorageOperationsSpike")) { + object.coldlineAndArchivalStorageOperationsSpike = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.toObject(message.coldlineAndArchivalStorageOperationsSpike, options); if (options.oneofs) object.intelligenceFindingDetails = "coldlineAndArchivalStorageOperationsSpike"; } - if (message.throttledRequestsSpike != null && Object.hasOwnProperty.call(message, "throttledRequestsSpike")) { - object.throttledRequestsSpike = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.toObject(message.throttledRequestsSpike, options, q + 1); + if (message.throttledRequestsSpike != null && message.hasOwnProperty("throttledRequestsSpike")) { + object.throttledRequestsSpike = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.toObject(message.throttledRequestsSpike, options); if (options.oneofs) object.intelligenceFindingDetails = "throttledRequestsSpike"; } - if (message.crossRegionEgressSpike != null && Object.hasOwnProperty.call(message, "crossRegionEgressSpike")) { - object.crossRegionEgressSpike = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.toObject(message.crossRegionEgressSpike, options, q + 1); + if (message.crossRegionEgressSpike != null && message.hasOwnProperty("crossRegionEgressSpike")) { + object.crossRegionEgressSpike = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.toObject(message.crossRegionEgressSpike, options); if (options.oneofs) object.intelligenceFindingDetails = "crossRegionEgressSpike"; } - if (message.storageGrowthAboveTrend != null && Object.hasOwnProperty.call(message, "storageGrowthAboveTrend")) { - object.storageGrowthAboveTrend = $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.toObject(message.storageGrowthAboveTrend, options, q + 1); + if (message.storageGrowthAboveTrend != null && message.hasOwnProperty("storageGrowthAboveTrend")) { + object.storageGrowthAboveTrend = $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.toObject(message.storageGrowthAboveTrend, options); if (options.oneofs) object.intelligenceFindingDetails = "storageGrowthAboveTrend"; } @@ -15399,20 +14911,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ColdlineAndArchivalStorageOperationsSpike.encode = function encode(message, writer, q) { + ColdlineAndArchivalStorageOperationsSpike.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.percentageIncrease); if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalOperationsCount); if (message.topBuckets != null && message.topBuckets.length) for (var i = 0; i < message.topBuckets.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -15426,7 +14934,7 @@ * @returns {$protobuf.Writer} Writer */ ColdlineAndArchivalStorageOperationsSpike.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -15506,13 +15014,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) + if (message.totalOperationsCount != null && message.hasOwnProperty("totalOperationsCount")) if (!$util.isInteger(message.totalOperationsCount) && !(message.totalOperationsCount && $util.isInteger(message.totalOperationsCount.low) && $util.isInteger(message.totalOperationsCount.high))) return "totalOperationsCount: integer|Long expected"; - if (message.topBuckets != null && Object.hasOwnProperty.call(message, "topBuckets")) { + if (message.topBuckets != null && message.hasOwnProperty("topBuckets")) { if (!Array.isArray(message.topBuckets)) return "topBuckets: array expected"; for (var i = 0; i < message.topBuckets.length; ++i) { @@ -15535,8 +15043,6 @@ ColdlineAndArchivalStorageOperationsSpike.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15546,7 +15052,7 @@ message.percentageIncrease = Number(object.percentageIncrease); if (object.totalOperationsCount != null) if ($util.Long) - message.totalOperationsCount = $util.Long.fromValue(object.totalOperationsCount, false); + (message.totalOperationsCount = $util.Long.fromValue(object.totalOperationsCount)).unsigned = false; else if (typeof object.totalOperationsCount === "string") message.totalOperationsCount = parseInt(object.totalOperationsCount, 10); else if (typeof object.totalOperationsCount === "number") @@ -15558,7 +15064,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.topBuckets: array expected"); message.topBuckets = []; for (var i = 0; i < object.topBuckets.length; ++i) { - if (!$util.isObject(object.topBuckets[i])) + if (typeof object.topBuckets[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.topBuckets: object expected"); message.topBuckets[i] = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.fromObject(object.topBuckets[i], long + 1); } @@ -15575,13 +15081,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ColdlineAndArchivalStorageOperationsSpike.toObject = function toObject(message, options, q) { + ColdlineAndArchivalStorageOperationsSpike.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topBuckets = []; @@ -15589,23 +15091,21 @@ object.percentageIncrease = 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalOperationsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalOperationsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalOperationsCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalOperationsCount = options.longs === String ? "0" : 0; } - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; - if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalOperationsCount = typeof message.totalOperationsCount === "number" ? BigInt(message.totalOperationsCount) : $util.Long.fromBits(message.totalOperationsCount.low >>> 0, message.totalOperationsCount.high >>> 0, false).toBigInt(); - else if (typeof message.totalOperationsCount === "number") + if (message.totalOperationsCount != null && message.hasOwnProperty("totalOperationsCount")) + if (typeof message.totalOperationsCount === "number") object.totalOperationsCount = options.longs === String ? String(message.totalOperationsCount) : message.totalOperationsCount; else object.totalOperationsCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalOperationsCount) : options.longs === Number ? new $util.LongBits(message.totalOperationsCount.low >>> 0, message.totalOperationsCount.high >>> 0).toNumber() : message.totalOperationsCount; if (message.topBuckets && message.topBuckets.length) { object.topBuckets = []; for (var j = 0; j < message.topBuckets.length; ++j) - object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.toObject(message.topBuckets[j], options, q + 1); + object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.toObject(message.topBuckets[j], options); } return object; }; @@ -15739,13 +15239,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketContribution.encode = function encode(message, writer, q) { + BucketContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) @@ -15753,9 +15249,9 @@ if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalOperationsCount); if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) - $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.encode(message.contribution, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.encode(message.contribution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -15769,7 +15265,7 @@ * @returns {$protobuf.Writer} Writer */ BucketContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -15856,16 +15352,16 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) + if (message.totalOperationsCount != null && message.hasOwnProperty("totalOperationsCount")) if (!$util.isInteger(message.totalOperationsCount) && !(message.totalOperationsCount && $util.isInteger(message.totalOperationsCount.low) && $util.isInteger(message.totalOperationsCount.high))) return "totalOperationsCount: integer|Long expected"; - if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) { + if (message.contribution != null && message.hasOwnProperty("contribution")) { properties.details = 1; { var error = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.verify(message.contribution, long + 1); @@ -15873,7 +15369,7 @@ return "contribution." + error; } } - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + if (message.error != null && message.hasOwnProperty("error")) { if (properties.details === 1) return "details: multiple values"; properties.details = 1; @@ -15897,8 +15393,6 @@ BucketContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15910,7 +15404,7 @@ message.percentageIncrease = Number(object.percentageIncrease); if (object.totalOperationsCount != null) if ($util.Long) - message.totalOperationsCount = $util.Long.fromValue(object.totalOperationsCount, false); + (message.totalOperationsCount = $util.Long.fromValue(object.totalOperationsCount)).unsigned = false; else if (typeof object.totalOperationsCount === "string") message.totalOperationsCount = parseInt(object.totalOperationsCount, 10); else if (typeof object.totalOperationsCount === "number") @@ -15918,12 +15412,12 @@ else if (typeof object.totalOperationsCount === "object") message.totalOperationsCount = new $util.LongBits(object.totalOperationsCount.low >>> 0, object.totalOperationsCount.high >>> 0).toNumber(); if (object.contribution != null) { - if (!$util.isObject(object.contribution)) + if (typeof object.contribution !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.contribution: object expected"); message.contribution = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.fromObject(object.contribution, long + 1); } if (object.error != null) { - if (!$util.isObject(object.error)) + if (typeof object.error !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); } @@ -15939,41 +15433,35 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BucketContribution.toObject = function toObject(message, options, q) { + BucketContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.bucket = ""; object.percentageIncrease = 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalOperationsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalOperationsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalOperationsCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalOperationsCount = options.longs === String ? "0" : 0; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; - if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalOperationsCount = typeof message.totalOperationsCount === "number" ? BigInt(message.totalOperationsCount) : $util.Long.fromBits(message.totalOperationsCount.low >>> 0, message.totalOperationsCount.high >>> 0, false).toBigInt(); - else if (typeof message.totalOperationsCount === "number") + if (message.totalOperationsCount != null && message.hasOwnProperty("totalOperationsCount")) + if (typeof message.totalOperationsCount === "number") object.totalOperationsCount = options.longs === String ? String(message.totalOperationsCount) : message.totalOperationsCount; else object.totalOperationsCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalOperationsCount) : options.longs === Number ? new $util.LongBits(message.totalOperationsCount.low >>> 0, message.totalOperationsCount.high >>> 0).toNumber() : message.totalOperationsCount; - if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) { - object.contribution = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.toObject(message.contribution, options, q + 1); + if (message.contribution != null && message.hasOwnProperty("contribution")) { + object.contribution = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.toObject(message.contribution, options); if (options.oneofs) object.details = "contribution"; } - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); if (options.oneofs) object.details = "error"; } @@ -16060,16 +15548,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Contribution.encode = function encode(message, writer, q) { + Contribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.topPrefixes != null && message.topPrefixes.length) for (var i = 0; i < message.topPrefixes.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution.encode(message.topPrefixes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution.encode(message.topPrefixes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -16083,7 +15567,7 @@ * @returns {$protobuf.Writer} Writer */ Contribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -16155,7 +15639,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.topPrefixes != null && Object.hasOwnProperty.call(message, "topPrefixes")) { + if (message.topPrefixes != null && message.hasOwnProperty("topPrefixes")) { if (!Array.isArray(message.topPrefixes)) return "topPrefixes: array expected"; for (var i = 0; i < message.topPrefixes.length; ++i) { @@ -16178,8 +15662,6 @@ Contribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16190,7 +15672,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.topPrefixes: array expected"); message.topPrefixes = []; for (var i = 0; i < object.topPrefixes.length; ++i) { - if (!$util.isObject(object.topPrefixes[i])) + if (typeof object.topPrefixes[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.topPrefixes: object expected"); message.topPrefixes[i] = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution.fromObject(object.topPrefixes[i], long + 1); } @@ -16207,20 +15689,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Contribution.toObject = function toObject(message, options, q) { + Contribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topPrefixes = []; if (message.topPrefixes && message.topPrefixes.length) { object.topPrefixes = []; for (var j = 0; j < message.topPrefixes.length; ++j) - object.topPrefixes[j] = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution.toObject(message.topPrefixes[j], options, q + 1); + object.topPrefixes[j] = $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution.toObject(message.topPrefixes[j], options); } return object; }; @@ -16322,13 +15800,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrefixContribution.encode = function encode(message, writer, q) { + PrefixContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.prefix); if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) @@ -16348,7 +15822,7 @@ * @returns {$protobuf.Writer} Writer */ PrefixContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -16426,13 +15900,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) + if (message.totalOperationsCount != null && message.hasOwnProperty("totalOperationsCount")) if (!$util.isInteger(message.totalOperationsCount) && !(message.totalOperationsCount && $util.isInteger(message.totalOperationsCount.low) && $util.isInteger(message.totalOperationsCount.high))) return "totalOperationsCount: integer|Long expected"; return null; @@ -16449,8 +15923,6 @@ PrefixContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16462,7 +15934,7 @@ message.percentageIncrease = Number(object.percentageIncrease); if (object.totalOperationsCount != null) if ($util.Long) - message.totalOperationsCount = $util.Long.fromValue(object.totalOperationsCount, false); + (message.totalOperationsCount = $util.Long.fromValue(object.totalOperationsCount)).unsigned = false; else if (typeof object.totalOperationsCount === "string") message.totalOperationsCount = parseInt(object.totalOperationsCount, 10); else if (typeof object.totalOperationsCount === "number") @@ -16481,31 +15953,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrefixContribution.toObject = function toObject(message, options, q) { + PrefixContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.prefix = ""; object.percentageIncrease = 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalOperationsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalOperationsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalOperationsCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalOperationsCount = options.longs === String ? "0" : 0; } - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; - if (message.totalOperationsCount != null && Object.hasOwnProperty.call(message, "totalOperationsCount")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalOperationsCount = typeof message.totalOperationsCount === "number" ? BigInt(message.totalOperationsCount) : $util.Long.fromBits(message.totalOperationsCount.low >>> 0, message.totalOperationsCount.high >>> 0, false).toBigInt(); - else if (typeof message.totalOperationsCount === "number") + if (message.totalOperationsCount != null && message.hasOwnProperty("totalOperationsCount")) + if (typeof message.totalOperationsCount === "number") object.totalOperationsCount = options.longs === String ? String(message.totalOperationsCount) : message.totalOperationsCount; else object.totalOperationsCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalOperationsCount) : options.longs === Number ? new $util.LongBits(message.totalOperationsCount.low >>> 0, message.totalOperationsCount.high >>> 0).toNumber() : message.totalOperationsCount; @@ -16622,20 +16088,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CrossRegionEgressSpike.encode = function encode(message, writer, q) { + CrossRegionEgressSpike.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalEgressBytes); if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.percentageIncrease); if (message.topBuckets != null && message.topBuckets.length) for (var i = 0; i < message.topBuckets.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -16649,7 +16111,7 @@ * @returns {$protobuf.Writer} Writer */ CrossRegionEgressSpike.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -16729,13 +16191,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) + if (message.totalEgressBytes != null && message.hasOwnProperty("totalEgressBytes")) if (!$util.isInteger(message.totalEgressBytes) && !(message.totalEgressBytes && $util.isInteger(message.totalEgressBytes.low) && $util.isInteger(message.totalEgressBytes.high))) return "totalEgressBytes: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.topBuckets != null && Object.hasOwnProperty.call(message, "topBuckets")) { + if (message.topBuckets != null && message.hasOwnProperty("topBuckets")) { if (!Array.isArray(message.topBuckets)) return "topBuckets: array expected"; for (var i = 0; i < message.topBuckets.length; ++i) { @@ -16758,8 +16220,6 @@ CrossRegionEgressSpike.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16767,7 +16227,7 @@ var message = new $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike(); if (object.totalEgressBytes != null) if ($util.Long) - message.totalEgressBytes = $util.Long.fromValue(object.totalEgressBytes, false); + (message.totalEgressBytes = $util.Long.fromValue(object.totalEgressBytes)).unsigned = false; else if (typeof object.totalEgressBytes === "string") message.totalEgressBytes = parseInt(object.totalEgressBytes, 10); else if (typeof object.totalEgressBytes === "number") @@ -16781,7 +16241,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.topBuckets: array expected"); message.topBuckets = []; for (var i = 0; i < object.topBuckets.length; ++i) { - if (!$util.isObject(object.topBuckets[i])) + if (typeof object.topBuckets[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.topBuckets: object expected"); message.topBuckets[i] = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.fromObject(object.topBuckets[i], long + 1); } @@ -16798,37 +16258,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CrossRegionEgressSpike.toObject = function toObject(message, options, q) { + CrossRegionEgressSpike.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topBuckets = []; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalEgressBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalEgressBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalEgressBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalEgressBytes = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalEgressBytes = typeof message.totalEgressBytes === "number" ? BigInt(message.totalEgressBytes) : $util.Long.fromBits(message.totalEgressBytes.low >>> 0, message.totalEgressBytes.high >>> 0, false).toBigInt(); - else if (typeof message.totalEgressBytes === "number") + if (message.totalEgressBytes != null && message.hasOwnProperty("totalEgressBytes")) + if (typeof message.totalEgressBytes === "number") object.totalEgressBytes = options.longs === String ? String(message.totalEgressBytes) : message.totalEgressBytes; else object.totalEgressBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalEgressBytes) : options.longs === Number ? new $util.LongBits(message.totalEgressBytes.low >>> 0, message.totalEgressBytes.high >>> 0).toNumber() : message.totalEgressBytes; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; if (message.topBuckets && message.topBuckets.length) { object.topBuckets = []; for (var j = 0; j < message.topBuckets.length; ++j) - object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.toObject(message.topBuckets[j], options, q + 1); + object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.toObject(message.topBuckets[j], options); } return object; }; @@ -16962,13 +16416,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketContribution.encode = function encode(message, writer, q) { + BucketContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) @@ -16976,9 +16426,9 @@ if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentageIncrease); if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) - $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.encode(message.contribution, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.encode(message.contribution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -16992,7 +16442,7 @@ * @returns {$protobuf.Writer} Writer */ BucketContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -17079,16 +16529,16 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) + if (message.totalEgressBytes != null && message.hasOwnProperty("totalEgressBytes")) if (!$util.isInteger(message.totalEgressBytes) && !(message.totalEgressBytes && $util.isInteger(message.totalEgressBytes.low) && $util.isInteger(message.totalEgressBytes.high))) return "totalEgressBytes: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) { + if (message.contribution != null && message.hasOwnProperty("contribution")) { properties.details = 1; { var error = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.verify(message.contribution, long + 1); @@ -17096,7 +16546,7 @@ return "contribution." + error; } } - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + if (message.error != null && message.hasOwnProperty("error")) { if (properties.details === 1) return "details: multiple values"; properties.details = 1; @@ -17120,8 +16570,6 @@ BucketContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17131,7 +16579,7 @@ message.bucket = String(object.bucket); if (object.totalEgressBytes != null) if ($util.Long) - message.totalEgressBytes = $util.Long.fromValue(object.totalEgressBytes, false); + (message.totalEgressBytes = $util.Long.fromValue(object.totalEgressBytes)).unsigned = false; else if (typeof object.totalEgressBytes === "string") message.totalEgressBytes = parseInt(object.totalEgressBytes, 10); else if (typeof object.totalEgressBytes === "number") @@ -17141,12 +16589,12 @@ if (object.percentageIncrease != null) message.percentageIncrease = Number(object.percentageIncrease); if (object.contribution != null) { - if (!$util.isObject(object.contribution)) + if (typeof object.contribution !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.contribution: object expected"); message.contribution = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.fromObject(object.contribution, long + 1); } if (object.error != null) { - if (!$util.isObject(object.error)) + if (typeof object.error !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); } @@ -17162,41 +16610,35 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BucketContribution.toObject = function toObject(message, options, q) { + BucketContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.bucket = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalEgressBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalEgressBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalEgressBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalEgressBytes = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalEgressBytes = typeof message.totalEgressBytes === "number" ? BigInt(message.totalEgressBytes) : $util.Long.fromBits(message.totalEgressBytes.low >>> 0, message.totalEgressBytes.high >>> 0, false).toBigInt(); - else if (typeof message.totalEgressBytes === "number") + if (message.totalEgressBytes != null && message.hasOwnProperty("totalEgressBytes")) + if (typeof message.totalEgressBytes === "number") object.totalEgressBytes = options.longs === String ? String(message.totalEgressBytes) : message.totalEgressBytes; else object.totalEgressBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalEgressBytes) : options.longs === Number ? new $util.LongBits(message.totalEgressBytes.low >>> 0, message.totalEgressBytes.high >>> 0).toNumber() : message.totalEgressBytes; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; - if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) { - object.contribution = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.toObject(message.contribution, options, q + 1); + if (message.contribution != null && message.hasOwnProperty("contribution")) { + object.contribution = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.toObject(message.contribution, options); if (options.oneofs) object.details = "contribution"; } - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); if (options.oneofs) object.details = "error"; } @@ -17283,16 +16725,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Contribution.encode = function encode(message, writer, q) { + Contribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.topPrefixes != null && message.topPrefixes.length) for (var i = 0; i < message.topPrefixes.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution.encode(message.topPrefixes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution.encode(message.topPrefixes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -17306,7 +16744,7 @@ * @returns {$protobuf.Writer} Writer */ Contribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -17378,7 +16816,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.topPrefixes != null && Object.hasOwnProperty.call(message, "topPrefixes")) { + if (message.topPrefixes != null && message.hasOwnProperty("topPrefixes")) { if (!Array.isArray(message.topPrefixes)) return "topPrefixes: array expected"; for (var i = 0; i < message.topPrefixes.length; ++i) { @@ -17401,8 +16839,6 @@ Contribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17413,7 +16849,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.topPrefixes: array expected"); message.topPrefixes = []; for (var i = 0; i < object.topPrefixes.length; ++i) { - if (!$util.isObject(object.topPrefixes[i])) + if (typeof object.topPrefixes[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.topPrefixes: object expected"); message.topPrefixes[i] = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution.fromObject(object.topPrefixes[i], long + 1); } @@ -17430,20 +16866,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Contribution.toObject = function toObject(message, options, q) { + Contribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topPrefixes = []; if (message.topPrefixes && message.topPrefixes.length) { object.topPrefixes = []; for (var j = 0; j < message.topPrefixes.length; ++j) - object.topPrefixes[j] = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution.toObject(message.topPrefixes[j], options, q + 1); + object.topPrefixes[j] = $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution.toObject(message.topPrefixes[j], options); } return object; }; @@ -17545,13 +16977,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrefixContribution.encode = function encode(message, writer, q) { + PrefixContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.prefix); if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) @@ -17571,7 +16999,7 @@ * @returns {$protobuf.Writer} Writer */ PrefixContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -17649,13 +17077,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) + if (message.totalEgressBytes != null && message.hasOwnProperty("totalEgressBytes")) if (!$util.isInteger(message.totalEgressBytes) && !(message.totalEgressBytes && $util.isInteger(message.totalEgressBytes.low) && $util.isInteger(message.totalEgressBytes.high))) return "totalEgressBytes: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; return null; @@ -17672,8 +17100,6 @@ PrefixContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17683,7 +17109,7 @@ message.prefix = String(object.prefix); if (object.totalEgressBytes != null) if ($util.Long) - message.totalEgressBytes = $util.Long.fromValue(object.totalEgressBytes, false); + (message.totalEgressBytes = $util.Long.fromValue(object.totalEgressBytes)).unsigned = false; else if (typeof object.totalEgressBytes === "string") message.totalEgressBytes = parseInt(object.totalEgressBytes, 10); else if (typeof object.totalEgressBytes === "number") @@ -17704,33 +17130,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrefixContribution.toObject = function toObject(message, options, q) { + PrefixContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.prefix = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalEgressBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalEgressBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalEgressBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalEgressBytes = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.totalEgressBytes != null && Object.hasOwnProperty.call(message, "totalEgressBytes")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalEgressBytes = typeof message.totalEgressBytes === "number" ? BigInt(message.totalEgressBytes) : $util.Long.fromBits(message.totalEgressBytes.low >>> 0, message.totalEgressBytes.high >>> 0, false).toBigInt(); - else if (typeof message.totalEgressBytes === "number") + if (message.totalEgressBytes != null && message.hasOwnProperty("totalEgressBytes")) + if (typeof message.totalEgressBytes === "number") object.totalEgressBytes = options.longs === String ? String(message.totalEgressBytes) : message.totalEgressBytes; else object.totalEgressBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalEgressBytes) : options.longs === Number ? new $util.LongBits(message.totalEgressBytes.low >>> 0, message.totalEgressBytes.high >>> 0).toNumber() : message.totalEgressBytes; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; return object; }; @@ -17845,20 +17265,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ThrottledRequestSpike.encode = function encode(message, writer, q) { + ThrottledRequestSpike.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.throttledRequests); if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.percentageIncrease); if (message.topBuckets != null && message.topBuckets.length) for (var i = 0; i < message.topBuckets.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -17872,7 +17288,7 @@ * @returns {$protobuf.Writer} Writer */ ThrottledRequestSpike.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -17952,13 +17368,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) + if (message.throttledRequests != null && message.hasOwnProperty("throttledRequests")) if (!$util.isInteger(message.throttledRequests) && !(message.throttledRequests && $util.isInteger(message.throttledRequests.low) && $util.isInteger(message.throttledRequests.high))) return "throttledRequests: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.topBuckets != null && Object.hasOwnProperty.call(message, "topBuckets")) { + if (message.topBuckets != null && message.hasOwnProperty("topBuckets")) { if (!Array.isArray(message.topBuckets)) return "topBuckets: array expected"; for (var i = 0; i < message.topBuckets.length; ++i) { @@ -17981,8 +17397,6 @@ ThrottledRequestSpike.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17990,7 +17404,7 @@ var message = new $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike(); if (object.throttledRequests != null) if ($util.Long) - message.throttledRequests = $util.Long.fromValue(object.throttledRequests, false); + (message.throttledRequests = $util.Long.fromValue(object.throttledRequests)).unsigned = false; else if (typeof object.throttledRequests === "string") message.throttledRequests = parseInt(object.throttledRequests, 10); else if (typeof object.throttledRequests === "number") @@ -18004,7 +17418,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.topBuckets: array expected"); message.topBuckets = []; for (var i = 0; i < object.topBuckets.length; ++i) { - if (!$util.isObject(object.topBuckets[i])) + if (typeof object.topBuckets[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.topBuckets: object expected"); message.topBuckets[i] = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.fromObject(object.topBuckets[i], long + 1); } @@ -18021,37 +17435,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ThrottledRequestSpike.toObject = function toObject(message, options, q) { + ThrottledRequestSpike.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topBuckets = []; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); - object.throttledRequests = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.throttledRequests = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.throttledRequests = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.throttledRequests = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.throttledRequests = typeof message.throttledRequests === "number" ? BigInt(message.throttledRequests) : $util.Long.fromBits(message.throttledRequests.low >>> 0, message.throttledRequests.high >>> 0, false).toBigInt(); - else if (typeof message.throttledRequests === "number") + if (message.throttledRequests != null && message.hasOwnProperty("throttledRequests")) + if (typeof message.throttledRequests === "number") object.throttledRequests = options.longs === String ? String(message.throttledRequests) : message.throttledRequests; else object.throttledRequests = options.longs === String ? $util.Long.prototype.toString.call(message.throttledRequests) : options.longs === Number ? new $util.LongBits(message.throttledRequests.low >>> 0, message.throttledRequests.high >>> 0).toNumber() : message.throttledRequests; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; if (message.topBuckets && message.topBuckets.length) { object.topBuckets = []; for (var j = 0; j < message.topBuckets.length; ++j) - object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.toObject(message.topBuckets[j], options, q + 1); + object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.toObject(message.topBuckets[j], options); } return object; }; @@ -18185,13 +17593,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketContribution.encode = function encode(message, writer, q) { + BucketContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) @@ -18199,9 +17603,9 @@ if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentageIncrease); if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) - $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.encode(message.contribution, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.encode(message.contribution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -18215,7 +17619,7 @@ * @returns {$protobuf.Writer} Writer */ BucketContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -18302,16 +17706,16 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) + if (message.throttledRequests != null && message.hasOwnProperty("throttledRequests")) if (!$util.isInteger(message.throttledRequests) && !(message.throttledRequests && $util.isInteger(message.throttledRequests.low) && $util.isInteger(message.throttledRequests.high))) return "throttledRequests: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) { + if (message.contribution != null && message.hasOwnProperty("contribution")) { properties.details = 1; { var error = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.verify(message.contribution, long + 1); @@ -18319,7 +17723,7 @@ return "contribution." + error; } } - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + if (message.error != null && message.hasOwnProperty("error")) { if (properties.details === 1) return "details: multiple values"; properties.details = 1; @@ -18343,8 +17747,6 @@ BucketContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18354,7 +17756,7 @@ message.bucket = String(object.bucket); if (object.throttledRequests != null) if ($util.Long) - message.throttledRequests = $util.Long.fromValue(object.throttledRequests, false); + (message.throttledRequests = $util.Long.fromValue(object.throttledRequests)).unsigned = false; else if (typeof object.throttledRequests === "string") message.throttledRequests = parseInt(object.throttledRequests, 10); else if (typeof object.throttledRequests === "number") @@ -18364,12 +17766,12 @@ if (object.percentageIncrease != null) message.percentageIncrease = Number(object.percentageIncrease); if (object.contribution != null) { - if (!$util.isObject(object.contribution)) + if (typeof object.contribution !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.contribution: object expected"); message.contribution = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.fromObject(object.contribution, long + 1); } if (object.error != null) { - if (!$util.isObject(object.error)) + if (typeof object.error !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); } @@ -18385,41 +17787,35 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BucketContribution.toObject = function toObject(message, options, q) { + BucketContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.bucket = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.throttledRequests = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.throttledRequests = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.throttledRequests = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.throttledRequests = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.throttledRequests = typeof message.throttledRequests === "number" ? BigInt(message.throttledRequests) : $util.Long.fromBits(message.throttledRequests.low >>> 0, message.throttledRequests.high >>> 0, false).toBigInt(); - else if (typeof message.throttledRequests === "number") + if (message.throttledRequests != null && message.hasOwnProperty("throttledRequests")) + if (typeof message.throttledRequests === "number") object.throttledRequests = options.longs === String ? String(message.throttledRequests) : message.throttledRequests; else object.throttledRequests = options.longs === String ? $util.Long.prototype.toString.call(message.throttledRequests) : options.longs === Number ? new $util.LongBits(message.throttledRequests.low >>> 0, message.throttledRequests.high >>> 0).toNumber() : message.throttledRequests; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; - if (message.contribution != null && Object.hasOwnProperty.call(message, "contribution")) { - object.contribution = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.toObject(message.contribution, options, q + 1); + if (message.contribution != null && message.hasOwnProperty("contribution")) { + object.contribution = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.toObject(message.contribution, options); if (options.oneofs) object.details = "contribution"; } - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); if (options.oneofs) object.details = "error"; } @@ -18506,16 +17902,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Contribution.encode = function encode(message, writer, q) { + Contribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.topPrefixes != null && message.topPrefixes.length) for (var i = 0; i < message.topPrefixes.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution.encode(message.topPrefixes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution.encode(message.topPrefixes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -18529,7 +17921,7 @@ * @returns {$protobuf.Writer} Writer */ Contribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -18601,7 +17993,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.topPrefixes != null && Object.hasOwnProperty.call(message, "topPrefixes")) { + if (message.topPrefixes != null && message.hasOwnProperty("topPrefixes")) { if (!Array.isArray(message.topPrefixes)) return "topPrefixes: array expected"; for (var i = 0; i < message.topPrefixes.length; ++i) { @@ -18624,8 +18016,6 @@ Contribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18636,7 +18026,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.topPrefixes: array expected"); message.topPrefixes = []; for (var i = 0; i < object.topPrefixes.length; ++i) { - if (!$util.isObject(object.topPrefixes[i])) + if (typeof object.topPrefixes[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.topPrefixes: object expected"); message.topPrefixes[i] = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution.fromObject(object.topPrefixes[i], long + 1); } @@ -18653,20 +18043,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Contribution.toObject = function toObject(message, options, q) { + Contribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topPrefixes = []; if (message.topPrefixes && message.topPrefixes.length) { object.topPrefixes = []; for (var j = 0; j < message.topPrefixes.length; ++j) - object.topPrefixes[j] = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution.toObject(message.topPrefixes[j], options, q + 1); + object.topPrefixes[j] = $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution.toObject(message.topPrefixes[j], options); } return object; }; @@ -18768,13 +18154,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrefixContribution.encode = function encode(message, writer, q) { + PrefixContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.prefix); if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) @@ -18794,7 +18176,7 @@ * @returns {$protobuf.Writer} Writer */ PrefixContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -18872,13 +18254,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) + if (message.throttledRequests != null && message.hasOwnProperty("throttledRequests")) if (!$util.isInteger(message.throttledRequests) && !(message.throttledRequests && $util.isInteger(message.throttledRequests.low) && $util.isInteger(message.throttledRequests.high))) return "throttledRequests: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; return null; @@ -18895,8 +18277,6 @@ PrefixContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18906,7 +18286,7 @@ message.prefix = String(object.prefix); if (object.throttledRequests != null) if ($util.Long) - message.throttledRequests = $util.Long.fromValue(object.throttledRequests, false); + (message.throttledRequests = $util.Long.fromValue(object.throttledRequests)).unsigned = false; else if (typeof object.throttledRequests === "string") message.throttledRequests = parseInt(object.throttledRequests, 10); else if (typeof object.throttledRequests === "number") @@ -18927,33 +18307,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrefixContribution.toObject = function toObject(message, options, q) { + PrefixContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.prefix = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.throttledRequests = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.throttledRequests = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.throttledRequests = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.throttledRequests = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.throttledRequests != null && Object.hasOwnProperty.call(message, "throttledRequests")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.throttledRequests = typeof message.throttledRequests === "number" ? BigInt(message.throttledRequests) : $util.Long.fromBits(message.throttledRequests.low >>> 0, message.throttledRequests.high >>> 0, false).toBigInt(); - else if (typeof message.throttledRequests === "number") + if (message.throttledRequests != null && message.hasOwnProperty("throttledRequests")) + if (typeof message.throttledRequests === "number") object.throttledRequests = options.longs === String ? String(message.throttledRequests) : message.throttledRequests; else object.throttledRequests = options.longs === String ? $util.Long.prototype.toString.call(message.throttledRequests) : options.longs === Number ? new $util.LongBits(message.throttledRequests.low >>> 0, message.throttledRequests.high >>> 0).toNumber() : message.throttledRequests; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; return object; }; @@ -19068,20 +18442,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StorageGrowthAboveTrend.encode = function encode(message, writer, q) { + StorageGrowthAboveTrend.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.totalStorageGrowthBytes != null && Object.hasOwnProperty.call(message, "totalStorageGrowthBytes")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalStorageGrowthBytes); if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.percentageIncrease); if (message.topBuckets != null && message.topBuckets.length) for (var i = 0; i < message.topBuckets.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution.encode(message.topBuckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -19095,7 +18465,7 @@ * @returns {$protobuf.Writer} Writer */ StorageGrowthAboveTrend.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -19175,13 +18545,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.totalStorageGrowthBytes != null && Object.hasOwnProperty.call(message, "totalStorageGrowthBytes")) + if (message.totalStorageGrowthBytes != null && message.hasOwnProperty("totalStorageGrowthBytes")) if (!$util.isInteger(message.totalStorageGrowthBytes) && !(message.totalStorageGrowthBytes && $util.isInteger(message.totalStorageGrowthBytes.low) && $util.isInteger(message.totalStorageGrowthBytes.high))) return "totalStorageGrowthBytes: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.topBuckets != null && Object.hasOwnProperty.call(message, "topBuckets")) { + if (message.topBuckets != null && message.hasOwnProperty("topBuckets")) { if (!Array.isArray(message.topBuckets)) return "topBuckets: array expected"; for (var i = 0; i < message.topBuckets.length; ++i) { @@ -19204,8 +18574,6 @@ StorageGrowthAboveTrend.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19213,7 +18581,7 @@ var message = new $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend(); if (object.totalStorageGrowthBytes != null) if ($util.Long) - message.totalStorageGrowthBytes = $util.Long.fromValue(object.totalStorageGrowthBytes, false); + (message.totalStorageGrowthBytes = $util.Long.fromValue(object.totalStorageGrowthBytes)).unsigned = false; else if (typeof object.totalStorageGrowthBytes === "string") message.totalStorageGrowthBytes = parseInt(object.totalStorageGrowthBytes, 10); else if (typeof object.totalStorageGrowthBytes === "number") @@ -19227,7 +18595,7 @@ throw TypeError(".google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.topBuckets: array expected"); message.topBuckets = []; for (var i = 0; i < object.topBuckets.length; ++i) { - if (!$util.isObject(object.topBuckets[i])) + if (typeof object.topBuckets[i] !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.topBuckets: object expected"); message.topBuckets[i] = $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution.fromObject(object.topBuckets[i], long + 1); } @@ -19244,37 +18612,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StorageGrowthAboveTrend.toObject = function toObject(message, options, q) { + StorageGrowthAboveTrend.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.topBuckets = []; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalStorageGrowthBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalStorageGrowthBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalStorageGrowthBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalStorageGrowthBytes = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.totalStorageGrowthBytes != null && Object.hasOwnProperty.call(message, "totalStorageGrowthBytes")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalStorageGrowthBytes = typeof message.totalStorageGrowthBytes === "number" ? BigInt(message.totalStorageGrowthBytes) : $util.Long.fromBits(message.totalStorageGrowthBytes.low >>> 0, message.totalStorageGrowthBytes.high >>> 0, false).toBigInt(); - else if (typeof message.totalStorageGrowthBytes === "number") + if (message.totalStorageGrowthBytes != null && message.hasOwnProperty("totalStorageGrowthBytes")) + if (typeof message.totalStorageGrowthBytes === "number") object.totalStorageGrowthBytes = options.longs === String ? String(message.totalStorageGrowthBytes) : message.totalStorageGrowthBytes; else object.totalStorageGrowthBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStorageGrowthBytes) : options.longs === Number ? new $util.LongBits(message.totalStorageGrowthBytes.low >>> 0, message.totalStorageGrowthBytes.high >>> 0).toNumber() : message.totalStorageGrowthBytes; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; if (message.topBuckets && message.topBuckets.length) { object.topBuckets = []; for (var j = 0; j < message.topBuckets.length; ++j) - object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution.toObject(message.topBuckets[j], options, q + 1); + object.topBuckets[j] = $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution.toObject(message.topBuckets[j], options); } return object; }; @@ -19399,13 +18761,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketContribution.encode = function encode(message, writer, q) { + BucketContribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); if (message.totalStorageGrowthBytes != null && Object.hasOwnProperty.call(message, "totalStorageGrowthBytes")) @@ -19413,7 +18771,7 @@ if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.percentageIncrease); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -19427,7 +18785,7 @@ * @returns {$protobuf.Writer} Writer */ BucketContribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -19510,16 +18868,16 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.totalStorageGrowthBytes != null && Object.hasOwnProperty.call(message, "totalStorageGrowthBytes")) + if (message.totalStorageGrowthBytes != null && message.hasOwnProperty("totalStorageGrowthBytes")) if (!$util.isInteger(message.totalStorageGrowthBytes) && !(message.totalStorageGrowthBytes && $util.isInteger(message.totalStorageGrowthBytes.low) && $util.isInteger(message.totalStorageGrowthBytes.high))) return "totalStorageGrowthBytes: integer|Long expected"; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) if (typeof message.percentageIncrease !== "number") return "percentageIncrease: number expected"; - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + if (message.error != null && message.hasOwnProperty("error")) { properties.details = 1; { var error = $root.google.rpc.Status.verify(message.error, long + 1); @@ -19541,8 +18899,6 @@ BucketContribution.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19552,7 +18908,7 @@ message.bucket = String(object.bucket); if (object.totalStorageGrowthBytes != null) if ($util.Long) - message.totalStorageGrowthBytes = $util.Long.fromValue(object.totalStorageGrowthBytes, false); + (message.totalStorageGrowthBytes = $util.Long.fromValue(object.totalStorageGrowthBytes)).unsigned = false; else if (typeof object.totalStorageGrowthBytes === "string") message.totalStorageGrowthBytes = parseInt(object.totalStorageGrowthBytes, 10); else if (typeof object.totalStorageGrowthBytes === "number") @@ -19562,7 +18918,7 @@ if (object.percentageIncrease != null) message.percentageIncrease = Number(object.percentageIncrease); if (object.error != null) { - if (!$util.isObject(object.error)) + if (typeof object.error !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); } @@ -19578,36 +18934,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BucketContribution.toObject = function toObject(message, options, q) { + BucketContribution.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.bucket = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.totalStorageGrowthBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalStorageGrowthBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalStorageGrowthBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalStorageGrowthBytes = options.longs === String ? "0" : 0; object.percentageIncrease = 0; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.totalStorageGrowthBytes != null && Object.hasOwnProperty.call(message, "totalStorageGrowthBytes")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalStorageGrowthBytes = typeof message.totalStorageGrowthBytes === "number" ? BigInt(message.totalStorageGrowthBytes) : $util.Long.fromBits(message.totalStorageGrowthBytes.low >>> 0, message.totalStorageGrowthBytes.high >>> 0, false).toBigInt(); - else if (typeof message.totalStorageGrowthBytes === "number") + if (message.totalStorageGrowthBytes != null && message.hasOwnProperty("totalStorageGrowthBytes")) + if (typeof message.totalStorageGrowthBytes === "number") object.totalStorageGrowthBytes = options.longs === String ? String(message.totalStorageGrowthBytes) : message.totalStorageGrowthBytes; else object.totalStorageGrowthBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStorageGrowthBytes) : options.longs === Number ? new $util.LongBits(message.totalStorageGrowthBytes.low >>> 0, message.totalStorageGrowthBytes.high >>> 0).toNumber() : message.totalStorageGrowthBytes; - if (message.percentageIncrease != null && Object.hasOwnProperty.call(message, "percentageIncrease")) + if (message.percentageIncrease != null && message.hasOwnProperty("percentageIncrease")) object.percentageIncrease = options.json && !isFinite(message.percentageIncrease) ? String(message.percentageIncrease) : message.percentageIncrease; - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); if (options.oneofs) object.details = "error"; } @@ -19720,19 +19070,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntelligenceFindingRevision.encode = function encode(message, writer, q) { + IntelligenceFindingRevision.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - $root.google.storage.control.v2.IntelligenceFinding.encode(message.snapshot, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.encode(message.snapshot, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -19746,7 +19092,7 @@ * @returns {$protobuf.Writer} Writer */ IntelligenceFindingRevision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -19824,15 +19170,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) { + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { var error = $root.google.storage.control.v2.IntelligenceFinding.verify(message.snapshot, long + 1); if (error) return "snapshot." + error; } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; @@ -19851,8 +19197,6 @@ IntelligenceFindingRevision.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.IntelligenceFindingRevision) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.IntelligenceFindingRevision: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19861,12 +19205,12 @@ if (object.name != null) message.name = String(object.name); if (object.snapshot != null) { - if (!$util.isObject(object.snapshot)) + if (typeof object.snapshot !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFindingRevision.snapshot: object expected"); message.snapshot = $root.google.storage.control.v2.IntelligenceFinding.fromObject(object.snapshot, long + 1); } if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.IntelligenceFindingRevision.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } @@ -19882,25 +19226,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IntelligenceFindingRevision.toObject = function toObject(message, options, q) { + IntelligenceFindingRevision.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.snapshot = null; object.createTime = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - object.snapshot = $root.google.storage.control.v2.IntelligenceFinding.toObject(message.snapshot, options, q + 1); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.storage.control.v2.IntelligenceFinding.toObject(message.snapshot, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); return object; }; @@ -19986,13 +19326,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIntelligenceFindingRequest.encode = function encode(message, writer, q) { + GetIntelligenceFindingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -20008,7 +19344,7 @@ * @returns {$protobuf.Writer} Writer */ GetIntelligenceFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -20078,7 +19414,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -20095,8 +19431,6 @@ GetIntelligenceFindingRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetIntelligenceFindingRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetIntelligenceFindingRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -20116,17 +19450,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIntelligenceFindingRequest.toObject = function toObject(message, options, q) { + GetIntelligenceFindingRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -20240,13 +19570,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntelligenceFindingsRequest.encode = function encode(message, writer, q) { + ListIntelligenceFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -20268,7 +19594,7 @@ * @returns {$protobuf.Writer} Writer */ ListIntelligenceFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -20350,16 +19676,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -20376,8 +19702,6 @@ ListIntelligenceFindingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListIntelligenceFindingsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListIntelligenceFindingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -20403,13 +19727,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIntelligenceFindingsRequest.toObject = function toObject(message, options, q) { + ListIntelligenceFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -20417,13 +19737,13 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; return object; }; @@ -20520,16 +19840,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntelligenceFindingsResponse.encode = function encode(message, writer, q) { + ListIntelligenceFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.intelligenceFindings != null && message.intelligenceFindings.length) for (var i = 0; i < message.intelligenceFindings.length; ++i) - $root.google.storage.control.v2.IntelligenceFinding.encode(message.intelligenceFindings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFinding.encode(message.intelligenceFindings[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; @@ -20545,7 +19861,7 @@ * @returns {$protobuf.Writer} Writer */ ListIntelligenceFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -20621,7 +19937,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.intelligenceFindings != null && Object.hasOwnProperty.call(message, "intelligenceFindings")) { + if (message.intelligenceFindings != null && message.hasOwnProperty("intelligenceFindings")) { if (!Array.isArray(message.intelligenceFindings)) return "intelligenceFindings: array expected"; for (var i = 0; i < message.intelligenceFindings.length; ++i) { @@ -20630,7 +19946,7 @@ return "intelligenceFindings." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -20647,8 +19963,6 @@ ListIntelligenceFindingsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListIntelligenceFindingsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListIntelligenceFindingsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -20659,7 +19973,7 @@ throw TypeError(".google.storage.control.v2.ListIntelligenceFindingsResponse.intelligenceFindings: array expected"); message.intelligenceFindings = []; for (var i = 0; i < object.intelligenceFindings.length; ++i) { - if (!$util.isObject(object.intelligenceFindings[i])) + if (typeof object.intelligenceFindings[i] !== "object") throw TypeError(".google.storage.control.v2.ListIntelligenceFindingsResponse.intelligenceFindings: object expected"); message.intelligenceFindings[i] = $root.google.storage.control.v2.IntelligenceFinding.fromObject(object.intelligenceFindings[i], long + 1); } @@ -20678,13 +19992,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIntelligenceFindingsResponse.toObject = function toObject(message, options, q) { + ListIntelligenceFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.intelligenceFindings = []; @@ -20693,9 +20003,9 @@ if (message.intelligenceFindings && message.intelligenceFindings.length) { object.intelligenceFindings = []; for (var j = 0; j < message.intelligenceFindings.length; ++j) - object.intelligenceFindings[j] = $root.google.storage.control.v2.IntelligenceFinding.toObject(message.intelligenceFindings[j], options, q + 1); + object.intelligenceFindings[j] = $root.google.storage.control.v2.IntelligenceFinding.toObject(message.intelligenceFindings[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -20818,13 +20128,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SummarizeIntelligenceFindingsRequest.encode = function encode(message, writer, q) { + SummarizeIntelligenceFindingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.resourceScope != null && Object.hasOwnProperty.call(message, "resourceScope")) @@ -20848,7 +20154,7 @@ * @returns {$protobuf.Writer} Writer */ SummarizeIntelligenceFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -20934,10 +20240,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.resourceScope != null && Object.hasOwnProperty.call(message, "resourceScope")) + if (message.resourceScope != null && message.hasOwnProperty("resourceScope")) switch (message.resourceScope) { default: return "resourceScope: enum value expected"; @@ -20946,13 +20252,13 @@ case 2: break; } - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -20969,8 +20275,6 @@ SummarizeIntelligenceFindingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.SummarizeIntelligenceFindingsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.SummarizeIntelligenceFindingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21016,13 +20320,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SummarizeIntelligenceFindingsRequest.toObject = function toObject(message, options, q) { + SummarizeIntelligenceFindingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -21031,15 +20331,15 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.resourceScope != null && Object.hasOwnProperty.call(message, "resourceScope")) + if (message.resourceScope != null && message.hasOwnProperty("resourceScope")) object.resourceScope = options.enums === String ? $root.google.storage.control.v2.SummarizeIntelligenceFindingsRequest.ResourceScope[message.resourceScope] === undefined ? message.resourceScope : $root.google.storage.control.v2.SummarizeIntelligenceFindingsRequest.ResourceScope[message.resourceScope] : message.resourceScope; - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; return object; }; @@ -21152,16 +20452,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SummarizeIntelligenceFindingsResponse.encode = function encode(message, writer, q) { + SummarizeIntelligenceFindingsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.findingSummaries != null && message.findingSummaries.length) for (var i = 0; i < message.findingSummaries.length; ++i) - $root.google.storage.control.v2.FindingSummary.encode(message.findingSummaries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.FindingSummary.encode(message.findingSummaries[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; @@ -21177,7 +20473,7 @@ * @returns {$protobuf.Writer} Writer */ SummarizeIntelligenceFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -21253,7 +20549,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.findingSummaries != null && Object.hasOwnProperty.call(message, "findingSummaries")) { + if (message.findingSummaries != null && message.hasOwnProperty("findingSummaries")) { if (!Array.isArray(message.findingSummaries)) return "findingSummaries: array expected"; for (var i = 0; i < message.findingSummaries.length; ++i) { @@ -21262,7 +20558,7 @@ return "findingSummaries." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -21279,8 +20575,6 @@ SummarizeIntelligenceFindingsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.SummarizeIntelligenceFindingsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.SummarizeIntelligenceFindingsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21291,7 +20585,7 @@ throw TypeError(".google.storage.control.v2.SummarizeIntelligenceFindingsResponse.findingSummaries: array expected"); message.findingSummaries = []; for (var i = 0; i < object.findingSummaries.length; ++i) { - if (!$util.isObject(object.findingSummaries[i])) + if (typeof object.findingSummaries[i] !== "object") throw TypeError(".google.storage.control.v2.SummarizeIntelligenceFindingsResponse.findingSummaries: object expected"); message.findingSummaries[i] = $root.google.storage.control.v2.FindingSummary.fromObject(object.findingSummaries[i], long + 1); } @@ -21310,13 +20604,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SummarizeIntelligenceFindingsResponse.toObject = function toObject(message, options, q) { + SummarizeIntelligenceFindingsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.findingSummaries = []; @@ -21325,9 +20615,9 @@ if (message.findingSummaries && message.findingSummaries.length) { object.findingSummaries = []; for (var j = 0; j < message.findingSummaries.length; ++j) - object.findingSummaries[j] = $root.google.storage.control.v2.FindingSummary.toObject(message.findingSummaries[j], options, q + 1); + object.findingSummaries[j] = $root.google.storage.control.v2.FindingSummary.toObject(message.findingSummaries[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -21414,13 +20704,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIntelligenceFindingRevisionRequest.encode = function encode(message, writer, q) { + GetIntelligenceFindingRevisionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -21436,7 +20722,7 @@ * @returns {$protobuf.Writer} Writer */ GetIntelligenceFindingRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -21506,7 +20792,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -21523,8 +20809,6 @@ GetIntelligenceFindingRevisionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.GetIntelligenceFindingRevisionRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.GetIntelligenceFindingRevisionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21544,17 +20828,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIntelligenceFindingRevisionRequest.toObject = function toObject(message, options, q) { + GetIntelligenceFindingRevisionRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -21659,13 +20939,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntelligenceFindingRevisionsRequest.encode = function encode(message, writer, q) { + ListIntelligenceFindingRevisionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -21685,7 +20961,7 @@ * @returns {$protobuf.Writer} Writer */ ListIntelligenceFindingRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -21763,13 +21039,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -21786,8 +21062,6 @@ ListIntelligenceFindingRevisionsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListIntelligenceFindingRevisionsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListIntelligenceFindingRevisionsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21811,24 +21085,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIntelligenceFindingRevisionsRequest.toObject = function toObject(message, options, q) { + ListIntelligenceFindingRevisionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; return object; }; @@ -21925,16 +21195,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntelligenceFindingRevisionsResponse.encode = function encode(message, writer, q) { + ListIntelligenceFindingRevisionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.intelligenceFindingRevisions != null && message.intelligenceFindingRevisions.length) for (var i = 0; i < message.intelligenceFindingRevisions.length; ++i) - $root.google.storage.control.v2.IntelligenceFindingRevision.encode(message.intelligenceFindingRevisions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.IntelligenceFindingRevision.encode(message.intelligenceFindingRevisions[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; @@ -21950,7 +21216,7 @@ * @returns {$protobuf.Writer} Writer */ ListIntelligenceFindingRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -22026,7 +21292,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.intelligenceFindingRevisions != null && Object.hasOwnProperty.call(message, "intelligenceFindingRevisions")) { + if (message.intelligenceFindingRevisions != null && message.hasOwnProperty("intelligenceFindingRevisions")) { if (!Array.isArray(message.intelligenceFindingRevisions)) return "intelligenceFindingRevisions: array expected"; for (var i = 0; i < message.intelligenceFindingRevisions.length; ++i) { @@ -22035,7 +21301,7 @@ return "intelligenceFindingRevisions." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -22052,8 +21318,6 @@ ListIntelligenceFindingRevisionsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.ListIntelligenceFindingRevisionsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.ListIntelligenceFindingRevisionsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22064,7 +21328,7 @@ throw TypeError(".google.storage.control.v2.ListIntelligenceFindingRevisionsResponse.intelligenceFindingRevisions: array expected"); message.intelligenceFindingRevisions = []; for (var i = 0; i < object.intelligenceFindingRevisions.length; ++i) { - if (!$util.isObject(object.intelligenceFindingRevisions[i])) + if (typeof object.intelligenceFindingRevisions[i] !== "object") throw TypeError(".google.storage.control.v2.ListIntelligenceFindingRevisionsResponse.intelligenceFindingRevisions: object expected"); message.intelligenceFindingRevisions[i] = $root.google.storage.control.v2.IntelligenceFindingRevision.fromObject(object.intelligenceFindingRevisions[i], long + 1); } @@ -22083,13 +21347,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIntelligenceFindingRevisionsResponse.toObject = function toObject(message, options, q) { + ListIntelligenceFindingRevisionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.intelligenceFindingRevisions = []; @@ -22098,9 +21358,9 @@ if (message.intelligenceFindingRevisions && message.intelligenceFindingRevisions.length) { object.intelligenceFindingRevisions = []; for (var j = 0; j < message.intelligenceFindingRevisions.length; ++j) - object.intelligenceFindingRevisions[j] = $root.google.storage.control.v2.IntelligenceFindingRevision.toObject(message.intelligenceFindingRevisions[j], options, q + 1); + object.intelligenceFindingRevisions[j] = $root.google.storage.control.v2.IntelligenceFindingRevision.toObject(message.intelligenceFindingRevisions[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -22242,13 +21502,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FindingSummary.encode = function encode(message, writer, q) { + FindingSummary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); if (message.category != null && Object.hasOwnProperty.call(message, "category")) @@ -22256,14 +21512,14 @@ if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetResource); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.severity); if (message.summaryDetails != null && message.summaryDetails.length) for (var i = 0; i < message.summaryDetails.length; ++i) - $root.google.storage.control.v2.FindingSummary.SummaryDetails.encode(message.summaryDetails[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + $root.google.storage.control.v2.FindingSummary.SummaryDetails.encode(message.summaryDetails[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -22277,7 +21533,7 @@ * @returns {$protobuf.Writer} Writer */ FindingSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -22373,7 +21629,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; @@ -22384,7 +21640,7 @@ case 4: break; } - if (message.category != null && Object.hasOwnProperty.call(message, "category")) + if (message.category != null && message.hasOwnProperty("category")) switch (message.category) { default: return "category: enum value expected"; @@ -22393,20 +21649,20 @@ case 2: break; } - if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + if (message.targetResource != null && message.hasOwnProperty("targetResource")) if (!$util.isString(message.targetResource)) return "targetResource: string expected"; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + if (message.severity != null && message.hasOwnProperty("severity")) switch (message.severity) { default: return "severity: enum value expected"; @@ -22414,7 +21670,7 @@ case 1: break; } - if (message.summaryDetails != null && Object.hasOwnProperty.call(message, "summaryDetails")) { + if (message.summaryDetails != null && message.hasOwnProperty("summaryDetails")) { if (!Array.isArray(message.summaryDetails)) return "summaryDetails: array expected"; for (var i = 0; i < message.summaryDetails.length; ++i) { @@ -22437,8 +21693,6 @@ FindingSummary.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.FindingSummary) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.FindingSummary: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22495,12 +21749,12 @@ if (object.targetResource != null) message.targetResource = String(object.targetResource); if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.control.v2.FindingSummary.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.control.v2.FindingSummary.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -22525,7 +21779,7 @@ throw TypeError(".google.storage.control.v2.FindingSummary.summaryDetails: array expected"); message.summaryDetails = []; for (var i = 0; i < object.summaryDetails.length; ++i) { - if (!$util.isObject(object.summaryDetails[i])) + if (typeof object.summaryDetails[i] !== "object") throw TypeError(".google.storage.control.v2.FindingSummary.summaryDetails: object expected"); message.summaryDetails[i] = $root.google.storage.control.v2.FindingSummary.SummaryDetails.fromObject(object.summaryDetails[i], long + 1); } @@ -22542,13 +21796,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FindingSummary.toObject = function toObject(message, options, q) { + FindingSummary.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.summaryDetails = []; @@ -22560,22 +21810,22 @@ object.updateTime = null; object.severity = options.enums === String ? "FINDING_SEVERITY_UNSPECIFIED" : 0; } - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.storage.control.v2.FindingType[message.type] === undefined ? message.type : $root.google.storage.control.v2.FindingType[message.type] : message.type; - if (message.category != null && Object.hasOwnProperty.call(message, "category")) + if (message.category != null && message.hasOwnProperty("category")) object.category = options.enums === String ? $root.google.storage.control.v2.FindingCategory[message.category] === undefined ? message.category : $root.google.storage.control.v2.FindingCategory[message.category] : message.category; - if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + if (message.targetResource != null && message.hasOwnProperty("targetResource")) object.targetResource = message.targetResource; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + 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.severity != null && message.hasOwnProperty("severity")) object.severity = options.enums === String ? $root.google.storage.control.v2.FindingSeverity[message.severity] === undefined ? message.severity : $root.google.storage.control.v2.FindingSeverity[message.severity] : message.severity; if (message.summaryDetails && message.summaryDetails.length) { object.summaryDetails = []; for (var j = 0; j < message.summaryDetails.length; ++j) - object.summaryDetails[j] = $root.google.storage.control.v2.FindingSummary.SummaryDetails.toObject(message.summaryDetails[j], options, q + 1); + object.summaryDetails[j] = $root.google.storage.control.v2.FindingSummary.SummaryDetails.toObject(message.summaryDetails[j], options); } return object; }; @@ -22700,13 +21950,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SummaryDetails.encode = function encode(message, writer, q) { + SummaryDetails.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) @@ -22728,7 +21974,7 @@ * @returns {$protobuf.Writer} Writer */ SummaryDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -22811,19 +22057,19 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.count != null && Object.hasOwnProperty.call(message, "count")) { + if (message.count != null && message.hasOwnProperty("count")) { properties.magnitude = 1; if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; } - if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) { + if (message.percentage != null && message.hasOwnProperty("percentage")) { if (properties.magnitude === 1) return "magnitude: multiple values"; properties.magnitude = 1; if (typeof message.percentage !== "number") return "percentage: number expected"; } - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + if (message.resourceType != null && message.hasOwnProperty("resourceType")) switch (message.resourceType) { default: return "resourceType: enum value expected"; @@ -22832,7 +22078,7 @@ case 2: break; } - if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; return null; @@ -22849,8 +22095,6 @@ SummaryDetails.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.control.v2.FindingSummary.SummaryDetails) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.control.v2.FindingSummary.SummaryDetails: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22858,7 +22102,7 @@ var message = new $root.google.storage.control.v2.FindingSummary.SummaryDetails(); if (object.count != null) if ($util.Long) - message.count = $util.Long.fromValue(object.count, false); + (message.count = $util.Long.fromValue(object.count)).unsigned = false; else if (typeof object.count === "string") message.count = parseInt(object.count, 10); else if (typeof object.count === "number") @@ -22901,36 +22145,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SummaryDetails.toObject = function toObject(message, options, q) { + SummaryDetails.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; object.description = ""; } - if (message.count != null && Object.hasOwnProperty.call(message, "count")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.count = typeof message.count === "number" ? BigInt(message.count) : $util.Long.fromBits(message.count.low >>> 0, message.count.high >>> 0, false).toBigInt(); - else if (typeof message.count === "number") + if (message.count != null && message.hasOwnProperty("count")) { + if (typeof message.count === "number") object.count = options.longs === String ? String(message.count) : message.count; else object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; if (options.oneofs) object.magnitude = "count"; } - if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) { + if (message.percentage != null && message.hasOwnProperty("percentage")) { object.percentage = options.json && !isFinite(message.percentage) ? String(message.percentage) : message.percentage; if (options.oneofs) object.magnitude = "percentage"; } - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + if (message.resourceType != null && message.hasOwnProperty("resourceType")) object.resourceType = options.enums === String ? $root.google.storage.control.v2.FindingSummary.SummaryDetails.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.storage.control.v2.FindingSummary.SummaryDetails.ResourceType[message.resourceType] : message.resourceType; - if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; return object; }; @@ -23100,7 +22338,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.deleteBucket = function deleteBucket(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteBucket, $root.google.storage.v2.DeleteBucketRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteBucket, $root.google.storage.v2.DeleteBucketRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteBucket" }); /** @@ -23133,7 +22371,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.getBucket = function getBucket(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getBucket, $root.google.storage.v2.GetBucketRequest, $root.google.storage.v2.Bucket, request, callback); + return this.rpcCall(getBucket, $root.google.storage.v2.GetBucketRequest, $root.google.storage.v2.Bucket, request, callback); }, "name", { value: "GetBucket" }); /** @@ -23166,7 +22404,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.createBucket = function createBucket(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBucket, $root.google.storage.v2.CreateBucketRequest, $root.google.storage.v2.Bucket, request, callback); + return this.rpcCall(createBucket, $root.google.storage.v2.CreateBucketRequest, $root.google.storage.v2.Bucket, request, callback); }, "name", { value: "CreateBucket" }); /** @@ -23199,7 +22437,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.listBuckets = function listBuckets(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBuckets, $root.google.storage.v2.ListBucketsRequest, $root.google.storage.v2.ListBucketsResponse, request, callback); + return this.rpcCall(listBuckets, $root.google.storage.v2.ListBucketsRequest, $root.google.storage.v2.ListBucketsResponse, request, callback); }, "name", { value: "ListBuckets" }); /** @@ -23232,7 +22470,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.lockBucketRetentionPolicy = function lockBucketRetentionPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, lockBucketRetentionPolicy, $root.google.storage.v2.LockBucketRetentionPolicyRequest, $root.google.storage.v2.Bucket, request, callback); + return this.rpcCall(lockBucketRetentionPolicy, $root.google.storage.v2.LockBucketRetentionPolicyRequest, $root.google.storage.v2.Bucket, request, callback); }, "name", { value: "LockBucketRetentionPolicy" }); /** @@ -23265,7 +22503,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** @@ -23298,7 +22536,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** @@ -23331,7 +22569,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** @@ -23364,7 +22602,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.updateBucket = function updateBucket(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBucket, $root.google.storage.v2.UpdateBucketRequest, $root.google.storage.v2.Bucket, request, callback); + return this.rpcCall(updateBucket, $root.google.storage.v2.UpdateBucketRequest, $root.google.storage.v2.Bucket, request, callback); }, "name", { value: "UpdateBucket" }); /** @@ -23383,7 +22621,7 @@ * @typedef ComposeObjectCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.storage.v2.StorageObject} [response] StorageObject + * @param {google.storage.v2.StorageObject} [response] Object */ /** @@ -23392,12 +22630,12 @@ * @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 StorageObject + * @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 $protobuf.rpc.Service.prototype.rpcCall.call(this, composeObject, $root.google.storage.v2.ComposeObjectRequest, $root.google.storage.v2.StorageObject, request, callback); + return this.rpcCall(composeObject, $root.google.storage.v2.ComposeObjectRequest, $root.google.storage.v2.StorageObject, request, callback); }, "name", { value: "ComposeObject" }); /** @@ -23430,7 +22668,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.deleteObject = function deleteObject(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteObject, $root.google.storage.v2.DeleteObjectRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteObject, $root.google.storage.v2.DeleteObjectRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteObject" }); /** @@ -23449,7 +22687,7 @@ * @typedef RestoreObjectCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.storage.v2.StorageObject} [response] StorageObject + * @param {google.storage.v2.StorageObject} [response] Object */ /** @@ -23458,12 +22696,12 @@ * @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 StorageObject + * @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 $protobuf.rpc.Service.prototype.rpcCall.call(this, restoreObject, $root.google.storage.v2.RestoreObjectRequest, $root.google.storage.v2.StorageObject, request, callback); + return this.rpcCall(restoreObject, $root.google.storage.v2.RestoreObjectRequest, $root.google.storage.v2.StorageObject, request, callback); }, "name", { value: "RestoreObject" }); /** @@ -23496,7 +22734,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.cancelResumableWrite = function cancelResumableWrite(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, cancelResumableWrite, $root.google.storage.v2.CancelResumableWriteRequest, $root.google.storage.v2.CancelResumableWriteResponse, request, callback); + return this.rpcCall(cancelResumableWrite, $root.google.storage.v2.CancelResumableWriteRequest, $root.google.storage.v2.CancelResumableWriteResponse, request, callback); }, "name", { value: "CancelResumableWrite" }); /** @@ -23515,7 +22753,7 @@ * @typedef GetObjectCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.storage.v2.StorageObject} [response] StorageObject + * @param {google.storage.v2.StorageObject} [response] Object */ /** @@ -23524,12 +22762,12 @@ * @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 StorageObject + * @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 $protobuf.rpc.Service.prototype.rpcCall.call(this, getObject, $root.google.storage.v2.GetObjectRequest, $root.google.storage.v2.StorageObject, request, callback); + return this.rpcCall(getObject, $root.google.storage.v2.GetObjectRequest, $root.google.storage.v2.StorageObject, request, callback); }, "name", { value: "GetObject" }); /** @@ -23562,7 +22800,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.readObject = function readObject(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, readObject, $root.google.storage.v2.ReadObjectRequest, $root.google.storage.v2.ReadObjectResponse, request, callback); + return this.rpcCall(readObject, $root.google.storage.v2.ReadObjectRequest, $root.google.storage.v2.ReadObjectResponse, request, callback); }, "name", { value: "ReadObject" }); /** @@ -23595,7 +22833,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.bidiReadObject = function bidiReadObject(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, bidiReadObject, $root.google.storage.v2.BidiReadObjectRequest, $root.google.storage.v2.BidiReadObjectResponse, request, callback); + return this.rpcCall(bidiReadObject, $root.google.storage.v2.BidiReadObjectRequest, $root.google.storage.v2.BidiReadObjectResponse, request, callback); }, "name", { value: "BidiReadObject" }); /** @@ -23614,7 +22852,7 @@ * @typedef UpdateObjectCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.storage.v2.StorageObject} [response] StorageObject + * @param {google.storage.v2.StorageObject} [response] Object */ /** @@ -23623,12 +22861,12 @@ * @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 StorageObject + * @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 $protobuf.rpc.Service.prototype.rpcCall.call(this, updateObject, $root.google.storage.v2.UpdateObjectRequest, $root.google.storage.v2.StorageObject, request, callback); + return this.rpcCall(updateObject, $root.google.storage.v2.UpdateObjectRequest, $root.google.storage.v2.StorageObject, request, callback); }, "name", { value: "UpdateObject" }); /** @@ -23661,7 +22899,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.writeObject = function writeObject(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, writeObject, $root.google.storage.v2.WriteObjectRequest, $root.google.storage.v2.WriteObjectResponse, request, callback); + return this.rpcCall(writeObject, $root.google.storage.v2.WriteObjectRequest, $root.google.storage.v2.WriteObjectResponse, request, callback); }, "name", { value: "WriteObject" }); /** @@ -23694,7 +22932,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.bidiWriteObject = function bidiWriteObject(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, bidiWriteObject, $root.google.storage.v2.BidiWriteObjectRequest, $root.google.storage.v2.BidiWriteObjectResponse, request, callback); + return this.rpcCall(bidiWriteObject, $root.google.storage.v2.BidiWriteObjectRequest, $root.google.storage.v2.BidiWriteObjectResponse, request, callback); }, "name", { value: "BidiWriteObject" }); /** @@ -23727,7 +22965,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.listObjects = function listObjects(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listObjects, $root.google.storage.v2.ListObjectsRequest, $root.google.storage.v2.ListObjectsResponse, request, callback); + return this.rpcCall(listObjects, $root.google.storage.v2.ListObjectsRequest, $root.google.storage.v2.ListObjectsResponse, request, callback); }, "name", { value: "ListObjects" }); /** @@ -23760,7 +22998,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.rewriteObject = function rewriteObject(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, rewriteObject, $root.google.storage.v2.RewriteObjectRequest, $root.google.storage.v2.RewriteResponse, request, callback); + return this.rpcCall(rewriteObject, $root.google.storage.v2.RewriteObjectRequest, $root.google.storage.v2.RewriteResponse, request, callback); }, "name", { value: "RewriteObject" }); /** @@ -23793,7 +23031,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.startResumableWrite = function startResumableWrite(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, startResumableWrite, $root.google.storage.v2.StartResumableWriteRequest, $root.google.storage.v2.StartResumableWriteResponse, request, callback); + return this.rpcCall(startResumableWrite, $root.google.storage.v2.StartResumableWriteRequest, $root.google.storage.v2.StartResumableWriteResponse, request, callback); }, "name", { value: "StartResumableWrite" }); /** @@ -23826,7 +23064,7 @@ * @variation 1 */ Object.defineProperty(Storage.prototype.queryWriteStatus = function queryWriteStatus(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, queryWriteStatus, $root.google.storage.v2.QueryWriteStatusRequest, $root.google.storage.v2.QueryWriteStatusResponse, request, callback); + return this.rpcCall(queryWriteStatus, $root.google.storage.v2.QueryWriteStatusRequest, $root.google.storage.v2.QueryWriteStatusResponse, request, callback); }, "name", { value: "QueryWriteStatus" }); /** @@ -23845,7 +23083,7 @@ * @typedef MoveObjectCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.storage.v2.StorageObject} [response] StorageObject + * @param {google.storage.v2.StorageObject} [response] Object */ /** @@ -23854,12 +23092,12 @@ * @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 StorageObject + * @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 $protobuf.rpc.Service.prototype.rpcCall.call(this, moveObject, $root.google.storage.v2.MoveObjectRequest, $root.google.storage.v2.StorageObject, request, callback); + return this.rpcCall(moveObject, $root.google.storage.v2.MoveObjectRequest, $root.google.storage.v2.StorageObject, request, callback); }, "name", { value: "MoveObject" }); /** @@ -23961,13 +23199,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBucketRequest.encode = function encode(message, writer, q) { + DeleteBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -23987,7 +23221,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -24066,15 +23300,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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"; @@ -24093,8 +23327,6 @@ DeleteBucketRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.DeleteBucketRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.DeleteBucketRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24104,7 +23336,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -24113,7 +23345,7 @@ 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, false); + (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") @@ -24132,32 +23364,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBucketRequest.toObject = function toObject(message, options, q) { + DeleteBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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; @@ -24297,13 +23521,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBucketRequest.encode = function encode(message, writer, q) { + GetBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -24311,7 +23531,7 @@ 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(), q + 1).ldelim(); + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -24325,7 +23545,7 @@ * @returns {$protobuf.Writer} Writer */ GetBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -24408,20 +23628,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "readMask")) { + if (message.readMask != null && message.hasOwnProperty("readMask")) { properties._readMask = 1; { var error = $root.google.protobuf.FieldMask.verify(message.readMask, long + 1); @@ -24443,8 +23663,6 @@ GetBucketRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.GetBucketRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.GetBucketRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24454,7 +23672,7 @@ message.name = String(object.name); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -24463,7 +23681,7 @@ 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, false); + (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") @@ -24471,7 +23689,7 @@ 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 (!$util.isObject(object.readMask)) + if (typeof object.readMask !== "object") throw TypeError(".google.storage.v2.GetBucketRequest.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask, long + 1); } @@ -24487,40 +23705,32 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBucketRequest.toObject = function toObject(message, options, q) { + GetBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "readMask")) { - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options, q + 1); + if (message.readMask != null && message.hasOwnProperty("readMask")) { + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); if (options.oneofs) object._readMask = "readMask"; } @@ -24654,17 +23864,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBucketRequest.encode = function encode(message, writer, q) { + CreateBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -24686,7 +23892,7 @@ * @returns {$protobuf.Writer} Writer */ CreateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -24776,24 +23982,24 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) { + if (message.bucket != null && message.hasOwnProperty("bucket")) { var error = $root.google.storage.v2.Bucket.verify(message.bucket, long + 1); if (error) return "bucket." + error; } - if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + if (message.bucketId != null && message.hasOwnProperty("bucketId")) if (!$util.isString(message.bucketId)) return "bucketId: string expected"; - if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) if (!$util.isString(message.predefinedAcl)) return "predefinedAcl: string expected"; - if (message.predefinedDefaultObjectAcl != null && Object.hasOwnProperty.call(message, "predefinedDefaultObjectAcl")) + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) if (!$util.isString(message.predefinedDefaultObjectAcl)) return "predefinedDefaultObjectAcl: string expected"; - if (message.enableObjectRetention != null && Object.hasOwnProperty.call(message, "enableObjectRetention")) + if (message.enableObjectRetention != null && message.hasOwnProperty("enableObjectRetention")) if (typeof message.enableObjectRetention !== "boolean") return "enableObjectRetention: boolean expected"; return null; @@ -24810,8 +24016,6 @@ CreateBucketRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.CreateBucketRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.CreateBucketRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24820,7 +24024,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.bucket != null) { - if (!$util.isObject(object.bucket)) + if (typeof object.bucket !== "object") throw TypeError(".google.storage.v2.CreateBucketRequest.bucket: object expected"); message.bucket = $root.google.storage.v2.Bucket.fromObject(object.bucket, long + 1); } @@ -24844,13 +24048,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBucketRequest.toObject = function toObject(message, options, q) { + CreateBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -24860,17 +24060,17 @@ object.predefinedDefaultObjectAcl = ""; object.enableObjectRetention = false; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - object.bucket = $root.google.storage.v2.Bucket.toObject(message.bucket, options, q + 1); - if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + 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 && Object.hasOwnProperty.call(message, "predefinedAcl")) + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) object.predefinedAcl = message.predefinedAcl; - if (message.predefinedDefaultObjectAcl != null && Object.hasOwnProperty.call(message, "predefinedDefaultObjectAcl")) + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) object.predefinedDefaultObjectAcl = message.predefinedDefaultObjectAcl; - if (message.enableObjectRetention != null && Object.hasOwnProperty.call(message, "enableObjectRetention")) + if (message.enableObjectRetention != null && message.hasOwnProperty("enableObjectRetention")) object.enableObjectRetention = message.enableObjectRetention; return object; }; @@ -25011,13 +24211,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBucketsRequest.encode = function encode(message, writer, q) { + ListBucketsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -25027,7 +24223,7 @@ 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(), q + 1).ldelim(); + $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; @@ -25043,7 +24239,7 @@ * @returns {$protobuf.Writer} Writer */ ListBucketsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -25134,19 +24330,19 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { + if (message.readMask != null && message.hasOwnProperty("readMask")) { properties._readMask = 1; { var error = $root.google.protobuf.FieldMask.verify(message.readMask, long + 1); @@ -25154,7 +24350,7 @@ return "readMask." + error; } } - if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) if (typeof message.returnPartialSuccess !== "boolean") return "returnPartialSuccess: boolean expected"; return null; @@ -25171,8 +24367,6 @@ ListBucketsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ListBucketsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ListBucketsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25187,7 +24381,7 @@ if (object.prefix != null) message.prefix = String(object.prefix); if (object.readMask != null) { - if (!$util.isObject(object.readMask)) + if (typeof object.readMask !== "object") throw TypeError(".google.storage.v2.ListBucketsRequest.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask, long + 1); } @@ -25205,13 +24399,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBucketsRequest.toObject = function toObject(message, options, q) { + ListBucketsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -25220,20 +24410,20 @@ object.prefix = ""; object.returnPartialSuccess = false; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) object.returnPartialSuccess = message.returnPartialSuccess; return object; }; @@ -25340,16 +24530,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBucketsResponse.encode = function encode(message, writer, q) { + ListBucketsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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) @@ -25368,7 +24554,7 @@ * @returns {$protobuf.Writer} Writer */ ListBucketsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -25450,7 +24636,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.buckets != null && Object.hasOwnProperty.call(message, "buckets")) { + 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) { @@ -25459,10 +24645,10 @@ return "buckets." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.unreachable != null && Object.hasOwnProperty.call(message, "unreachable")) { + 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) @@ -25483,8 +24669,6 @@ ListBucketsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ListBucketsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ListBucketsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25495,7 +24679,7 @@ throw TypeError(".google.storage.v2.ListBucketsResponse.buckets: array expected"); message.buckets = []; for (var i = 0; i < object.buckets.length; ++i) { - if (!$util.isObject(object.buckets[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], long + 1); } @@ -25521,13 +24705,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBucketsResponse.toObject = function toObject(message, options, q) { + ListBucketsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.buckets = []; @@ -25538,9 +24718,9 @@ 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, q + 1); + object.buckets[j] = $root.google.storage.v2.Bucket.toObject(message.buckets[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; if (message.unreachable && message.unreachable.length) { object.unreachable = []; @@ -25641,13 +24821,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LockBucketRetentionPolicyRequest.encode = function encode(message, writer, q) { + LockBucketRetentionPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -25665,7 +24841,7 @@ * @returns {$protobuf.Writer} Writer */ LockBucketRetentionPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -25739,10 +24915,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) + 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; @@ -25759,8 +24935,6 @@ LockBucketRetentionPolicyRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.LockBucketRetentionPolicyRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.LockBucketRetentionPolicyRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25770,7 +24944,7 @@ message.bucket = String(object.bucket); if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -25789,28 +24963,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LockBucketRetentionPolicyRequest.toObject = function toObject(message, options, q) { + LockBucketRetentionPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.ifMetagenerationMatch = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.ifMetagenerationMatch = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.ifMetagenerationMatch = options.longs === String ? "0" : 0; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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; @@ -25959,21 +25127,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBucketRequest.encode = function encode(message, writer, q) { + UpdateBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -25991,7 +25155,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -26082,28 +25246,28 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) { + if (message.bucket != null && message.hasOwnProperty("bucket")) { var error = $root.google.storage.v2.Bucket.verify(message.bucket, long + 1); if (error) return "bucket." + error; } - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "predefinedAcl")) + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) if (!$util.isString(message.predefinedAcl)) return "predefinedAcl: string expected"; - if (message.predefinedDefaultObjectAcl != null && Object.hasOwnProperty.call(message, "predefinedDefaultObjectAcl")) + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) if (!$util.isString(message.predefinedDefaultObjectAcl)) return "predefinedDefaultObjectAcl: string expected"; - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; @@ -26122,21 +25286,19 @@ UpdateBucketRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.UpdateBucketRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.UpdateBucketRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.UpdateBucketRequest(); if (object.bucket != null) { - if (!$util.isObject(object.bucket)) + if (typeof object.bucket !== "object") throw TypeError(".google.storage.v2.UpdateBucketRequest.bucket: object expected"); message.bucket = $root.google.storage.v2.Bucket.fromObject(object.bucket, long + 1); } if (object.ifMetagenerationMatch != null) if ($util.Long) - message.ifMetagenerationMatch = $util.Long.fromValue(object.ifMetagenerationMatch, false); + (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") @@ -26145,7 +25307,7 @@ 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, false); + (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") @@ -26157,7 +25319,7 @@ if (object.predefinedDefaultObjectAcl != null) message.predefinedDefaultObjectAcl = String(object.predefinedDefaultObjectAcl); if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.storage.v2.UpdateBucketRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -26173,13 +25335,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBucketRequest.toObject = function toObject(message, options, q) { + UpdateBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.bucket = null; @@ -26187,33 +25345,29 @@ object.predefinedAcl = ""; object.predefinedDefaultObjectAcl = ""; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - object.bucket = $root.google.storage.v2.Bucket.toObject(message.bucket, options, q + 1); - if (message.ifMetagenerationMatch != null && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); - if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + 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 && Object.hasOwnProperty.call(message, "predefinedDefaultObjectAcl")) + if (message.predefinedDefaultObjectAcl != null && message.hasOwnProperty("predefinedDefaultObjectAcl")) object.predefinedDefaultObjectAcl = message.predefinedDefaultObjectAcl; return object; }; @@ -26394,18 +25548,14 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ComposeObjectRequest.encode = function encode(message, writer, q) { + ComposeObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - $root.google.storage.v2.StorageObject.encode(message.destination, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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(), q + 1).ldelim(); + $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")) @@ -26413,11 +25563,11 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -26433,7 +25583,7 @@ * @returns {$protobuf.Writer} Writer */ ComposeObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -26538,12 +25688,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) { + if (message.destination != null && message.hasOwnProperty("destination")) { var error = $root.google.storage.v2.StorageObject.verify(message.destination, long + 1); if (error) return "destination." + error; } - if (message.sourceObjects != null && Object.hasOwnProperty.call(message, "sourceObjects")) { + 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) { @@ -26552,33 +25702,33 @@ return "sourceObjects." + error; } } - if (message.destinationPredefinedAcl != null && Object.hasOwnProperty.call(message, "destinationPredefinedAcl")) + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) if (!$util.isString(message.destinationPredefinedAcl)) return "destinationPredefinedAcl: string expected"; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "kmsKey")) + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) if (!$util.isString(message.kmsKey)) return "kmsKey: string expected"; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) { + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums, long + 1); if (error) return "objectChecksums." + error; } - if (message.deleteSourceObjects != null && Object.hasOwnProperty.call(message, "deleteSourceObjects")) { + if (message.deleteSourceObjects != null && message.hasOwnProperty("deleteSourceObjects")) { properties._deleteSourceObjects = 1; if (typeof message.deleteSourceObjects !== "boolean") return "deleteSourceObjects: boolean expected"; @@ -26597,15 +25747,13 @@ ComposeObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ComposeObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ComposeObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.ComposeObjectRequest(); if (object.destination != null) { - if (!$util.isObject(object.destination)) + if (typeof object.destination !== "object") throw TypeError(".google.storage.v2.ComposeObjectRequest.destination: object expected"); message.destination = $root.google.storage.v2.StorageObject.fromObject(object.destination, long + 1); } @@ -26614,7 +25762,7 @@ throw TypeError(".google.storage.v2.ComposeObjectRequest.sourceObjects: array expected"); message.sourceObjects = []; for (var i = 0; i < object.sourceObjects.length; ++i) { - if (!$util.isObject(object.sourceObjects[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], long + 1); } @@ -26623,7 +25771,7 @@ message.destinationPredefinedAcl = String(object.destinationPredefinedAcl); if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -26632,7 +25780,7 @@ 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, false); + (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") @@ -26642,12 +25790,12 @@ if (object.kmsKey != null) message.kmsKey = String(object.kmsKey); if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.ComposeObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } if (object.objectChecksums != null) { - if (!$util.isObject(object.objectChecksums)) + if (typeof object.objectChecksums !== "object") throw TypeError(".google.storage.v2.ComposeObjectRequest.objectChecksums: object expected"); message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums, long + 1); } @@ -26665,13 +25813,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ComposeObjectRequest.toObject = function toObject(message, options, q) { + ComposeObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.sourceObjects = []; @@ -26682,42 +25826,38 @@ object.destinationPredefinedAcl = ""; object.objectChecksums = null; } - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - object.destination = $root.google.storage.v2.StorageObject.toObject(message.destination, options, q + 1); + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.storage.v2.StorageObject.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, q + 1); + object.sourceObjects[j] = $root.google.storage.v2.ComposeObjectRequest.SourceObject.toObject(message.sourceObjects[j], options); } - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "kmsKey")) + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) object.kmsKey = message.kmsKey; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.destinationPredefinedAcl != null && Object.hasOwnProperty.call(message, "destinationPredefinedAcl")) + 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 && Object.hasOwnProperty.call(message, "objectChecksums")) - object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options, q + 1); - if (message.deleteSourceObjects != null && Object.hasOwnProperty.call(message, "deleteSourceObjects")) { + 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"; @@ -26822,19 +25962,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceObject.encode = function encode(message, writer, q) { + SourceObject.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.encode(message.objectPreconditions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -26848,7 +25984,7 @@ * @returns {$protobuf.Writer} Writer */ SourceObject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -26926,13 +26062,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "objectPreconditions")) { + if (message.objectPreconditions != null && message.hasOwnProperty("objectPreconditions")) { var error = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.verify(message.objectPreconditions, long + 1); if (error) return "objectPreconditions." + error; @@ -26951,8 +26087,6 @@ SourceObject.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ComposeObjectRequest.SourceObject) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ComposeObjectRequest.SourceObject: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26962,7 +26096,7 @@ message.name = String(object.name); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -26970,7 +26104,7 @@ 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 (!$util.isObject(object.objectPreconditions)) + 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, long + 1); } @@ -26986,34 +26120,28 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceObject.toObject = function toObject(message, options, q) { + SourceObject.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.generation = options.longs === String ? "0" : 0; object.objectPreconditions = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "objectPreconditions")) - object.objectPreconditions = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.toObject(message.objectPreconditions, options, q + 1); + if (message.objectPreconditions != null && message.hasOwnProperty("objectPreconditions")) + object.objectPreconditions = $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions.toObject(message.objectPreconditions, options); return object; }; @@ -27105,13 +26233,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectPreconditions.encode = function encode(message, writer, q) { + ObjectPreconditions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.ifGenerationMatch); return writer; @@ -27127,7 +26251,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectPreconditions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -27198,7 +26322,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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"; @@ -27217,8 +26341,6 @@ ObjectPreconditions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27226,7 +26348,7 @@ var message = new $root.google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions(); if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -27245,18 +26367,12 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectPreconditions.toObject = function toObject(message, options, q) { + ObjectPreconditions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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; @@ -27444,13 +26560,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteObjectRequest.encode = function encode(message, writer, q) { + DeleteObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -27466,7 +26578,7 @@ 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(), q + 1).ldelim(); + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -27480,7 +26592,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -27579,36 +26691,36 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) if (!$util.isString(message.object)) return "object: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; @@ -27627,8 +26739,6 @@ DeleteObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.DeleteObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.DeleteObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27640,7 +26750,7 @@ message.object = String(object.object); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -27649,7 +26759,7 @@ 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, false); + (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") @@ -27658,7 +26768,7 @@ 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, false); + (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") @@ -27667,7 +26777,7 @@ 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, false); + (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") @@ -27676,7 +26786,7 @@ 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, false); + (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") @@ -27684,7 +26794,7 @@ 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 (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.DeleteObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } @@ -27700,77 +26810,63 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteObjectRequest.toObject = function toObject(message, options, q) { + DeleteObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.generation = options.longs === String ? "0" : 0; object.commonObjectRequestParams = null; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) object.object = message.object; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); return object; }; @@ -27970,13 +27066,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreObjectRequest.encode = function encode(message, writer, q) { + RestoreObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -27992,7 +27084,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -28010,7 +27102,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -28117,44 +27209,44 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) if (!$util.isString(message.object)) return "object: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "restoreToken")) + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) if (!$util.isString(message.restoreToken)) return "restoreToken: string expected"; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "copySourceAcl")) { + if (message.copySourceAcl != null && message.hasOwnProperty("copySourceAcl")) { properties._copySourceAcl = 1; if (typeof message.copySourceAcl !== "boolean") return "copySourceAcl: boolean expected"; } - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; @@ -28173,8 +27265,6 @@ RestoreObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.RestoreObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.RestoreObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -28186,7 +27276,7 @@ message.object = String(object.object); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -28197,7 +27287,7 @@ message.restoreToken = String(object.restoreToken); if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -28206,7 +27296,7 @@ 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, false); + (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") @@ -28215,7 +27305,7 @@ 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, false); + (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") @@ -28224,7 +27314,7 @@ 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, false); + (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") @@ -28234,7 +27324,7 @@ if (object.copySourceAcl != null) message.copySourceAcl = Boolean(object.copySourceAcl); if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.RestoreObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } @@ -28250,84 +27340,70 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreObjectRequest.toObject = function toObject(message, options, q) { + RestoreObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.generation = options.longs === String ? "0" : 0; object.commonObjectRequestParams = null; object.restoreToken = ""; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) object.object = message.object; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.copySourceAcl != null && Object.hasOwnProperty.call(message, "copySourceAcl")) { + 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 && Object.hasOwnProperty.call(message, "restoreToken")) + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) object.restoreToken = message.restoreToken; return object; }; @@ -28414,13 +27490,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelResumableWriteRequest.encode = function encode(message, writer, q) { + CancelResumableWriteRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); return writer; @@ -28436,7 +27508,7 @@ * @returns {$protobuf.Writer} Writer */ CancelResumableWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -28506,7 +27578,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + if (message.uploadId != null && message.hasOwnProperty("uploadId")) if (!$util.isString(message.uploadId)) return "uploadId: string expected"; return null; @@ -28523,8 +27595,6 @@ CancelResumableWriteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.CancelResumableWriteRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.CancelResumableWriteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -28544,17 +27614,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CancelResumableWriteRequest.toObject = function toObject(message, options, q) { + CancelResumableWriteRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.uploadId = ""; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + if (message.uploadId != null && message.hasOwnProperty("uploadId")) object.uploadId = message.uploadId; return object; }; @@ -28632,13 +27698,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelResumableWriteResponse.encode = function encode(message, writer, q) { + CancelResumableWriteResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); return writer; }; @@ -28652,7 +27714,7 @@ * @returns {$protobuf.Writer} Writer */ CancelResumableWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -28732,6 +27794,10 @@ CancelResumableWriteResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.CancelResumableWriteResponse) return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); return new $root.google.storage.v2.CancelResumableWriteResponse(); }; @@ -28953,13 +28019,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadObjectRequest.encode = function encode(message, writer, q) { + ReadObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -28979,9 +28041,9 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -28995,7 +28057,7 @@ * @returns {$protobuf.Writer} Writer */ ReadObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -29106,47 +28168,47 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) if (!$util.isString(message.object)) return "object: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "readOffset")) + 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 && Object.hasOwnProperty.call(message, "readLimit")) + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { + if (message.readMask != null && message.hasOwnProperty("readMask")) { properties._readMask = 1; { var error = $root.google.protobuf.FieldMask.verify(message.readMask, long + 1); @@ -29168,8 +28230,6 @@ ReadObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ReadObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ReadObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -29181,7 +28241,7 @@ message.object = String(object.object); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -29190,7 +28250,7 @@ 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, false); + (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") @@ -29199,7 +28259,7 @@ 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, false); + (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") @@ -29208,7 +28268,7 @@ 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, false); + (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") @@ -29217,7 +28277,7 @@ 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, false); + (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") @@ -29226,7 +28286,7 @@ 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, false); + (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") @@ -29235,7 +28295,7 @@ 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, false); + (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") @@ -29243,12 +28303,12 @@ 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 (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.ReadObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } if (object.readMask != null) { - if (!$util.isObject(object.readMask)) + if (typeof object.readMask !== "object") throw TypeError(".google.storage.v2.ReadObjectRequest.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask, long + 1); } @@ -29264,103 +28324,85 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadObjectRequest.toObject = function toObject(message, options, q) { + ReadObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.readOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.readOffset = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.readLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.readLimit = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.readLimit = options.longs === String ? "0" : 0; object.commonObjectRequestParams = null; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) object.object = message.object; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "readOffset")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.readOffset = typeof message.readOffset === "number" ? BigInt(message.readOffset) : $util.Long.fromBits(message.readOffset.low >>> 0, message.readOffset.high >>> 0, false).toBigInt(); - else if (typeof message.readOffset === "number") + 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 && Object.hasOwnProperty.call(message, "readLimit")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.readLimit = typeof message.readLimit === "number" ? BigInt(message.readLimit) : $util.Long.fromBits(message.readLimit.low >>> 0, message.readLimit.high >>> 0, false).toBigInt(); - else if (typeof message.readLimit === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options, q + 1); + 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"; } @@ -29578,13 +28620,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetObjectRequest.encode = function encode(message, writer, q) { + GetObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -29600,9 +28638,9 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -29620,7 +28658,7 @@ * @returns {$protobuf.Writer} Writer */ GetObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -29731,46 +28769,46 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) if (!$util.isString(message.object)) return "object: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "softDeleted")) { + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) { properties._softDeleted = 1; if (typeof message.softDeleted !== "boolean") return "softDeleted: boolean expected"; } - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { + if (message.readMask != null && message.hasOwnProperty("readMask")) { properties._readMask = 1; { var error = $root.google.protobuf.FieldMask.verify(message.readMask, long + 1); @@ -29778,7 +28816,7 @@ return "readMask." + error; } } - if (message.restoreToken != null && Object.hasOwnProperty.call(message, "restoreToken")) + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) if (!$util.isString(message.restoreToken)) return "restoreToken: string expected"; return null; @@ -29795,8 +28833,6 @@ GetObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.GetObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.GetObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -29808,7 +28844,7 @@ message.object = String(object.object); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -29819,7 +28855,7 @@ message.softDeleted = Boolean(object.softDeleted); if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -29828,7 +28864,7 @@ 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, false); + (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") @@ -29837,7 +28873,7 @@ 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, false); + (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") @@ -29846,7 +28882,7 @@ 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, false); + (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") @@ -29854,12 +28890,12 @@ 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 (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.GetObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } if (object.readMask != null) { - if (!$util.isObject(object.readMask)) + if (typeof object.readMask !== "object") throw TypeError(".google.storage.v2.GetObjectRequest.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask, long + 1); } @@ -29877,89 +28913,75 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetObjectRequest.toObject = function toObject(message, options, q) { + GetObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.generation = options.longs === String ? "0" : 0; object.commonObjectRequestParams = null; object.restoreToken = ""; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) object.object = message.object; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "softDeleted")) { + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) { object.softDeleted = message.softDeleted; if (options.oneofs) object._softDeleted = "softDeleted"; } - if (message.restoreToken != null && Object.hasOwnProperty.call(message, "restoreToken")) + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) object.restoreToken = message.restoreToken; return object; }; @@ -30073,21 +29095,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadObjectResponse.encode = function encode(message, writer, q) { + ReadObjectResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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.StorageObject.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -30101,7 +29119,7 @@ * @returns {$protobuf.Writer} Writer */ ReadObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -30183,22 +29201,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) { + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData, long + 1); if (error) return "checksummedData." + error; } - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) { + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums, long + 1); if (error) return "objectChecksums." + error; } - if (message.contentRange != null && Object.hasOwnProperty.call(message, "contentRange")) { + if (message.contentRange != null && message.hasOwnProperty("contentRange")) { var error = $root.google.storage.v2.ContentRange.verify(message.contentRange, long + 1); if (error) return "contentRange." + error; } - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { + if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.storage.v2.StorageObject.verify(message.metadata, long + 1); if (error) return "metadata." + error; @@ -30217,30 +29235,28 @@ ReadObjectResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ReadObjectResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ReadObjectResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.ReadObjectResponse(); if (object.checksummedData != null) { - if (!$util.isObject(object.checksummedData)) + if (typeof object.checksummedData !== "object") throw TypeError(".google.storage.v2.ReadObjectResponse.checksummedData: object expected"); message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData, long + 1); } if (object.objectChecksums != null) { - if (!$util.isObject(object.objectChecksums)) + if (typeof object.objectChecksums !== "object") throw TypeError(".google.storage.v2.ReadObjectResponse.objectChecksums: object expected"); message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums, long + 1); } if (object.contentRange != null) { - if (!$util.isObject(object.contentRange)) + if (typeof object.contentRange !== "object") throw TypeError(".google.storage.v2.ReadObjectResponse.contentRange: object expected"); message.contentRange = $root.google.storage.v2.ContentRange.fromObject(object.contentRange, long + 1); } if (object.metadata != null) { - if (!$util.isObject(object.metadata)) + if (typeof object.metadata !== "object") throw TypeError(".google.storage.v2.ReadObjectResponse.metadata: object expected"); message.metadata = $root.google.storage.v2.StorageObject.fromObject(object.metadata, long + 1); } @@ -30256,13 +29272,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadObjectResponse.toObject = function toObject(message, options, q) { + ReadObjectResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.checksummedData = null; @@ -30270,14 +29282,14 @@ object.contentRange = null; object.metadata = null; } - if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) - object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options, q + 1); - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) - object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options, q + 1); - if (message.contentRange != null && Object.hasOwnProperty.call(message, "contentRange")) - object.contentRange = $root.google.storage.v2.ContentRange.toObject(message.contentRange, options, q + 1); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - object.metadata = $root.google.storage.v2.StorageObject.toObject(message.metadata, options, q + 1); + 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.StorageObject.toObject(message.metadata, options); return object; }; @@ -30498,13 +29510,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiReadObjectSpec.encode = function encode(message, writer, q) { + BidiReadObjectSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -30520,11 +29528,11 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -30540,7 +29548,7 @@ * @returns {$protobuf.Writer} Writer */ BidiReadObjectSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -30651,41 +29659,41 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) if (!$util.isString(message.object)) return "object: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { + if (message.readMask != null && message.hasOwnProperty("readMask")) { properties._readMask = 1; { var error = $root.google.protobuf.FieldMask.verify(message.readMask, long + 1); @@ -30693,7 +29701,7 @@ return "readMask." + error; } } - if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) { + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { properties._readHandle = 1; { var error = $root.google.storage.v2.BidiReadHandle.verify(message.readHandle, long + 1); @@ -30701,7 +29709,7 @@ return "readHandle." + error; } } - if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { properties._routingToken = 1; if (!$util.isString(message.routingToken)) return "routingToken: string expected"; @@ -30720,8 +29728,6 @@ BidiReadObjectSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiReadObjectSpec) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiReadObjectSpec: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30733,7 +29739,7 @@ message.object = String(object.object); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -30742,7 +29748,7 @@ 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, false); + (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") @@ -30751,7 +29757,7 @@ 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, false); + (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") @@ -30760,7 +29766,7 @@ 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, false); + (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") @@ -30769,7 +29775,7 @@ 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, false); + (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") @@ -30777,17 +29783,17 @@ 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 (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.BidiReadObjectSpec.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } if (object.readMask != null) { - if (!$util.isObject(object.readMask)) + if (typeof object.readMask !== "object") throw TypeError(".google.storage.v2.BidiReadObjectSpec.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask, long + 1); } if (object.readHandle != null) { - if (!$util.isObject(object.readHandle)) + if (typeof object.readHandle !== "object") throw TypeError(".google.storage.v2.BidiReadObjectSpec.readHandle: object expected"); message.readHandle = $root.google.storage.v2.BidiReadHandle.fromObject(object.readHandle, long + 1); } @@ -30805,88 +29811,74 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiReadObjectSpec.toObject = function toObject(message, options, q) { + BidiReadObjectSpec.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.generation = options.longs === String ? "0" : 0; object.commonObjectRequestParams = null; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) object.object = message.object; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "readHandle")) { - object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { object.routingToken = message.routingToken; if (options.oneofs) object._routingToken = "routingToken"; @@ -30986,18 +29978,14 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiReadObjectRequest.encode = function encode(message, writer, q) { + BidiReadObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.ReadRange.encode(message.readRanges[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -31011,7 +29999,7 @@ * @returns {$protobuf.Writer} Writer */ BidiReadObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -31087,12 +30075,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.readObjectSpec != null && Object.hasOwnProperty.call(message, "readObjectSpec")) { + if (message.readObjectSpec != null && message.hasOwnProperty("readObjectSpec")) { var error = $root.google.storage.v2.BidiReadObjectSpec.verify(message.readObjectSpec, long + 1); if (error) return "readObjectSpec." + error; } - if (message.readRanges != null && Object.hasOwnProperty.call(message, "readRanges")) { + 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) { @@ -31115,15 +30103,13 @@ BidiReadObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiReadObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiReadObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.BidiReadObjectRequest(); if (object.readObjectSpec != null) { - if (!$util.isObject(object.readObjectSpec)) + if (typeof object.readObjectSpec !== "object") throw TypeError(".google.storage.v2.BidiReadObjectRequest.readObjectSpec: object expected"); message.readObjectSpec = $root.google.storage.v2.BidiReadObjectSpec.fromObject(object.readObjectSpec, long + 1); } @@ -31132,7 +30118,7 @@ throw TypeError(".google.storage.v2.BidiReadObjectRequest.readRanges: array expected"); message.readRanges = []; for (var i = 0; i < object.readRanges.length; ++i) { - if (!$util.isObject(object.readRanges[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], long + 1); } @@ -31149,24 +30135,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiReadObjectRequest.toObject = function toObject(message, options, q) { + BidiReadObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.readRanges = []; if (options.defaults) object.readObjectSpec = null; - if (message.readObjectSpec != null && Object.hasOwnProperty.call(message, "readObjectSpec")) - object.readObjectSpec = $root.google.storage.v2.BidiReadObjectSpec.toObject(message.readObjectSpec, options, q + 1); + 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, q + 1); + object.readRanges[j] = $root.google.storage.v2.ReadRange.toObject(message.readRanges[j], options); } return object; }; @@ -31272,20 +30254,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiReadObjectResponse.encode = function encode(message, writer, q) { + BidiReadObjectResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.storage.v2.StorageObject.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.BidiReadHandle.encode(message.readHandle, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -31299,7 +30277,7 @@ * @returns {$protobuf.Writer} Writer */ BidiReadObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -31379,7 +30357,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.objectDataRanges != null && Object.hasOwnProperty.call(message, "objectDataRanges")) { + 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) { @@ -31388,12 +30366,12 @@ return "objectDataRanges." + error; } } - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { + if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.storage.v2.StorageObject.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) { + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { var error = $root.google.storage.v2.BidiReadHandle.verify(message.readHandle, long + 1); if (error) return "readHandle." + error; @@ -31412,8 +30390,6 @@ BidiReadObjectResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiReadObjectResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiReadObjectResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -31424,18 +30400,18 @@ throw TypeError(".google.storage.v2.BidiReadObjectResponse.objectDataRanges: array expected"); message.objectDataRanges = []; for (var i = 0; i < object.objectDataRanges.length; ++i) { - if (!$util.isObject(object.objectDataRanges[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], long + 1); } } if (object.metadata != null) { - if (!$util.isObject(object.metadata)) + if (typeof object.metadata !== "object") throw TypeError(".google.storage.v2.BidiReadObjectResponse.metadata: object expected"); message.metadata = $root.google.storage.v2.StorageObject.fromObject(object.metadata, long + 1); } if (object.readHandle != null) { - if (!$util.isObject(object.readHandle)) + if (typeof object.readHandle !== "object") throw TypeError(".google.storage.v2.BidiReadObjectResponse.readHandle: object expected"); message.readHandle = $root.google.storage.v2.BidiReadHandle.fromObject(object.readHandle, long + 1); } @@ -31451,13 +30427,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiReadObjectResponse.toObject = function toObject(message, options, q) { + BidiReadObjectResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.objectDataRanges = []; @@ -31465,15 +30437,15 @@ object.metadata = null; object.readHandle = null; } - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - object.metadata = $root.google.storage.v2.StorageObject.toObject(message.metadata, options, q + 1); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.storage.v2.StorageObject.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, q + 1); + object.objectDataRanges[j] = $root.google.storage.v2.ObjectRangeData.toObject(message.objectDataRanges[j], options); } - if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) - object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options, q + 1); + if (message.readHandle != null && message.hasOwnProperty("readHandle")) + object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options); return object; }; @@ -31577,15 +30549,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiReadObjectRedirectedError.encode = function encode(message, writer, q) { + BidiReadObjectRedirectedError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -31601,7 +30569,7 @@ * @returns {$protobuf.Writer} Writer */ BidiReadObjectRedirectedError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -31676,12 +30644,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) { + if (message.readHandle != null && message.hasOwnProperty("readHandle")) { var error = $root.google.storage.v2.BidiReadHandle.verify(message.readHandle, long + 1); if (error) return "readHandle." + error; } - if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { properties._routingToken = 1; if (!$util.isString(message.routingToken)) return "routingToken: string expected"; @@ -31700,15 +30668,13 @@ BidiReadObjectRedirectedError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiReadObjectRedirectedError) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiReadObjectRedirectedError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.BidiReadObjectRedirectedError(); if (object.readHandle != null) { - if (!$util.isObject(object.readHandle)) + if (typeof object.readHandle !== "object") throw TypeError(".google.storage.v2.BidiReadObjectRedirectedError.readHandle: object expected"); message.readHandle = $root.google.storage.v2.BidiReadHandle.fromObject(object.readHandle, long + 1); } @@ -31726,19 +30692,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiReadObjectRedirectedError.toObject = function toObject(message, options, q) { + BidiReadObjectRedirectedError.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.readHandle = null; - if (message.readHandle != null && Object.hasOwnProperty.call(message, "readHandle")) - object.readHandle = $root.google.storage.v2.BidiReadHandle.toObject(message.readHandle, options, q + 1); - if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) { + 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"; @@ -31867,17 +30829,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiWriteObjectRedirectedError.encode = function encode(message, writer, q) { + BidiWriteObjectRedirectedError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -31893,7 +30851,7 @@ * @returns {$protobuf.Writer} Writer */ BidiWriteObjectRedirectedError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -31972,12 +30930,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { properties._routingToken = 1; if (!$util.isString(message.routingToken)) return "routingToken: string expected"; } - if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) { + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { properties._writeHandle = 1; { var error = $root.google.storage.v2.BidiWriteHandle.verify(message.writeHandle, long + 1); @@ -31985,7 +30943,7 @@ return "writeHandle." + error; } } - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) { + 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"; @@ -32004,8 +30962,6 @@ BidiWriteObjectRedirectedError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiWriteObjectRedirectedError) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiWriteObjectRedirectedError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32014,13 +30970,13 @@ if (object.routingToken != null) message.routingToken = String(object.routingToken); if (object.writeHandle != null) { - if (!$util.isObject(object.writeHandle)) + if (typeof object.writeHandle !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectRedirectedError.writeHandle: object expected"); message.writeHandle = $root.google.storage.v2.BidiWriteHandle.fromObject(object.writeHandle, long + 1); } if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -32039,28 +30995,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiWriteObjectRedirectedError.toObject = function toObject(message, options, q) { + BidiWriteObjectRedirectedError.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.routingToken != null && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { object.routingToken = message.routingToken; if (options.oneofs) object._routingToken = "routingToken"; } - if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) { - object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "generation")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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; @@ -32153,16 +31103,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiReadObjectError.encode = function encode(message, writer, q) { + BidiReadObjectError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.storage.v2.ReadRangeError.encode(message.readRangeErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -32176,7 +31122,7 @@ * @returns {$protobuf.Writer} Writer */ BidiReadObjectError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -32248,7 +31194,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.readRangeErrors != null && Object.hasOwnProperty.call(message, "readRangeErrors")) { + 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) { @@ -32271,8 +31217,6 @@ BidiReadObjectError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiReadObjectError) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiReadObjectError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32283,7 +31227,7 @@ throw TypeError(".google.storage.v2.BidiReadObjectError.readRangeErrors: array expected"); message.readRangeErrors = []; for (var i = 0; i < object.readRangeErrors.length; ++i) { - if (!$util.isObject(object.readRangeErrors[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], long + 1); } @@ -32300,20 +31244,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiReadObjectError.toObject = function toObject(message, options, q) { + BidiReadObjectError.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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, q + 1); + object.readRangeErrors[j] = $root.google.storage.v2.ReadRangeError.toObject(message.readRangeErrors[j], options); } return object; }; @@ -32409,17 +31349,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRangeError.encode = function encode(message, writer, q) { + ReadRangeError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -32433,7 +31369,7 @@ * @returns {$protobuf.Writer} Writer */ ReadRangeError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -32507,10 +31443,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.readId != null && Object.hasOwnProperty.call(message, "readId")) + 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 && Object.hasOwnProperty.call(message, "status")) { + if (message.status != null && message.hasOwnProperty("status")) { var error = $root.google.rpc.Status.verify(message.status, long + 1); if (error) return "status." + error; @@ -32529,8 +31465,6 @@ ReadRangeError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ReadRangeError) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ReadRangeError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32538,7 +31472,7 @@ var message = new $root.google.storage.v2.ReadRangeError(); if (object.readId != null) if ($util.Long) - message.readId = $util.Long.fromValue(object.readId, false); + (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") @@ -32546,7 +31480,7 @@ 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 (!$util.isObject(object.status)) + if (typeof object.status !== "object") throw TypeError(".google.storage.v2.ReadRangeError.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -32562,31 +31496,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRangeError.toObject = function toObject(message, options, q) { + ReadRangeError.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.readId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.readId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.readId = options.longs === String ? "0" : 0; object.status = null; } - if (message.readId != null && Object.hasOwnProperty.call(message, "readId")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.readId = typeof message.readId === "number" ? BigInt(message.readId) : $util.Long.fromBits(message.readId.low >>> 0, message.readId.high >>> 0, false).toBigInt(); - else if (typeof message.readId === "number") + 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 && Object.hasOwnProperty.call(message, "status")) - object.status = $root.google.rpc.Status.toObject(message.status, options, q + 1); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); return object; }; @@ -32690,13 +31618,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRange.encode = function encode(message, writer, q) { + ReadRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -32716,7 +31640,7 @@ * @returns {$protobuf.Writer} Writer */ ReadRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -32794,13 +31718,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.readOffset != null && Object.hasOwnProperty.call(message, "readOffset")) + 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 && Object.hasOwnProperty.call(message, "readLength")) + 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 && Object.hasOwnProperty.call(message, "readId")) + 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; @@ -32817,8 +31741,6 @@ ReadRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ReadRange) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ReadRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32826,7 +31748,7 @@ var message = new $root.google.storage.v2.ReadRange(); if (object.readOffset != null) if ($util.Long) - message.readOffset = $util.Long.fromValue(object.readOffset, false); + (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") @@ -32835,7 +31757,7 @@ 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, false); + (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") @@ -32844,7 +31766,7 @@ 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, false); + (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") @@ -32863,49 +31785,39 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRange.toObject = function toObject(message, options, q) { + ReadRange.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.readOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.readOffset = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.readLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.readLength = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.readId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.readId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.readId = options.longs === String ? "0" : 0; } - if (message.readOffset != null && Object.hasOwnProperty.call(message, "readOffset")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.readOffset = typeof message.readOffset === "number" ? BigInt(message.readOffset) : $util.Long.fromBits(message.readOffset.low >>> 0, message.readOffset.high >>> 0, false).toBigInt(); - else if (typeof message.readOffset === "number") + 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 && Object.hasOwnProperty.call(message, "readLength")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.readLength = typeof message.readLength === "number" ? BigInt(message.readLength) : $util.Long.fromBits(message.readLength.low >>> 0, message.readLength.high >>> 0, false).toBigInt(); - else if (typeof message.readLength === "number") + 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 && Object.hasOwnProperty.call(message, "readId")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.readId = typeof message.readId === "number" ? BigInt(message.readId) : $util.Long.fromBits(message.readId.low >>> 0, message.readId.high >>> 0, false).toBigInt(); - else if (typeof message.readId === "number") + 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; @@ -33012,17 +31924,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectRangeData.encode = function encode(message, writer, q) { + ObjectRangeData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -33038,7 +31946,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectRangeData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -33116,17 +32024,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) { + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData, long + 1); if (error) return "checksummedData." + error; } - if (message.readRange != null && Object.hasOwnProperty.call(message, "readRange")) { + if (message.readRange != null && message.hasOwnProperty("readRange")) { var error = $root.google.storage.v2.ReadRange.verify(message.readRange, long + 1); if (error) return "readRange." + error; } - if (message.rangeEnd != null && Object.hasOwnProperty.call(message, "rangeEnd")) + if (message.rangeEnd != null && message.hasOwnProperty("rangeEnd")) if (typeof message.rangeEnd !== "boolean") return "rangeEnd: boolean expected"; return null; @@ -33143,20 +32051,18 @@ ObjectRangeData.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ObjectRangeData) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ObjectRangeData: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.ObjectRangeData(); if (object.checksummedData != null) { - if (!$util.isObject(object.checksummedData)) + if (typeof object.checksummedData !== "object") throw TypeError(".google.storage.v2.ObjectRangeData.checksummedData: object expected"); message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData, long + 1); } if (object.readRange != null) { - if (!$util.isObject(object.readRange)) + if (typeof object.readRange !== "object") throw TypeError(".google.storage.v2.ObjectRangeData.readRange: object expected"); message.readRange = $root.google.storage.v2.ReadRange.fromObject(object.readRange, long + 1); } @@ -33174,24 +32080,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectRangeData.toObject = function toObject(message, options, q) { + ObjectRangeData.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.checksummedData = null; object.readRange = null; object.rangeEnd = false; } - if (message.checksummedData != null && Object.hasOwnProperty.call(message, "checksummedData")) - object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options, q + 1); - if (message.readRange != null && Object.hasOwnProperty.call(message, "readRange")) - object.readRange = $root.google.storage.v2.ReadRange.toObject(message.readRange, options, q + 1); - if (message.rangeEnd != null && Object.hasOwnProperty.call(message, "rangeEnd")) + 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; }; @@ -33278,13 +32180,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiReadHandle.encode = function encode(message, writer, q) { + BidiReadHandle.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.handle); return writer; @@ -33300,7 +32198,7 @@ * @returns {$protobuf.Writer} Writer */ BidiReadHandle.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -33370,7 +32268,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) + 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; @@ -33387,8 +32285,6 @@ BidiReadHandle.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiReadHandle) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiReadHandle: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33411,13 +32307,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiReadHandle.toObject = function toObject(message, options, q) { + BidiReadHandle.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) if (options.bytes === String) @@ -33427,7 +32319,7 @@ if (options.bytes !== Array) object.handle = $util.newBuffer(object.handle); } - if (message.handle != null && Object.hasOwnProperty.call(message, "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; }; @@ -33514,13 +32406,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiWriteHandle.encode = function encode(message, writer, q) { + BidiWriteHandle.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.handle); return writer; @@ -33536,7 +32424,7 @@ * @returns {$protobuf.Writer} Writer */ BidiWriteHandle.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -33606,7 +32494,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) + 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; @@ -33623,8 +32511,6 @@ BidiWriteHandle.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiWriteHandle) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiWriteHandle: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33647,13 +32533,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiWriteHandle.toObject = function toObject(message, options, q) { + BidiWriteHandle.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) if (options.bytes === String) @@ -33663,7 +32545,7 @@ if (options.bytes !== Array) object.handle = $util.newBuffer(object.handle); } - if (message.handle != null && Object.hasOwnProperty.call(message, "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; }; @@ -33852,15 +32734,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteObjectSpec.encode = function encode(message, writer, q) { + WriteObjectSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.storage.v2.StorageObject.encode(message.resource, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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")) @@ -33888,7 +32766,7 @@ * @returns {$protobuf.Writer} Writer */ WriteObjectSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -33987,40 +32865,40 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) { + if (message.resource != null && message.hasOwnProperty("resource")) { var error = $root.google.storage.v2.StorageObject.verify(message.resource, long + 1); if (error) return "resource." + error; } - if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) if (!$util.isString(message.predefinedAcl)) return "predefinedAcl: string expected"; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "objectSize")) { + 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 && Object.hasOwnProperty.call(message, "appendable")) { + if (message.appendable != null && message.hasOwnProperty("appendable")) { properties._appendable = 1; if (typeof message.appendable !== "boolean") return "appendable: boolean expected"; @@ -34039,15 +32917,13 @@ WriteObjectSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.WriteObjectSpec) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.WriteObjectSpec: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.WriteObjectSpec(); if (object.resource != null) { - if (!$util.isObject(object.resource)) + if (typeof object.resource !== "object") throw TypeError(".google.storage.v2.WriteObjectSpec.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource, long + 1); } @@ -34055,7 +32931,7 @@ message.predefinedAcl = String(object.predefinedAcl); if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -34064,7 +32940,7 @@ 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, false); + (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") @@ -34073,7 +32949,7 @@ 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, false); + (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") @@ -34082,7 +32958,7 @@ 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, false); + (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") @@ -34091,7 +32967,7 @@ 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, false); + (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") @@ -34112,73 +32988,59 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteObjectSpec.toObject = function toObject(message, options, q) { + WriteObjectSpec.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resource = null; object.predefinedAcl = ""; } - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options, q + 1); - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.storage.v2.StorageObject.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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "predefinedAcl")) + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) object.predefinedAcl = message.predefinedAcl; - if (message.objectSize != null && Object.hasOwnProperty.call(message, "objectSize")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.objectSize = typeof message.objectSize === "number" ? BigInt(message.objectSize) : $util.Long.fromBits(message.objectSize.low >>> 0, message.objectSize.high >>> 0, false).toBigInt(); - else if (typeof message.objectSize === "number") + 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 && Object.hasOwnProperty.call(message, "appendable")) { + if (message.appendable != null && message.hasOwnProperty("appendable")) { object.appendable = message.appendable; if (options.oneofs) object._appendable = "appendable"; @@ -34347,27 +33209,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteObjectRequest.encode = function encode(message, writer, q) { + WriteObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -34381,7 +33239,7 @@ * @returns {$protobuf.Writer} Writer */ WriteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -34476,12 +33334,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) { + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { properties.firstMessage = 1; if (!$util.isString(message.uploadId)) return "uploadId: string expected"; } - if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) { + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { if (properties.firstMessage === 1) return "firstMessage: multiple values"; properties.firstMessage = 1; @@ -34491,10 +33349,10 @@ return "writeObjectSpec." + error; } } - if (message.writeOffset != null && Object.hasOwnProperty.call(message, "writeOffset")) + 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 && Object.hasOwnProperty.call(message, "checksummedData")) { + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { properties.data = 1; { var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData, long + 1); @@ -34502,15 +33360,15 @@ return "checksummedData." + error; } } - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) { + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums, long + 1); if (error) return "objectChecksums." + error; } - if (message.finishWrite != null && Object.hasOwnProperty.call(message, "finishWrite")) + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) if (typeof message.finishWrite !== "boolean") return "finishWrite: boolean expected"; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; @@ -34529,8 +33387,6 @@ WriteObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.WriteObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.WriteObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34539,13 +33395,13 @@ if (object.uploadId != null) message.uploadId = String(object.uploadId); if (object.writeObjectSpec != null) { - if (!$util.isObject(object.writeObjectSpec)) + if (typeof object.writeObjectSpec !== "object") throw TypeError(".google.storage.v2.WriteObjectRequest.writeObjectSpec: object expected"); message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.fromObject(object.writeObjectSpec, long + 1); } if (object.writeOffset != null) if ($util.Long) - message.writeOffset = $util.Long.fromValue(object.writeOffset, false); + (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") @@ -34553,19 +33409,19 @@ 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 (!$util.isObject(object.checksummedData)) + if (typeof object.checksummedData !== "object") throw TypeError(".google.storage.v2.WriteObjectRequest.checksummedData: object expected"); message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData, long + 1); } if (object.objectChecksums != null) { - if (!$util.isObject(object.objectChecksums)) + if (typeof object.objectChecksums !== "object") throw TypeError(".google.storage.v2.WriteObjectRequest.objectChecksums: object expected"); message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums, long + 1); } if (object.finishWrite != null) message.finishWrite = Boolean(object.finishWrite); if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.WriteObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } @@ -34581,52 +33437,46 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteObjectRequest.toObject = function toObject(message, options, q) { + WriteObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.writeOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.writeOffset = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.writeOffset = options.longs === String ? "0" : 0; object.objectChecksums = null; object.finishWrite = false; object.commonObjectRequestParams = null; } - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) { + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { object.uploadId = message.uploadId; if (options.oneofs) object.firstMessage = "uploadId"; } - if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) { - object.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.toObject(message.writeObjectSpec, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "writeOffset")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.writeOffset = typeof message.writeOffset === "number" ? BigInt(message.writeOffset) : $util.Long.fromBits(message.writeOffset.low >>> 0, message.writeOffset.high >>> 0, false).toBigInt(); - else if (typeof message.writeOffset === "number") + 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 && Object.hasOwnProperty.call(message, "checksummedData")) { - object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "objectChecksums")) - object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options, q + 1); - if (message.finishWrite != null && Object.hasOwnProperty.call(message, "finishWrite")) + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); return object; }; @@ -34744,19 +33594,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteObjectResponse.encode = function encode(message, writer, q) { + WriteObjectResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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.StorageObject.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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(), q + 1).ldelim(); + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -34770,7 +33616,7 @@ * @returns {$protobuf.Writer} Writer */ WriteObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -34849,12 +33695,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) { + 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 && Object.hasOwnProperty.call(message, "resource")) { + if (message.resource != null && message.hasOwnProperty("resource")) { if (properties.writeStatus === 1) return "writeStatus: multiple values"; properties.writeStatus = 1; @@ -34864,7 +33710,7 @@ return "resource." + error; } } - if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) { + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums, long + 1); if (error) return "persistedDataChecksums." + error; @@ -34883,8 +33729,6 @@ WriteObjectResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.WriteObjectResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.WriteObjectResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34892,7 +33736,7 @@ var message = new $root.google.storage.v2.WriteObjectResponse(); if (object.persistedSize != null) if ($util.Long) - message.persistedSize = $util.Long.fromValue(object.persistedSize, false); + (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") @@ -34900,12 +33744,12 @@ 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 (!$util.isObject(object.resource)) + if (typeof object.resource !== "object") throw TypeError(".google.storage.v2.WriteObjectResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource, long + 1); } if (object.persistedDataChecksums != null) { - if (!$util.isObject(object.persistedDataChecksums)) + if (typeof object.persistedDataChecksums !== "object") throw TypeError(".google.storage.v2.WriteObjectResponse.persistedDataChecksums: object expected"); message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums, long + 1); } @@ -34921,33 +33765,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteObjectResponse.toObject = function toObject(message, options, q) { + WriteObjectResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.persistedDataChecksums = null; - if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.persistedSize = typeof message.persistedSize === "number" ? BigInt(message.persistedSize) : $util.Long.fromBits(message.persistedSize.low >>> 0, message.persistedSize.high >>> 0, false).toBigInt(); - else if (typeof message.persistedSize === "number") + 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 && Object.hasOwnProperty.call(message, "resource")) { - object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options, q + 1); + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options); if (options.oneofs) object.writeStatus = "resource"; } - if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) - object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options, q + 1); + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); return object; }; @@ -35114,13 +33952,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppendObjectSpec.encode = function encode(message, writer, q) { + AppendObjectSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -35134,7 +33968,7 @@ 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(), q + 1).ldelim(); + $root.google.storage.v2.BidiWriteHandle.encode(message.writeHandle, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -35148,7 +33982,7 @@ * @returns {$protobuf.Writer} Writer */ AppendObjectSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -35243,31 +34077,31 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) if (!$util.isString(message.object)) return "object: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { properties._routingToken = 1; if (!$util.isString(message.routingToken)) return "routingToken: string expected"; } - if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) { + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { properties._writeHandle = 1; { var error = $root.google.storage.v2.BidiWriteHandle.verify(message.writeHandle, long + 1); @@ -35289,8 +34123,6 @@ AppendObjectSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.AppendObjectSpec) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.AppendObjectSpec: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35302,7 +34134,7 @@ message.object = String(object.object); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -35311,7 +34143,7 @@ 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, false); + (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") @@ -35320,7 +34152,7 @@ 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, false); + (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") @@ -35330,7 +34162,7 @@ if (object.routingToken != null) message.routingToken = String(object.routingToken); if (object.writeHandle != null) { - if (!$util.isObject(object.writeHandle)) + if (typeof object.writeHandle !== "object") throw TypeError(".google.storage.v2.AppendObjectSpec.writeHandle: object expected"); message.writeHandle = $root.google.storage.v2.BidiWriteHandle.fromObject(object.writeHandle, long + 1); } @@ -35346,61 +34178,51 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppendObjectSpec.toObject = function toObject(message, options, q) { + AppendObjectSpec.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.generation = options.longs === String ? "0" : 0; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) + if (message.object != null && message.hasOwnProperty("object")) object.object = message.object; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "routingToken")) { + if (message.routingToken != null && message.hasOwnProperty("routingToken")) { object.routingToken = message.routingToken; if (options.oneofs) object._routingToken = "routingToken"; } - if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) { - object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options, q + 1); + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { + object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options); if (options.oneofs) object._writeHandle = "writeHandle"; } @@ -35595,23 +34417,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiWriteObjectRequest.encode = function encode(message, writer, q) { + BidiWriteObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -35619,9 +34437,9 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.AppendObjectSpec.encode(message.appendObjectSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -35635,7 +34453,7 @@ * @returns {$protobuf.Writer} Writer */ BidiWriteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -35742,12 +34560,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) { + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { properties.firstMessage = 1; if (!$util.isString(message.uploadId)) return "uploadId: string expected"; } - if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) { + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { if (properties.firstMessage === 1) return "firstMessage: multiple values"; properties.firstMessage = 1; @@ -35757,7 +34575,7 @@ return "writeObjectSpec." + error; } } - if (message.appendObjectSpec != null && Object.hasOwnProperty.call(message, "appendObjectSpec")) { + if (message.appendObjectSpec != null && message.hasOwnProperty("appendObjectSpec")) { if (properties.firstMessage === 1) return "firstMessage: multiple values"; properties.firstMessage = 1; @@ -35767,10 +34585,10 @@ return "appendObjectSpec." + error; } } - if (message.writeOffset != null && Object.hasOwnProperty.call(message, "writeOffset")) + 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 && Object.hasOwnProperty.call(message, "checksummedData")) { + if (message.checksummedData != null && message.hasOwnProperty("checksummedData")) { properties.data = 1; { var error = $root.google.storage.v2.ChecksummedData.verify(message.checksummedData, long + 1); @@ -35778,21 +34596,21 @@ return "checksummedData." + error; } } - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) { + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums, long + 1); if (error) return "objectChecksums." + error; } - if (message.stateLookup != null && Object.hasOwnProperty.call(message, "stateLookup")) + if (message.stateLookup != null && message.hasOwnProperty("stateLookup")) if (typeof message.stateLookup !== "boolean") return "stateLookup: boolean expected"; - if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) + if (message.flush != null && message.hasOwnProperty("flush")) if (typeof message.flush !== "boolean") return "flush: boolean expected"; - if (message.finishWrite != null && Object.hasOwnProperty.call(message, "finishWrite")) + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) if (typeof message.finishWrite !== "boolean") return "finishWrite: boolean expected"; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; @@ -35811,8 +34629,6 @@ BidiWriteObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiWriteObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiWriteObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35821,18 +34637,18 @@ if (object.uploadId != null) message.uploadId = String(object.uploadId); if (object.writeObjectSpec != null) { - if (!$util.isObject(object.writeObjectSpec)) + if (typeof object.writeObjectSpec !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectRequest.writeObjectSpec: object expected"); message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.fromObject(object.writeObjectSpec, long + 1); } if (object.appendObjectSpec != null) { - if (!$util.isObject(object.appendObjectSpec)) + if (typeof object.appendObjectSpec !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectRequest.appendObjectSpec: object expected"); message.appendObjectSpec = $root.google.storage.v2.AppendObjectSpec.fromObject(object.appendObjectSpec, long + 1); } if (object.writeOffset != null) if ($util.Long) - message.writeOffset = $util.Long.fromValue(object.writeOffset, false); + (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") @@ -35840,12 +34656,12 @@ 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 (!$util.isObject(object.checksummedData)) + if (typeof object.checksummedData !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectRequest.checksummedData: object expected"); message.checksummedData = $root.google.storage.v2.ChecksummedData.fromObject(object.checksummedData, long + 1); } if (object.objectChecksums != null) { - if (!$util.isObject(object.objectChecksums)) + if (typeof object.objectChecksums !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectRequest.objectChecksums: object expected"); message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums, long + 1); } @@ -35856,7 +34672,7 @@ if (object.finishWrite != null) message.finishWrite = Boolean(object.finishWrite); if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } @@ -35872,60 +34688,54 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiWriteObjectRequest.toObject = function toObject(message, options, q) { + BidiWriteObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.writeOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.writeOffset = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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 && Object.hasOwnProperty.call(message, "uploadId")) { + if (message.uploadId != null && message.hasOwnProperty("uploadId")) { object.uploadId = message.uploadId; if (options.oneofs) object.firstMessage = "uploadId"; } - if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) { - object.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.toObject(message.writeObjectSpec, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "writeOffset")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.writeOffset = typeof message.writeOffset === "number" ? BigInt(message.writeOffset) : $util.Long.fromBits(message.writeOffset.low >>> 0, message.writeOffset.high >>> 0, false).toBigInt(); - else if (typeof message.writeOffset === "number") + 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 && Object.hasOwnProperty.call(message, "checksummedData")) { - object.checksummedData = $root.google.storage.v2.ChecksummedData.toObject(message.checksummedData, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "objectChecksums")) - object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options, q + 1); - if (message.stateLookup != null && Object.hasOwnProperty.call(message, "stateLookup")) + 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 && Object.hasOwnProperty.call(message, "flush")) + if (message.flush != null && message.hasOwnProperty("flush")) object.flush = message.flush; - if (message.finishWrite != null && Object.hasOwnProperty.call(message, "finishWrite")) + if (message.finishWrite != null && message.hasOwnProperty("finishWrite")) object.finishWrite = message.finishWrite; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.appendObjectSpec != null && Object.hasOwnProperty.call(message, "appendObjectSpec")) { - object.appendObjectSpec = $root.google.storage.v2.AppendObjectSpec.toObject(message.appendObjectSpec, options, q + 1); + 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"; } @@ -36061,21 +34871,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BidiWriteObjectResponse.encode = function encode(message, writer, q) { + BidiWriteObjectResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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.StorageObject.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -36089,7 +34895,7 @@ * @returns {$protobuf.Writer} Writer */ BidiWriteObjectResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -36172,12 +34978,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) { + 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 && Object.hasOwnProperty.call(message, "resource")) { + if (message.resource != null && message.hasOwnProperty("resource")) { if (properties.writeStatus === 1) return "writeStatus: multiple values"; properties.writeStatus = 1; @@ -36187,12 +34993,12 @@ return "resource." + error; } } - if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) { + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums, long + 1); if (error) return "persistedDataChecksums." + error; } - if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) { + if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { properties._writeHandle = 1; { var error = $root.google.storage.v2.BidiWriteHandle.verify(message.writeHandle, long + 1); @@ -36214,8 +35020,6 @@ BidiWriteObjectResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BidiWriteObjectResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BidiWriteObjectResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36223,7 +35027,7 @@ var message = new $root.google.storage.v2.BidiWriteObjectResponse(); if (object.persistedSize != null) if ($util.Long) - message.persistedSize = $util.Long.fromValue(object.persistedSize, false); + (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") @@ -36231,17 +35035,17 @@ 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 (!$util.isObject(object.resource)) + if (typeof object.resource !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource, long + 1); } if (object.persistedDataChecksums != null) { - if (!$util.isObject(object.persistedDataChecksums)) + if (typeof object.persistedDataChecksums !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectResponse.persistedDataChecksums: object expected"); message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums, long + 1); } if (object.writeHandle != null) { - if (!$util.isObject(object.writeHandle)) + if (typeof object.writeHandle !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectResponse.writeHandle: object expected"); message.writeHandle = $root.google.storage.v2.BidiWriteHandle.fromObject(object.writeHandle, long + 1); } @@ -36257,38 +35061,32 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BidiWriteObjectResponse.toObject = function toObject(message, options, q) { + BidiWriteObjectResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.persistedDataChecksums = null; - if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.persistedSize = typeof message.persistedSize === "number" ? BigInt(message.persistedSize) : $util.Long.fromBits(message.persistedSize.low >>> 0, message.persistedSize.high >>> 0, false).toBigInt(); - else if (typeof message.persistedSize === "number") + 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 && Object.hasOwnProperty.call(message, "resource")) { - object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options, q + 1); + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options); if (options.oneofs) object.writeStatus = "resource"; } - if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) { - object.writeHandle = $root.google.storage.v2.BidiWriteHandle.toObject(message.writeHandle, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "persistedDataChecksums")) - object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options, q + 1); + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); return object; }; @@ -36500,13 +35298,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListObjectsRequest.encode = function encode(message, writer, q) { + ListObjectsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -36522,7 +35316,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -36548,7 +35342,7 @@ * @returns {$protobuf.Writer} Writer */ ListObjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -36671,28 +35465,28 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + if (message.delimiter != null && message.hasOwnProperty("delimiter")) if (!$util.isString(message.delimiter)) return "delimiter: string expected"; - if (message.includeTrailingDelimiter != null && Object.hasOwnProperty.call(message, "includeTrailingDelimiter")) + if (message.includeTrailingDelimiter != null && message.hasOwnProperty("includeTrailingDelimiter")) if (typeof message.includeTrailingDelimiter !== "boolean") return "includeTrailingDelimiter: boolean expected"; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) if (!$util.isString(message.prefix)) return "prefix: string expected"; - if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + if (message.versions != null && message.hasOwnProperty("versions")) if (typeof message.versions !== "boolean") return "versions: boolean expected"; - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { + if (message.readMask != null && message.hasOwnProperty("readMask")) { properties._readMask = 1; { var error = $root.google.protobuf.FieldMask.verify(message.readMask, long + 1); @@ -36700,22 +35494,22 @@ return "readMask." + error; } } - if (message.lexicographicStart != null && Object.hasOwnProperty.call(message, "lexicographicStart")) + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) if (!$util.isString(message.lexicographicStart)) return "lexicographicStart: string expected"; - if (message.lexicographicEnd != null && Object.hasOwnProperty.call(message, "lexicographicEnd")) + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) if (!$util.isString(message.lexicographicEnd)) return "lexicographicEnd: string expected"; - if (message.softDeleted != null && Object.hasOwnProperty.call(message, "softDeleted")) + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) if (typeof message.softDeleted !== "boolean") return "softDeleted: boolean expected"; - if (message.includeFoldersAsPrefixes != null && Object.hasOwnProperty.call(message, "includeFoldersAsPrefixes")) + if (message.includeFoldersAsPrefixes != null && message.hasOwnProperty("includeFoldersAsPrefixes")) if (typeof message.includeFoldersAsPrefixes !== "boolean") return "includeFoldersAsPrefixes: boolean expected"; - if (message.matchGlob != null && Object.hasOwnProperty.call(message, "matchGlob")) + if (message.matchGlob != null && message.hasOwnProperty("matchGlob")) if (!$util.isString(message.matchGlob)) return "matchGlob: string expected"; - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; return null; @@ -36732,8 +35526,6 @@ ListObjectsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ListObjectsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ListObjectsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36754,7 +35546,7 @@ if (object.versions != null) message.versions = Boolean(object.versions); if (object.readMask != null) { - if (!$util.isObject(object.readMask)) + if (typeof object.readMask !== "object") throw TypeError(".google.storage.v2.ListObjectsRequest.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask, long + 1); } @@ -36782,13 +35574,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListObjectsRequest.toObject = function toObject(message, options, q) { + ListObjectsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -36805,36 +35593,36 @@ object.matchGlob = ""; object.filter = ""; } - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + if (message.delimiter != null && message.hasOwnProperty("delimiter")) object.delimiter = message.delimiter; - if (message.includeTrailingDelimiter != null && Object.hasOwnProperty.call(message, "includeTrailingDelimiter")) + if (message.includeTrailingDelimiter != null && message.hasOwnProperty("includeTrailingDelimiter")) object.includeTrailingDelimiter = message.includeTrailingDelimiter; - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + if (message.prefix != null && message.hasOwnProperty("prefix")) object.prefix = message.prefix; - if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + if (message.versions != null && message.hasOwnProperty("versions")) object.versions = message.versions; - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) { - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "lexicographicStart")) + if (message.lexicographicStart != null && message.hasOwnProperty("lexicographicStart")) object.lexicographicStart = message.lexicographicStart; - if (message.lexicographicEnd != null && Object.hasOwnProperty.call(message, "lexicographicEnd")) + if (message.lexicographicEnd != null && message.hasOwnProperty("lexicographicEnd")) object.lexicographicEnd = message.lexicographicEnd; - if (message.softDeleted != null && Object.hasOwnProperty.call(message, "softDeleted")) + if (message.softDeleted != null && message.hasOwnProperty("softDeleted")) object.softDeleted = message.softDeleted; - if (message.includeFoldersAsPrefixes != null && Object.hasOwnProperty.call(message, "includeFoldersAsPrefixes")) + if (message.includeFoldersAsPrefixes != null && message.hasOwnProperty("includeFoldersAsPrefixes")) object.includeFoldersAsPrefixes = message.includeFoldersAsPrefixes; - if (message.matchGlob != null && Object.hasOwnProperty.call(message, "matchGlob")) + if (message.matchGlob != null && message.hasOwnProperty("matchGlob")) object.matchGlob = message.matchGlob; - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; return object; }; @@ -36930,17 +35718,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryWriteStatusRequest.encode = function encode(message, writer, q) { + QueryWriteStatusRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.storage.v2.CommonObjectRequestParams.encode(message.commonObjectRequestParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -36954,7 +35738,7 @@ * @returns {$protobuf.Writer} Writer */ QueryWriteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -37028,10 +35812,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + if (message.uploadId != null && message.hasOwnProperty("uploadId")) if (!$util.isString(message.uploadId)) return "uploadId: string expected"; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; @@ -37050,8 +35834,6 @@ QueryWriteStatusRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.QueryWriteStatusRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.QueryWriteStatusRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37060,7 +35842,7 @@ if (object.uploadId != null) message.uploadId = String(object.uploadId); if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.QueryWriteStatusRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } @@ -37076,22 +35858,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryWriteStatusRequest.toObject = function toObject(message, options, q) { + QueryWriteStatusRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.uploadId = ""; object.commonObjectRequestParams = null; } - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + if (message.uploadId != null && message.hasOwnProperty("uploadId")) object.uploadId = message.uploadId; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) + object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options); return object; }; @@ -37209,19 +35987,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryWriteStatusResponse.encode = function encode(message, writer, q) { + QueryWriteStatusResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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.StorageObject.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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(), q + 1).ldelim(); + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -37235,7 +36009,7 @@ * @returns {$protobuf.Writer} Writer */ QueryWriteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -37314,12 +36088,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) { + 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 && Object.hasOwnProperty.call(message, "resource")) { + if (message.resource != null && message.hasOwnProperty("resource")) { if (properties.writeStatus === 1) return "writeStatus: multiple values"; properties.writeStatus = 1; @@ -37329,7 +36103,7 @@ return "resource." + error; } } - if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) { + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums, long + 1); if (error) return "persistedDataChecksums." + error; @@ -37348,8 +36122,6 @@ QueryWriteStatusResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.QueryWriteStatusResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.QueryWriteStatusResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37357,7 +36129,7 @@ var message = new $root.google.storage.v2.QueryWriteStatusResponse(); if (object.persistedSize != null) if ($util.Long) - message.persistedSize = $util.Long.fromValue(object.persistedSize, false); + (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") @@ -37365,12 +36137,12 @@ 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 (!$util.isObject(object.resource)) + if (typeof object.resource !== "object") throw TypeError(".google.storage.v2.QueryWriteStatusResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource, long + 1); } if (object.persistedDataChecksums != null) { - if (!$util.isObject(object.persistedDataChecksums)) + if (typeof object.persistedDataChecksums !== "object") throw TypeError(".google.storage.v2.QueryWriteStatusResponse.persistedDataChecksums: object expected"); message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums, long + 1); } @@ -37386,33 +36158,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryWriteStatusResponse.toObject = function toObject(message, options, q) { + QueryWriteStatusResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.persistedDataChecksums = null; - if (message.persistedSize != null && Object.hasOwnProperty.call(message, "persistedSize")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.persistedSize = typeof message.persistedSize === "number" ? BigInt(message.persistedSize) : $util.Long.fromBits(message.persistedSize.low >>> 0, message.persistedSize.high >>> 0, false).toBigInt(); - else if (typeof message.persistedSize === "number") + 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 && Object.hasOwnProperty.call(message, "resource")) { - object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options, q + 1); + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options); if (options.oneofs) object.writeStatus = "resource"; } - if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) - object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options, q + 1); + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); return object; }; @@ -37747,15 +36513,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RewriteObjectRequest.encode = function encode(message, writer, q) { + RewriteObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - $root.google.storage.v2.StorageObject.encode(message.destination, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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")) @@ -37785,7 +36547,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -37799,7 +36561,7 @@ 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(), q + 1).ldelim(); + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); return writer; }; @@ -37813,7 +36575,7 @@ * @returns {$protobuf.Writer} Writer */ RewriteObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -37972,93 +36734,93 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.destinationName != null && Object.hasOwnProperty.call(message, "destinationName")) + if (message.destinationName != null && message.hasOwnProperty("destinationName")) if (!$util.isString(message.destinationName)) return "destinationName: string expected"; - if (message.destinationBucket != null && Object.hasOwnProperty.call(message, "destinationBucket")) + if (message.destinationBucket != null && message.hasOwnProperty("destinationBucket")) if (!$util.isString(message.destinationBucket)) return "destinationBucket: string expected"; - if (message.destinationKmsKey != null && Object.hasOwnProperty.call(message, "destinationKmsKey")) + if (message.destinationKmsKey != null && message.hasOwnProperty("destinationKmsKey")) if (!$util.isString(message.destinationKmsKey)) return "destinationKmsKey: string expected"; - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) { + if (message.destination != null && message.hasOwnProperty("destination")) { var error = $root.google.storage.v2.StorageObject.verify(message.destination, long + 1); if (error) return "destination." + error; } - if (message.sourceBucket != null && Object.hasOwnProperty.call(message, "sourceBucket")) + if (message.sourceBucket != null && message.hasOwnProperty("sourceBucket")) if (!$util.isString(message.sourceBucket)) return "sourceBucket: string expected"; - if (message.sourceObject != null && Object.hasOwnProperty.call(message, "sourceObject")) + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) if (!$util.isString(message.sourceObject)) return "sourceObject: string expected"; - if (message.sourceGeneration != null && Object.hasOwnProperty.call(message, "sourceGeneration")) + 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 && Object.hasOwnProperty.call(message, "rewriteToken")) + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) if (!$util.isString(message.rewriteToken)) return "rewriteToken: string expected"; - if (message.destinationPredefinedAcl != null && Object.hasOwnProperty.call(message, "destinationPredefinedAcl")) + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) if (!$util.isString(message.destinationPredefinedAcl)) return "destinationPredefinedAcl: string expected"; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "maxBytesRewrittenPerCall")) + 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 && Object.hasOwnProperty.call(message, "copySourceEncryptionAlgorithm")) + if (message.copySourceEncryptionAlgorithm != null && message.hasOwnProperty("copySourceEncryptionAlgorithm")) if (!$util.isString(message.copySourceEncryptionAlgorithm)) return "copySourceEncryptionAlgorithm: string expected"; - if (message.copySourceEncryptionKeyBytes != null && Object.hasOwnProperty.call(message, "copySourceEncryptionKeyBytes")) + 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 && Object.hasOwnProperty.call(message, "copySourceEncryptionKeySha256Bytes")) + 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 && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) { + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums, long + 1); if (error) return "objectChecksums." + error; @@ -38077,8 +36839,6 @@ RewriteObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.RewriteObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.RewriteObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -38091,7 +36851,7 @@ if (object.destinationKmsKey != null) message.destinationKmsKey = String(object.destinationKmsKey); if (object.destination != null) { - if (!$util.isObject(object.destination)) + if (typeof object.destination !== "object") throw TypeError(".google.storage.v2.RewriteObjectRequest.destination: object expected"); message.destination = $root.google.storage.v2.StorageObject.fromObject(object.destination, long + 1); } @@ -38101,7 +36861,7 @@ message.sourceObject = String(object.sourceObject); if (object.sourceGeneration != null) if ($util.Long) - message.sourceGeneration = $util.Long.fromValue(object.sourceGeneration, false); + (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") @@ -38114,7 +36874,7 @@ message.destinationPredefinedAcl = String(object.destinationPredefinedAcl); if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -38123,7 +36883,7 @@ 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, false); + (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") @@ -38132,7 +36892,7 @@ 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, false); + (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") @@ -38141,7 +36901,7 @@ 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, false); + (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") @@ -38150,7 +36910,7 @@ 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, false); + (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") @@ -38159,7 +36919,7 @@ 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, false); + (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") @@ -38168,7 +36928,7 @@ 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, false); + (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") @@ -38177,7 +36937,7 @@ 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, false); + (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") @@ -38186,7 +36946,7 @@ 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, false); + (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") @@ -38206,12 +36966,12 @@ else if (object.copySourceEncryptionKeySha256Bytes.length >= 0) message.copySourceEncryptionKeySha256Bytes = object.copySourceEncryptionKeySha256Bytes; if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.RewriteObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } if (object.objectChecksums != null) { - if (!$util.isObject(object.objectChecksums)) + if (typeof object.objectChecksums !== "object") throw TypeError(".google.storage.v2.RewriteObjectRequest.objectChecksums: object expected"); message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums, long + 1); } @@ -38227,13 +36987,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RewriteObjectRequest.toObject = function toObject(message, options, q) { + RewriteObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.destination = null; @@ -38241,15 +36997,15 @@ 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.sourceGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.sourceGeneration = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.maxBytesRewrittenPerCall = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.maxBytesRewrittenPerCall = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.maxBytesRewrittenPerCall = options.longs === String ? "0" : 0; object.copySourceEncryptionAlgorithm = ""; object.commonObjectRequestParams = null; if (options.bytes === String) @@ -38272,126 +37028,106 @@ object.destinationPredefinedAcl = ""; object.objectChecksums = null; } - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - object.destination = $root.google.storage.v2.StorageObject.toObject(message.destination, options, q + 1); - if (message.sourceBucket != null && Object.hasOwnProperty.call(message, "sourceBucket")) + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.storage.v2.StorageObject.toObject(message.destination, options); + if (message.sourceBucket != null && message.hasOwnProperty("sourceBucket")) object.sourceBucket = message.sourceBucket; - if (message.sourceObject != null && Object.hasOwnProperty.call(message, "sourceObject")) + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) object.sourceObject = message.sourceObject; - if (message.sourceGeneration != null && Object.hasOwnProperty.call(message, "sourceGeneration")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.sourceGeneration = typeof message.sourceGeneration === "number" ? BigInt(message.sourceGeneration) : $util.Long.fromBits(message.sourceGeneration.low >>> 0, message.sourceGeneration.high >>> 0, false).toBigInt(); - else if (typeof message.sourceGeneration === "number") + 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 && Object.hasOwnProperty.call(message, "rewriteToken")) + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) object.rewriteToken = message.rewriteToken; - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceGenerationMatch = typeof message.ifSourceGenerationMatch === "number" ? BigInt(message.ifSourceGenerationMatch) : $util.Long.fromBits(message.ifSourceGenerationMatch.low >>> 0, message.ifSourceGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceGenerationNotMatch = typeof message.ifSourceGenerationNotMatch === "number" ? BigInt(message.ifSourceGenerationNotMatch) : $util.Long.fromBits(message.ifSourceGenerationNotMatch.low >>> 0, message.ifSourceGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceMetagenerationMatch = typeof message.ifSourceMetagenerationMatch === "number" ? BigInt(message.ifSourceMetagenerationMatch) : $util.Long.fromBits(message.ifSourceMetagenerationMatch.low >>> 0, message.ifSourceMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceMetagenerationNotMatch = typeof message.ifSourceMetagenerationNotMatch === "number" ? BigInt(message.ifSourceMetagenerationNotMatch) : $util.Long.fromBits(message.ifSourceMetagenerationNotMatch.low >>> 0, message.ifSourceMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "maxBytesRewrittenPerCall")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.maxBytesRewrittenPerCall = typeof message.maxBytesRewrittenPerCall === "number" ? BigInt(message.maxBytesRewrittenPerCall) : $util.Long.fromBits(message.maxBytesRewrittenPerCall.low >>> 0, message.maxBytesRewrittenPerCall.high >>> 0, false).toBigInt(); - else if (typeof message.maxBytesRewrittenPerCall === "number") + 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 && Object.hasOwnProperty.call(message, "copySourceEncryptionAlgorithm")) + if (message.copySourceEncryptionAlgorithm != null && message.hasOwnProperty("copySourceEncryptionAlgorithm")) object.copySourceEncryptionAlgorithm = message.copySourceEncryptionAlgorithm; - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.copySourceEncryptionKeyBytes != null && Object.hasOwnProperty.call(message, "copySourceEncryptionKeyBytes")) + 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 && Object.hasOwnProperty.call(message, "copySourceEncryptionKeySha256Bytes")) + 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 && Object.hasOwnProperty.call(message, "destinationName")) + if (message.destinationName != null && message.hasOwnProperty("destinationName")) object.destinationName = message.destinationName; - if (message.destinationBucket != null && Object.hasOwnProperty.call(message, "destinationBucket")) + if (message.destinationBucket != null && message.hasOwnProperty("destinationBucket")) object.destinationBucket = message.destinationBucket; - if (message.destinationKmsKey != null && Object.hasOwnProperty.call(message, "destinationKmsKey")) + if (message.destinationKmsKey != null && message.hasOwnProperty("destinationKmsKey")) object.destinationKmsKey = message.destinationKmsKey; - if (message.destinationPredefinedAcl != null && Object.hasOwnProperty.call(message, "destinationPredefinedAcl")) + if (message.destinationPredefinedAcl != null && message.hasOwnProperty("destinationPredefinedAcl")) object.destinationPredefinedAcl = message.destinationPredefinedAcl; - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) - object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options, q + 1); + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) + object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options); return object; }; @@ -38513,13 +37249,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RewriteResponse.encode = function encode(message, writer, q) { + RewriteResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -38529,7 +37261,7 @@ 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.StorageObject.encode(message.resource, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.encode(message.resource, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -38543,7 +37275,7 @@ * @returns {$protobuf.Writer} Writer */ RewriteResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -38629,19 +37361,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.totalBytesRewritten != null && Object.hasOwnProperty.call(message, "totalBytesRewritten")) + 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 && Object.hasOwnProperty.call(message, "objectSize")) + 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 && Object.hasOwnProperty.call(message, "done")) + if (message.done != null && message.hasOwnProperty("done")) if (typeof message.done !== "boolean") return "done: boolean expected"; - if (message.rewriteToken != null && Object.hasOwnProperty.call(message, "rewriteToken")) + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) if (!$util.isString(message.rewriteToken)) return "rewriteToken: string expected"; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) { + if (message.resource != null && message.hasOwnProperty("resource")) { var error = $root.google.storage.v2.StorageObject.verify(message.resource, long + 1); if (error) return "resource." + error; @@ -38660,8 +37392,6 @@ RewriteResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.RewriteResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.RewriteResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -38669,7 +37399,7 @@ var message = new $root.google.storage.v2.RewriteResponse(); if (object.totalBytesRewritten != null) if ($util.Long) - message.totalBytesRewritten = $util.Long.fromValue(object.totalBytesRewritten, false); + (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") @@ -38678,7 +37408,7 @@ 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, false); + (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") @@ -38690,7 +37420,7 @@ if (object.rewriteToken != null) message.rewriteToken = String(object.rewriteToken); if (object.resource != null) { - if (!$util.isObject(object.resource)) + if (typeof object.resource !== "object") throw TypeError(".google.storage.v2.RewriteResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource, long + 1); } @@ -38706,49 +37436,41 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RewriteResponse.toObject = function toObject(message, options, q) { + RewriteResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.totalBytesRewritten = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.totalBytesRewritten = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.objectSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.objectSize = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.objectSize = options.longs === String ? "0" : 0; object.done = false; object.rewriteToken = ""; object.resource = null; } - if (message.totalBytesRewritten != null && Object.hasOwnProperty.call(message, "totalBytesRewritten")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.totalBytesRewritten = typeof message.totalBytesRewritten === "number" ? BigInt(message.totalBytesRewritten) : $util.Long.fromBits(message.totalBytesRewritten.low >>> 0, message.totalBytesRewritten.high >>> 0, false).toBigInt(); - else if (typeof message.totalBytesRewritten === "number") + 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 && Object.hasOwnProperty.call(message, "objectSize")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.objectSize = typeof message.objectSize === "number" ? BigInt(message.objectSize) : $util.Long.fromBits(message.objectSize.low >>> 0, message.objectSize.high >>> 0, false).toBigInt(); - else if (typeof message.objectSize === "number") + 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 && Object.hasOwnProperty.call(message, "done")) + if (message.done != null && message.hasOwnProperty("done")) object.done = message.done; - if (message.rewriteToken != null && Object.hasOwnProperty.call(message, "rewriteToken")) + if (message.rewriteToken != null && message.hasOwnProperty("rewriteToken")) object.rewriteToken = message.rewriteToken; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options, q + 1); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.storage.v2.StorageObject.toObject(message.resource, options); return object; }; @@ -38975,13 +37697,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveObjectRequest.encode = function encode(message, writer, q) { + MoveObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -39017,7 +37735,7 @@ * @returns {$protobuf.Writer} Writer */ MoveObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -39128,51 +37846,51 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.sourceObject != null && Object.hasOwnProperty.call(message, "sourceObject")) + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) if (!$util.isString(message.sourceObject)) return "sourceObject: string expected"; - if (message.destinationObject != null && Object.hasOwnProperty.call(message, "destinationObject")) + if (message.destinationObject != null && message.hasOwnProperty("destinationObject")) if (!$util.isString(message.destinationObject)) return "destinationObject: string expected"; - if (message.ifSourceGenerationMatch != null && Object.hasOwnProperty.call(message, "ifSourceGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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"; @@ -39191,8 +37909,6 @@ MoveObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.MoveObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.MoveObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39206,7 +37922,7 @@ message.destinationObject = String(object.destinationObject); if (object.ifSourceGenerationMatch != null) if ($util.Long) - message.ifSourceGenerationMatch = $util.Long.fromValue(object.ifSourceGenerationMatch, false); + (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") @@ -39215,7 +37931,7 @@ 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, false); + (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") @@ -39224,7 +37940,7 @@ 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, false); + (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") @@ -39233,7 +37949,7 @@ 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, false); + (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") @@ -39242,7 +37958,7 @@ 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, false); + (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") @@ -39251,7 +37967,7 @@ 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, false); + (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") @@ -39260,7 +37976,7 @@ 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, false); + (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") @@ -39269,7 +37985,7 @@ 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, false); + (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") @@ -39288,99 +38004,79 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveObjectRequest.toObject = function toObject(message, options, q) { + MoveObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.bucket = ""; object.sourceObject = ""; object.destinationObject = ""; } - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.sourceObject != null && Object.hasOwnProperty.call(message, "sourceObject")) + if (message.sourceObject != null && message.hasOwnProperty("sourceObject")) object.sourceObject = message.sourceObject; - if (message.destinationObject != null && Object.hasOwnProperty.call(message, "destinationObject")) + if (message.destinationObject != null && message.hasOwnProperty("destinationObject")) object.destinationObject = message.destinationObject; - if (message.ifSourceGenerationMatch != null && Object.hasOwnProperty.call(message, "ifSourceGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceGenerationMatch = typeof message.ifSourceGenerationMatch === "number" ? BigInt(message.ifSourceGenerationMatch) : $util.Long.fromBits(message.ifSourceGenerationMatch.low >>> 0, message.ifSourceGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceGenerationNotMatch = typeof message.ifSourceGenerationNotMatch === "number" ? BigInt(message.ifSourceGenerationNotMatch) : $util.Long.fromBits(message.ifSourceGenerationNotMatch.low >>> 0, message.ifSourceGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceMetagenerationMatch = typeof message.ifSourceMetagenerationMatch === "number" ? BigInt(message.ifSourceMetagenerationMatch) : $util.Long.fromBits(message.ifSourceMetagenerationMatch.low >>> 0, message.ifSourceMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifSourceMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifSourceMetagenerationNotMatch = typeof message.ifSourceMetagenerationNotMatch === "number" ? BigInt(message.ifSourceMetagenerationNotMatch) : $util.Long.fromBits(message.ifSourceMetagenerationNotMatch.low >>> 0, message.ifSourceMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifSourceMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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; @@ -39490,19 +38186,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartResumableWriteRequest.encode = function encode(message, writer, q) { + StartResumableWriteRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.ObjectChecksums.encode(message.objectChecksums, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -39516,7 +38208,7 @@ * @returns {$protobuf.Writer} Writer */ StartResumableWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -39594,17 +38286,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) { + if (message.writeObjectSpec != null && message.hasOwnProperty("writeObjectSpec")) { var error = $root.google.storage.v2.WriteObjectSpec.verify(message.writeObjectSpec, long + 1); if (error) return "writeObjectSpec." + error; } - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) { + if (message.objectChecksums != null && message.hasOwnProperty("objectChecksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.objectChecksums, long + 1); if (error) return "objectChecksums." + error; @@ -39623,25 +38315,23 @@ StartResumableWriteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.StartResumableWriteRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.StartResumableWriteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.StartResumableWriteRequest(); if (object.writeObjectSpec != null) { - if (!$util.isObject(object.writeObjectSpec)) + if (typeof object.writeObjectSpec !== "object") throw TypeError(".google.storage.v2.StartResumableWriteRequest.writeObjectSpec: object expected"); message.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.fromObject(object.writeObjectSpec, long + 1); } if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.StartResumableWriteRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } if (object.objectChecksums != null) { - if (!$util.isObject(object.objectChecksums)) + if (typeof object.objectChecksums !== "object") throw TypeError(".google.storage.v2.StartResumableWriteRequest.objectChecksums: object expected"); message.objectChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.objectChecksums, long + 1); } @@ -39657,25 +38347,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StartResumableWriteRequest.toObject = function toObject(message, options, q) { + StartResumableWriteRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.writeObjectSpec = null; object.commonObjectRequestParams = null; object.objectChecksums = null; } - if (message.writeObjectSpec != null && Object.hasOwnProperty.call(message, "writeObjectSpec")) - object.writeObjectSpec = $root.google.storage.v2.WriteObjectSpec.toObject(message.writeObjectSpec, options, q + 1); - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.objectChecksums != null && Object.hasOwnProperty.call(message, "objectChecksums")) - object.objectChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.objectChecksums, options, q + 1); + 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; }; @@ -39761,13 +38447,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartResumableWriteResponse.encode = function encode(message, writer, q) { + StartResumableWriteResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uploadId); return writer; @@ -39783,7 +38465,7 @@ * @returns {$protobuf.Writer} Writer */ StartResumableWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -39853,7 +38535,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + if (message.uploadId != null && message.hasOwnProperty("uploadId")) if (!$util.isString(message.uploadId)) return "uploadId: string expected"; return null; @@ -39870,8 +38552,6 @@ StartResumableWriteResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.StartResumableWriteResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.StartResumableWriteResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39891,17 +38571,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StartResumableWriteResponse.toObject = function toObject(message, options, q) { + StartResumableWriteResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.uploadId = ""; - if (message.uploadId != null && Object.hasOwnProperty.call(message, "uploadId")) + if (message.uploadId != null && message.hasOwnProperty("uploadId")) object.uploadId = message.uploadId; return object; }; @@ -40087,15 +38763,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateObjectRequest.encode = function encode(message, writer, q) { + UpdateObjectRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.object != null && Object.hasOwnProperty.call(message, "object")) - $root.google.storage.v2.StorageObject.encode(message.object, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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")) @@ -40105,9 +38777,9 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -40125,7 +38797,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateObjectRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -40228,45 +38900,45 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.object != null && Object.hasOwnProperty.call(message, "object")) { + if (message.object != null && message.hasOwnProperty("object")) { var error = $root.google.storage.v2.StorageObject.verify(message.object, long + 1); if (error) return "object." + error; } - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { + 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 && Object.hasOwnProperty.call(message, "predefinedAcl")) + if (message.predefinedAcl != null && message.hasOwnProperty("predefinedAcl")) if (!$util.isString(message.predefinedAcl)) return "predefinedAcl: string expected"; - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; } - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) { + if (message.commonObjectRequestParams != null && message.hasOwnProperty("commonObjectRequestParams")) { var error = $root.google.storage.v2.CommonObjectRequestParams.verify(message.commonObjectRequestParams, long + 1); if (error) return "commonObjectRequestParams." + error; } - if (message.overrideUnlockedRetention != null && Object.hasOwnProperty.call(message, "overrideUnlockedRetention")) + if (message.overrideUnlockedRetention != null && message.hasOwnProperty("overrideUnlockedRetention")) if (typeof message.overrideUnlockedRetention !== "boolean") return "overrideUnlockedRetention: boolean expected"; return null; @@ -40283,21 +38955,19 @@ UpdateObjectRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.UpdateObjectRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.UpdateObjectRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.UpdateObjectRequest(); if (object.object != null) { - if (!$util.isObject(object.object)) + if (typeof object.object !== "object") throw TypeError(".google.storage.v2.UpdateObjectRequest.object: object expected"); message.object = $root.google.storage.v2.StorageObject.fromObject(object.object, long + 1); } if (object.ifGenerationMatch != null) if ($util.Long) - message.ifGenerationMatch = $util.Long.fromValue(object.ifGenerationMatch, false); + (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") @@ -40306,7 +38976,7 @@ 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, false); + (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") @@ -40315,7 +38985,7 @@ 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, false); + (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") @@ -40324,7 +38994,7 @@ 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, false); + (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") @@ -40334,12 +39004,12 @@ if (object.predefinedAcl != null) message.predefinedAcl = String(object.predefinedAcl); if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.storage.v2.UpdateObjectRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } if (object.commonObjectRequestParams != null) { - if (!$util.isObject(object.commonObjectRequestParams)) + if (typeof object.commonObjectRequestParams !== "object") throw TypeError(".google.storage.v2.UpdateObjectRequest.commonObjectRequestParams: object expected"); message.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.fromObject(object.commonObjectRequestParams, long + 1); } @@ -40357,13 +39027,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateObjectRequest.toObject = function toObject(message, options, q) { + UpdateObjectRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.object = null; @@ -40372,55 +39038,47 @@ object.predefinedAcl = ""; object.overrideUnlockedRetention = false; } - if (message.object != null && Object.hasOwnProperty.call(message, "object")) - object.object = $root.google.storage.v2.StorageObject.toObject(message.object, options, q + 1); - if (message.ifGenerationMatch != null && Object.hasOwnProperty.call(message, "ifGenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationMatch = typeof message.ifGenerationMatch === "number" ? BigInt(message.ifGenerationMatch) : $util.Long.fromBits(message.ifGenerationMatch.low >>> 0, message.ifGenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationMatch === "number") + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.google.storage.v2.StorageObject.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 && Object.hasOwnProperty.call(message, "ifGenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifGenerationNotMatch = typeof message.ifGenerationNotMatch === "number" ? BigInt(message.ifGenerationNotMatch) : $util.Long.fromBits(message.ifGenerationNotMatch.low >>> 0, message.ifGenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifGenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationMatch = typeof message.ifMetagenerationMatch === "number" ? BigInt(message.ifMetagenerationMatch) : $util.Long.fromBits(message.ifMetagenerationMatch.low >>> 0, message.ifMetagenerationMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationMatch === "number") + 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 && Object.hasOwnProperty.call(message, "ifMetagenerationNotMatch")) { - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.ifMetagenerationNotMatch = typeof message.ifMetagenerationNotMatch === "number" ? BigInt(message.ifMetagenerationNotMatch) : $util.Long.fromBits(message.ifMetagenerationNotMatch.low >>> 0, message.ifMetagenerationNotMatch.high >>> 0, false).toBigInt(); - else if (typeof message.ifMetagenerationNotMatch === "number") + 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 && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); - if (message.commonObjectRequestParams != null && Object.hasOwnProperty.call(message, "commonObjectRequestParams")) - object.commonObjectRequestParams = $root.google.storage.v2.CommonObjectRequestParams.toObject(message.commonObjectRequestParams, options, q + 1); - if (message.predefinedAcl != null && Object.hasOwnProperty.call(message, "predefinedAcl")) + 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 && Object.hasOwnProperty.call(message, "overrideUnlockedRetention")) + if (message.overrideUnlockedRetention != null && message.hasOwnProperty("overrideUnlockedRetention")) object.overrideUnlockedRetention = message.overrideUnlockedRetention; return object; }; @@ -40525,13 +39183,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommonObjectRequestParams.encode = function encode(message, writer, q) { + CommonObjectRequestParams.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -40551,7 +39205,7 @@ * @returns {$protobuf.Writer} Writer */ CommonObjectRequestParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -40629,13 +39283,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionAlgorithm != null && Object.hasOwnProperty.call(message, "encryptionAlgorithm")) + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) if (!$util.isString(message.encryptionAlgorithm)) return "encryptionAlgorithm: string expected"; - if (message.encryptionKeyBytes != null && Object.hasOwnProperty.call(message, "encryptionKeyBytes")) + 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 && Object.hasOwnProperty.call(message, "encryptionKeySha256Bytes")) + 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; @@ -40652,8 +39306,6 @@ CommonObjectRequestParams.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.CommonObjectRequestParams) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.CommonObjectRequestParams: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -40683,13 +39335,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommonObjectRequestParams.toObject = function toObject(message, options, q) { + CommonObjectRequestParams.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.encryptionAlgorithm = ""; @@ -40708,11 +39356,11 @@ object.encryptionKeySha256Bytes = $util.newBuffer(object.encryptionKeySha256Bytes); } } - if (message.encryptionAlgorithm != null && Object.hasOwnProperty.call(message, "encryptionAlgorithm")) + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) object.encryptionAlgorithm = message.encryptionAlgorithm; - if (message.encryptionKeyBytes != null && Object.hasOwnProperty.call(message, "encryptionKeyBytes")) + 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 && Object.hasOwnProperty.call(message, "encryptionKeySha256Bytes")) + 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; }; @@ -40790,13 +39438,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceConstants.encode = function encode(message, writer, q) { + ServiceConstants.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); return writer; }; @@ -40810,7 +39454,7 @@ * @returns {$protobuf.Writer} Writer */ ServiceConstants.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -40890,6 +39534,10 @@ ServiceConstants.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ServiceConstants) return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); return new $root.google.storage.v2.ServiceConstants(); }; @@ -41326,13 +39974,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Bucket.encode = function encode(message, writer, q) { + Bucket.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -41349,58 +39993,58 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.Bucket.IpFilter.encode(message.ipFilter, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); return writer; }; @@ -41414,7 +40058,7 @@ * @returns {$protobuf.Writer} Writer */ Bucket.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -41636,34 +40280,34 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + if (message.bucketId != null && message.hasOwnProperty("bucketId")) if (!$util.isString(message.bucketId)) return "bucketId: string expected"; - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; - if (message.project != null && Object.hasOwnProperty.call(message, "project")) + if (message.project != null && message.hasOwnProperty("project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + 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 && Object.hasOwnProperty.call(message, "location")) + if (message.location != null && message.hasOwnProperty("location")) if (!$util.isString(message.location)) return "location: string expected"; - if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + if (message.locationType != null && message.hasOwnProperty("locationType")) if (!$util.isString(message.locationType)) return "locationType: string expected"; - if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + if (message.storageClass != null && message.hasOwnProperty("storageClass")) if (!$util.isString(message.storageClass)) return "storageClass: string expected"; - if (message.rpo != null && Object.hasOwnProperty.call(message, "rpo")) + if (message.rpo != null && message.hasOwnProperty("rpo")) if (!$util.isString(message.rpo)) return "rpo: string expected"; - if (message.acl != null && Object.hasOwnProperty.call(message, "acl")) { + 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) { @@ -41672,7 +40316,7 @@ return "acl." + error; } } - if (message.defaultObjectAcl != null && Object.hasOwnProperty.call(message, "defaultObjectAcl")) { + 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) { @@ -41681,17 +40325,17 @@ return "defaultObjectAcl." + error; } } - if (message.lifecycle != null && Object.hasOwnProperty.call(message, "lifecycle")) { + if (message.lifecycle != null && message.hasOwnProperty("lifecycle")) { var error = $root.google.storage.v2.Bucket.Lifecycle.verify(message.lifecycle, long + 1); if (error) return "lifecycle." + error; } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.cors != null && Object.hasOwnProperty.call(message, "cors")) { + 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) { @@ -41700,15 +40344,15 @@ return "cors." + error; } } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.defaultEventBasedHold != null && Object.hasOwnProperty.call(message, "defaultEventBasedHold")) + if (message.defaultEventBasedHold != null && message.hasOwnProperty("defaultEventBasedHold")) if (typeof message.defaultEventBasedHold !== "boolean") return "defaultEventBasedHold: boolean expected"; - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -41716,75 +40360,75 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.website != null && Object.hasOwnProperty.call(message, "website")) { + if (message.website != null && message.hasOwnProperty("website")) { var error = $root.google.storage.v2.Bucket.Website.verify(message.website, long + 1); if (error) return "website." + error; } - if (message.versioning != null && Object.hasOwnProperty.call(message, "versioning")) { + if (message.versioning != null && message.hasOwnProperty("versioning")) { var error = $root.google.storage.v2.Bucket.Versioning.verify(message.versioning, long + 1); if (error) return "versioning." + error; } - if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) { + if (message.logging != null && message.hasOwnProperty("logging")) { var error = $root.google.storage.v2.Bucket.Logging.verify(message.logging, long + 1); if (error) return "logging." + error; } - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) { + if (message.owner != null && message.hasOwnProperty("owner")) { var error = $root.google.storage.v2.Owner.verify(message.owner, long + 1); if (error) return "owner." + error; } - if (message.encryption != null && Object.hasOwnProperty.call(message, "encryption")) { + if (message.encryption != null && message.hasOwnProperty("encryption")) { var error = $root.google.storage.v2.Bucket.Encryption.verify(message.encryption, long + 1); if (error) return "encryption." + error; } - if (message.billing != null && Object.hasOwnProperty.call(message, "billing")) { + if (message.billing != null && message.hasOwnProperty("billing")) { var error = $root.google.storage.v2.Bucket.Billing.verify(message.billing, long + 1); if (error) return "billing." + error; } - if (message.retentionPolicy != null && Object.hasOwnProperty.call(message, "retentionPolicy")) { + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) { var error = $root.google.storage.v2.Bucket.RetentionPolicy.verify(message.retentionPolicy, long + 1); if (error) return "retentionPolicy." + error; } - if (message.iamConfig != null && Object.hasOwnProperty.call(message, "iamConfig")) { + if (message.iamConfig != null && message.hasOwnProperty("iamConfig")) { var error = $root.google.storage.v2.Bucket.IamConfig.verify(message.iamConfig, long + 1); if (error) return "iamConfig." + error; } - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) if (typeof message.satisfiesPzs !== "boolean") return "satisfiesPzs: boolean expected"; - if (message.customPlacementConfig != null && Object.hasOwnProperty.call(message, "customPlacementConfig")) { + if (message.customPlacementConfig != null && message.hasOwnProperty("customPlacementConfig")) { var error = $root.google.storage.v2.Bucket.CustomPlacementConfig.verify(message.customPlacementConfig, long + 1); if (error) return "customPlacementConfig." + error; } - if (message.autoclass != null && Object.hasOwnProperty.call(message, "autoclass")) { + if (message.autoclass != null && message.hasOwnProperty("autoclass")) { var error = $root.google.storage.v2.Bucket.Autoclass.verify(message.autoclass, long + 1); if (error) return "autoclass." + error; } - if (message.hierarchicalNamespace != null && Object.hasOwnProperty.call(message, "hierarchicalNamespace")) { + if (message.hierarchicalNamespace != null && message.hasOwnProperty("hierarchicalNamespace")) { var error = $root.google.storage.v2.Bucket.HierarchicalNamespace.verify(message.hierarchicalNamespace, long + 1); if (error) return "hierarchicalNamespace." + error; } - if (message.softDeletePolicy != null && Object.hasOwnProperty.call(message, "softDeletePolicy")) { + if (message.softDeletePolicy != null && message.hasOwnProperty("softDeletePolicy")) { var error = $root.google.storage.v2.Bucket.SoftDeletePolicy.verify(message.softDeletePolicy, long + 1); if (error) return "softDeletePolicy." + error; } - if (message.objectRetention != null && Object.hasOwnProperty.call(message, "objectRetention")) { + if (message.objectRetention != null && message.hasOwnProperty("objectRetention")) { var error = $root.google.storage.v2.Bucket.ObjectRetention.verify(message.objectRetention, long + 1); if (error) return "objectRetention." + error; } - if (message.ipFilter != null && Object.hasOwnProperty.call(message, "ipFilter")) { + if (message.ipFilter != null && message.hasOwnProperty("ipFilter")) { properties._ipFilter = 1; { var error = $root.google.storage.v2.Bucket.IpFilter.verify(message.ipFilter, long + 1); @@ -41806,8 +40450,6 @@ Bucket.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -41823,7 +40465,7 @@ message.project = String(object.project); if (object.metageneration != null) if ($util.Long) - message.metageneration = $util.Long.fromValue(object.metageneration, false); + (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") @@ -41843,7 +40485,7 @@ throw TypeError(".google.storage.v2.Bucket.acl: array expected"); message.acl = []; for (var i = 0; i < object.acl.length; ++i) { - if (!$util.isObject(object.acl[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], long + 1); } @@ -41853,18 +40495,18 @@ throw TypeError(".google.storage.v2.Bucket.defaultObjectAcl: array expected"); message.defaultObjectAcl = []; for (var i = 0; i < object.defaultObjectAcl.length; ++i) { - if (!$util.isObject(object.defaultObjectAcl[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], long + 1); } } if (object.lifecycle != null) { - if (!$util.isObject(object.lifecycle)) + 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, long + 1); } if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.v2.Bucket.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } @@ -41873,20 +40515,20 @@ throw TypeError(".google.storage.v2.Bucket.cors: array expected"); message.cors = []; for (var i = 0; i < object.cors.length; ++i) { - if (!$util.isObject(object.cors[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], long + 1); } } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.v2.Bucket.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } if (object.defaultEventBasedHold != null) message.defaultEventBasedHold = Boolean(object.defaultEventBasedHold); if (object.labels) { - if (!$util.isObject(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) { @@ -41896,74 +40538,74 @@ } } if (object.website != null) { - if (!$util.isObject(object.website)) + 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, long + 1); } if (object.versioning != null) { - if (!$util.isObject(object.versioning)) + 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, long + 1); } if (object.logging != null) { - if (!$util.isObject(object.logging)) + 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, long + 1); } if (object.owner != null) { - if (!$util.isObject(object.owner)) + if (typeof object.owner !== "object") throw TypeError(".google.storage.v2.Bucket.owner: object expected"); message.owner = $root.google.storage.v2.Owner.fromObject(object.owner, long + 1); } if (object.encryption != null) { - if (!$util.isObject(object.encryption)) + 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, long + 1); } if (object.billing != null) { - if (!$util.isObject(object.billing)) + 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, long + 1); } if (object.retentionPolicy != null) { - if (!$util.isObject(object.retentionPolicy)) + 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, long + 1); } if (object.iamConfig != null) { - if (!$util.isObject(object.iamConfig)) + 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, long + 1); } if (object.satisfiesPzs != null) message.satisfiesPzs = Boolean(object.satisfiesPzs); if (object.customPlacementConfig != null) { - if (!$util.isObject(object.customPlacementConfig)) + 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, long + 1); } if (object.autoclass != null) { - if (!$util.isObject(object.autoclass)) + 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, long + 1); } if (object.hierarchicalNamespace != null) { - if (!$util.isObject(object.hierarchicalNamespace)) + 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, long + 1); } if (object.softDeletePolicy != null) { - if (!$util.isObject(object.softDeletePolicy)) + 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, long + 1); } if (object.objectRetention != null) { - if (!$util.isObject(object.objectRetention)) + 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, long + 1); } if (object.ipFilter != null) { - if (!$util.isObject(object.ipFilter)) + 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, long + 1); } @@ -41979,13 +40621,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Bucket.toObject = function toObject(message, options, q) { + Bucket.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.acl = []; @@ -42000,9 +40638,9 @@ 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.metageneration = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.metageneration = options.longs === String ? "0" : 0; object.location = ""; object.locationType = ""; object.storageClass = ""; @@ -42027,47 +40665,45 @@ object.hierarchicalNamespace = null; object.objectRetention = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + if (message.bucketId != null && message.hasOwnProperty("bucketId")) object.bucketId = message.bucketId; - if (message.project != null && Object.hasOwnProperty.call(message, "project")) + if (message.project != null && message.hasOwnProperty("project")) object.project = message.project; - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.metageneration = typeof message.metageneration === "number" ? BigInt(message.metageneration) : $util.Long.fromBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0, false).toBigInt(); - else if (typeof message.metageneration === "number") + 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 && Object.hasOwnProperty.call(message, "location")) + if (message.location != null && message.hasOwnProperty("location")) object.location = message.location; - if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + if (message.locationType != null && message.hasOwnProperty("locationType")) object.locationType = message.locationType; - if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + 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, q + 1); + 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, q + 1); + object.defaultObjectAcl[j] = $root.google.storage.v2.ObjectAccessControl.toObject(message.defaultObjectAcl[j], options); } - if (message.lifecycle != null && Object.hasOwnProperty.call(message, "lifecycle")) - object.lifecycle = $root.google.storage.v2.Bucket.Lifecycle.toObject(message.lifecycle, options, q + 1); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + 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, q + 1); + object.cors[j] = $root.google.storage.v2.Bucket.Cors.toObject(message.cors[j], options); } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.defaultEventBasedHold != null && Object.hasOwnProperty.call(message, "defaultEventBasedHold")) + 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) { @@ -42078,40 +40714,40 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } } - if (message.website != null && Object.hasOwnProperty.call(message, "website")) - object.website = $root.google.storage.v2.Bucket.Website.toObject(message.website, options, q + 1); - if (message.versioning != null && Object.hasOwnProperty.call(message, "versioning")) - object.versioning = $root.google.storage.v2.Bucket.Versioning.toObject(message.versioning, options, q + 1); - if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) - object.logging = $root.google.storage.v2.Bucket.Logging.toObject(message.logging, options, q + 1); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - object.owner = $root.google.storage.v2.Owner.toObject(message.owner, options, q + 1); - if (message.encryption != null && Object.hasOwnProperty.call(message, "encryption")) - object.encryption = $root.google.storage.v2.Bucket.Encryption.toObject(message.encryption, options, q + 1); - if (message.billing != null && Object.hasOwnProperty.call(message, "billing")) - object.billing = $root.google.storage.v2.Bucket.Billing.toObject(message.billing, options, q + 1); - if (message.retentionPolicy != null && Object.hasOwnProperty.call(message, "retentionPolicy")) - object.retentionPolicy = $root.google.storage.v2.Bucket.RetentionPolicy.toObject(message.retentionPolicy, options, q + 1); - if (message.iamConfig != null && Object.hasOwnProperty.call(message, "iamConfig")) - object.iamConfig = $root.google.storage.v2.Bucket.IamConfig.toObject(message.iamConfig, options, q + 1); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + 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 && Object.hasOwnProperty.call(message, "customPlacementConfig")) - object.customPlacementConfig = $root.google.storage.v2.Bucket.CustomPlacementConfig.toObject(message.customPlacementConfig, options, q + 1); - if (message.rpo != null && Object.hasOwnProperty.call(message, "rpo")) + 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 && Object.hasOwnProperty.call(message, "autoclass")) - object.autoclass = $root.google.storage.v2.Bucket.Autoclass.toObject(message.autoclass, options, q + 1); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + 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 && Object.hasOwnProperty.call(message, "softDeletePolicy")) - object.softDeletePolicy = $root.google.storage.v2.Bucket.SoftDeletePolicy.toObject(message.softDeletePolicy, options, q + 1); - if (message.hierarchicalNamespace != null && Object.hasOwnProperty.call(message, "hierarchicalNamespace")) - object.hierarchicalNamespace = $root.google.storage.v2.Bucket.HierarchicalNamespace.toObject(message.hierarchicalNamespace, options, q + 1); - if (message.objectRetention != null && Object.hasOwnProperty.call(message, "objectRetention")) - object.objectRetention = $root.google.storage.v2.Bucket.ObjectRetention.toObject(message.objectRetention, options, q + 1); - if (message.ipFilter != null && Object.hasOwnProperty.call(message, "ipFilter")) { - object.ipFilter = $root.google.storage.v2.Bucket.IpFilter.toObject(message.ipFilter, options, q + 1); + 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"; } @@ -42197,13 +40833,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Billing.encode = function encode(message, writer, q) { + Billing.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.requesterPays != null && Object.hasOwnProperty.call(message, "requesterPays")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requesterPays); return writer; @@ -42219,7 +40851,7 @@ * @returns {$protobuf.Writer} Writer */ Billing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -42289,7 +40921,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.requesterPays != null && Object.hasOwnProperty.call(message, "requesterPays")) + if (message.requesterPays != null && message.hasOwnProperty("requesterPays")) if (typeof message.requesterPays !== "boolean") return "requesterPays: boolean expected"; return null; @@ -42306,8 +40938,6 @@ Billing.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Billing) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Billing: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -42327,17 +40957,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Billing.toObject = function toObject(message, options, q) { + Billing.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.requesterPays = false; - if (message.requesterPays != null && Object.hasOwnProperty.call(message, "requesterPays")) + if (message.requesterPays != null && message.hasOwnProperty("requesterPays")) object.requesterPays = message.requesterPays; return object; }; @@ -42454,13 +41080,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cors.encode = function encode(message, writer, q) { + Cors.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -42485,7 +41107,7 @@ * @returns {$protobuf.Writer} Writer */ Cors.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -42573,28 +41195,28 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) { + 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 && Object.hasOwnProperty.call(message, "method")) { + 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 && Object.hasOwnProperty.call(message, "responseHeader")) { + 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 && Object.hasOwnProperty.call(message, "maxAgeSeconds")) + if (message.maxAgeSeconds != null && message.hasOwnProperty("maxAgeSeconds")) if (!$util.isInteger(message.maxAgeSeconds)) return "maxAgeSeconds: integer expected"; return null; @@ -42611,8 +41233,6 @@ Cors.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Cors) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Cors: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -42653,13 +41273,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Cors.toObject = function toObject(message, options, q) { + Cors.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.origin = []; @@ -42683,7 +41299,7 @@ for (var j = 0; j < message.responseHeader.length; ++j) object.responseHeader[j] = message.responseHeader[j]; } - if (message.maxAgeSeconds != null && Object.hasOwnProperty.call(message, "maxAgeSeconds")) + if (message.maxAgeSeconds != null && message.hasOwnProperty("maxAgeSeconds")) object.maxAgeSeconds = message.maxAgeSeconds; return object; }; @@ -42818,21 +41434,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Encryption.encode = function encode(message, writer, q) { + Encryption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.encode(message.customerSuppliedEncryptionEnforcementConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -42846,7 +41458,7 @@ * @returns {$protobuf.Writer} Writer */ Encryption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -42929,10 +41541,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.defaultKmsKey != null && Object.hasOwnProperty.call(message, "defaultKmsKey")) + if (message.defaultKmsKey != null && message.hasOwnProperty("defaultKmsKey")) if (!$util.isString(message.defaultKmsKey)) return "defaultKmsKey: string expected"; - if (message.googleManagedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "googleManagedEncryptionEnforcementConfig")) { + if (message.googleManagedEncryptionEnforcementConfig != null && message.hasOwnProperty("googleManagedEncryptionEnforcementConfig")) { properties._googleManagedEncryptionEnforcementConfig = 1; { var error = $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.verify(message.googleManagedEncryptionEnforcementConfig, long + 1); @@ -42940,7 +41552,7 @@ return "googleManagedEncryptionEnforcementConfig." + error; } } - if (message.customerManagedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "customerManagedEncryptionEnforcementConfig")) { + if (message.customerManagedEncryptionEnforcementConfig != null && message.hasOwnProperty("customerManagedEncryptionEnforcementConfig")) { properties._customerManagedEncryptionEnforcementConfig = 1; { var error = $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.verify(message.customerManagedEncryptionEnforcementConfig, long + 1); @@ -42948,7 +41560,7 @@ return "customerManagedEncryptionEnforcementConfig." + error; } } - if (message.customerSuppliedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "customerSuppliedEncryptionEnforcementConfig")) { + if (message.customerSuppliedEncryptionEnforcementConfig != null && message.hasOwnProperty("customerSuppliedEncryptionEnforcementConfig")) { properties._customerSuppliedEncryptionEnforcementConfig = 1; { var error = $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.verify(message.customerSuppliedEncryptionEnforcementConfig, long + 1); @@ -42970,8 +41582,6 @@ Encryption.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Encryption) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Encryption: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -42980,17 +41590,17 @@ if (object.defaultKmsKey != null) message.defaultKmsKey = String(object.defaultKmsKey); if (object.googleManagedEncryptionEnforcementConfig != null) { - if (!$util.isObject(object.googleManagedEncryptionEnforcementConfig)) + 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, long + 1); } if (object.customerManagedEncryptionEnforcementConfig != null) { - if (!$util.isObject(object.customerManagedEncryptionEnforcementConfig)) + 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, long + 1); } if (object.customerSuppliedEncryptionEnforcementConfig != null) { - if (!$util.isObject(object.customerSuppliedEncryptionEnforcementConfig)) + 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, long + 1); } @@ -43006,30 +41616,26 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Encryption.toObject = function toObject(message, options, q) { + Encryption.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.defaultKmsKey = ""; - if (message.defaultKmsKey != null && Object.hasOwnProperty.call(message, "defaultKmsKey")) + if (message.defaultKmsKey != null && message.hasOwnProperty("defaultKmsKey")) object.defaultKmsKey = message.defaultKmsKey; - if (message.googleManagedEncryptionEnforcementConfig != null && Object.hasOwnProperty.call(message, "googleManagedEncryptionEnforcementConfig")) { - object.googleManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.toObject(message.googleManagedEncryptionEnforcementConfig, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "customerManagedEncryptionEnforcementConfig")) { - object.customerManagedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.toObject(message.customerManagedEncryptionEnforcementConfig, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "customerSuppliedEncryptionEnforcementConfig")) { - object.customerSuppliedEncryptionEnforcementConfig = $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.toObject(message.customerSuppliedEncryptionEnforcementConfig, options, q + 1); + 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"; } @@ -43139,15 +41745,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GoogleManagedEncryptionEnforcementConfig.encode = function encode(message, writer, q) { + GoogleManagedEncryptionEnforcementConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) - $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $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; @@ -43163,7 +41765,7 @@ * @returns {$protobuf.Writer} Writer */ GoogleManagedEncryptionEnforcementConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -43238,12 +41840,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.restrictionMode != null && Object.hasOwnProperty.call(message, "restrictionMode")) { + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { properties._restrictionMode = 1; if (!$util.isString(message.restrictionMode)) return "restrictionMode: string expected"; } - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { properties._effectiveTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime, long + 1); @@ -43265,8 +41867,6 @@ GoogleManagedEncryptionEnforcementConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43275,7 +41875,7 @@ if (object.restrictionMode != null) message.restrictionMode = String(object.restrictionMode); if (object.effectiveTime != null) { - if (!$util.isObject(object.effectiveTime)) + 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, long + 1); } @@ -43291,20 +41891,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GoogleManagedEncryptionEnforcementConfig.toObject = function toObject(message, options, q) { + GoogleManagedEncryptionEnforcementConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { - object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "restrictionMode")) { + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { object.restrictionMode = message.restrictionMode; if (options.oneofs) object._restrictionMode = "restrictionMode"; @@ -43418,15 +42014,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomerManagedEncryptionEnforcementConfig.encode = function encode(message, writer, q) { + CustomerManagedEncryptionEnforcementConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) - $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $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; @@ -43442,7 +42034,7 @@ * @returns {$protobuf.Writer} Writer */ CustomerManagedEncryptionEnforcementConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -43517,12 +42109,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.restrictionMode != null && Object.hasOwnProperty.call(message, "restrictionMode")) { + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { properties._restrictionMode = 1; if (!$util.isString(message.restrictionMode)) return "restrictionMode: string expected"; } - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { properties._effectiveTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime, long + 1); @@ -43544,8 +42136,6 @@ CustomerManagedEncryptionEnforcementConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43554,7 +42144,7 @@ if (object.restrictionMode != null) message.restrictionMode = String(object.restrictionMode); if (object.effectiveTime != null) { - if (!$util.isObject(object.effectiveTime)) + 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, long + 1); } @@ -43570,20 +42160,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomerManagedEncryptionEnforcementConfig.toObject = function toObject(message, options, q) { + CustomerManagedEncryptionEnforcementConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { - object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "restrictionMode")) { + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { object.restrictionMode = message.restrictionMode; if (options.oneofs) object._restrictionMode = "restrictionMode"; @@ -43697,15 +42283,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomerSuppliedEncryptionEnforcementConfig.encode = function encode(message, writer, q) { + CustomerSuppliedEncryptionEnforcementConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) - $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $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; @@ -43721,7 +42303,7 @@ * @returns {$protobuf.Writer} Writer */ CustomerSuppliedEncryptionEnforcementConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -43796,12 +42378,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.restrictionMode != null && Object.hasOwnProperty.call(message, "restrictionMode")) { + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { properties._restrictionMode = 1; if (!$util.isString(message.restrictionMode)) return "restrictionMode: string expected"; } - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { properties._effectiveTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime, long + 1); @@ -43823,8 +42405,6 @@ CustomerSuppliedEncryptionEnforcementConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43833,7 +42413,7 @@ if (object.restrictionMode != null) message.restrictionMode = String(object.restrictionMode); if (object.effectiveTime != null) { - if (!$util.isObject(object.effectiveTime)) + 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, long + 1); } @@ -43849,20 +42429,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomerSuppliedEncryptionEnforcementConfig.toObject = function toObject(message, options, q) { + CustomerSuppliedEncryptionEnforcementConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { - object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "restrictionMode")) { + if (message.restrictionMode != null && message.hasOwnProperty("restrictionMode")) { object.restrictionMode = message.restrictionMode; if (options.oneofs) object._restrictionMode = "restrictionMode"; @@ -43964,15 +42540,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamConfig.encode = function encode(message, writer, q) { + IamConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -43988,7 +42560,7 @@ * @returns {$protobuf.Writer} Writer */ IamConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -44062,12 +42634,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uniformBucketLevelAccess != null && Object.hasOwnProperty.call(message, "uniformBucketLevelAccess")) { + if (message.uniformBucketLevelAccess != null && message.hasOwnProperty("uniformBucketLevelAccess")) { var error = $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.verify(message.uniformBucketLevelAccess, long + 1); if (error) return "uniformBucketLevelAccess." + error; } - if (message.publicAccessPrevention != null && Object.hasOwnProperty.call(message, "publicAccessPrevention")) + if (message.publicAccessPrevention != null && message.hasOwnProperty("publicAccessPrevention")) if (!$util.isString(message.publicAccessPrevention)) return "publicAccessPrevention: string expected"; return null; @@ -44084,15 +42656,13 @@ IamConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.IamConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.IamConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.Bucket.IamConfig(); if (object.uniformBucketLevelAccess != null) { - if (!$util.isObject(object.uniformBucketLevelAccess)) + 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, long + 1); } @@ -44110,21 +42680,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IamConfig.toObject = function toObject(message, options, q) { + IamConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.uniformBucketLevelAccess = null; object.publicAccessPrevention = ""; } - if (message.uniformBucketLevelAccess != null && Object.hasOwnProperty.call(message, "uniformBucketLevelAccess")) - object.uniformBucketLevelAccess = $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.toObject(message.uniformBucketLevelAccess, options, q + 1); - if (message.publicAccessPrevention != null && Object.hasOwnProperty.call(message, "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; }; @@ -44217,17 +42783,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UniformBucketLevelAccess.encode = function encode(message, writer, q) { + UniformBucketLevelAccess.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.lockTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -44241,7 +42803,7 @@ * @returns {$protobuf.Writer} Writer */ UniformBucketLevelAccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -44315,10 +42877,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; - if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime")) { + if (message.lockTime != null && message.hasOwnProperty("lockTime")) { var error = $root.google.protobuf.Timestamp.verify(message.lockTime, long + 1); if (error) return "lockTime." + error; @@ -44337,8 +42899,6 @@ UniformBucketLevelAccess.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44347,7 +42907,7 @@ if (object.enabled != null) message.enabled = Boolean(object.enabled); if (object.lockTime != null) { - if (!$util.isObject(object.lockTime)) + 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, long + 1); } @@ -44363,22 +42923,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UniformBucketLevelAccess.toObject = function toObject(message, options, q) { + UniformBucketLevelAccess.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.enabled = false; object.lockTime = null; } - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; - if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime")) - object.lockTime = $root.google.protobuf.Timestamp.toObject(message.lockTime, options, q + 1); + if (message.lockTime != null && message.hasOwnProperty("lockTime")) + object.lockTime = $root.google.protobuf.Timestamp.toObject(message.lockTime, options); return object; }; @@ -44468,16 +43024,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Lifecycle.encode = function encode(message, writer, q) { + Lifecycle.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.storage.v2.Bucket.Lifecycle.Rule.encode(message.rule[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -44491,7 +43043,7 @@ * @returns {$protobuf.Writer} Writer */ Lifecycle.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -44563,7 +43115,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) { + 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) { @@ -44586,8 +43138,6 @@ Lifecycle.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Lifecycle) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Lifecycle: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44598,7 +43148,7 @@ throw TypeError(".google.storage.v2.Bucket.Lifecycle.rule: array expected"); message.rule = []; for (var i = 0; i < object.rule.length; ++i) { - if (!$util.isObject(object.rule[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], long + 1); } @@ -44615,20 +43165,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Lifecycle.toObject = function toObject(message, options, q) { + Lifecycle.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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, q + 1); + object.rule[j] = $root.google.storage.v2.Bucket.Lifecycle.Rule.toObject(message.rule[j], options); } return object; }; @@ -44721,17 +43267,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Rule.encode = function encode(message, writer, q) { + Rule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.encode(message.condition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -44745,7 +43287,7 @@ * @returns {$protobuf.Writer} Writer */ Rule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -44819,12 +43361,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.action != null && Object.hasOwnProperty.call(message, "action")) { + if (message.action != null && message.hasOwnProperty("action")) { var error = $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.verify(message.action, long + 1); if (error) return "action." + error; } - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) { + if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.verify(message.condition, long + 1); if (error) return "condition." + error; @@ -44843,20 +43385,18 @@ Rule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Lifecycle.Rule) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.Bucket.Lifecycle.Rule(); if (object.action != null) { - if (!$util.isObject(object.action)) + 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, long + 1); } if (object.condition != null) { - if (!$util.isObject(object.condition)) + 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, long + 1); } @@ -44872,22 +43412,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Rule.toObject = function toObject(message, options, q) { + Rule.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.action = null; object.condition = null; } - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - object.action = $root.google.storage.v2.Bucket.Lifecycle.Rule.Action.toObject(message.action, options, q + 1); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - object.condition = $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition.toObject(message.condition, options, q + 1); + 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; }; @@ -44979,13 +43515,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Action.encode = function encode(message, writer, q) { + Action.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -45003,7 +43535,7 @@ * @returns {$protobuf.Writer} Writer */ Action.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -45077,10 +43609,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + if (message.storageClass != null && message.hasOwnProperty("storageClass")) if (!$util.isString(message.storageClass)) return "storageClass: string expected"; return null; @@ -45097,8 +43629,6 @@ Action.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Lifecycle.Rule.Action) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Action: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45120,21 +43650,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Action.toObject = function toObject(message, options, q) { + Action.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.type = ""; object.storageClass = ""; } - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; - if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + if (message.storageClass != null && message.hasOwnProperty("storageClass")) object.storageClass = message.storageClass; return object; }; @@ -45347,17 +43873,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Condition.encode = function encode(message, writer, q) { + Condition.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -45368,11 +43890,11 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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]); @@ -45392,7 +43914,7 @@ * @returns {$protobuf.Writer} Writer */ Condition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -45509,61 +44031,61 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ageDays != null && Object.hasOwnProperty.call(message, "ageDays")) { + if (message.ageDays != null && message.hasOwnProperty("ageDays")) { properties._ageDays = 1; if (!$util.isInteger(message.ageDays)) return "ageDays: integer expected"; } - if (message.createdBefore != null && Object.hasOwnProperty.call(message, "createdBefore")) { + if (message.createdBefore != null && message.hasOwnProperty("createdBefore")) { var error = $root.google.type.Date.verify(message.createdBefore, long + 1); if (error) return "createdBefore." + error; } - if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive")) { + if (message.isLive != null && message.hasOwnProperty("isLive")) { properties._isLive = 1; if (typeof message.isLive !== "boolean") return "isLive: boolean expected"; } - if (message.numNewerVersions != null && Object.hasOwnProperty.call(message, "numNewerVersions")) { + if (message.numNewerVersions != null && message.hasOwnProperty("numNewerVersions")) { properties._numNewerVersions = 1; if (!$util.isInteger(message.numNewerVersions)) return "numNewerVersions: integer expected"; } - if (message.matchesStorageClass != null && Object.hasOwnProperty.call(message, "matchesStorageClass")) { + 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 && Object.hasOwnProperty.call(message, "daysSinceCustomTime")) { + if (message.daysSinceCustomTime != null && message.hasOwnProperty("daysSinceCustomTime")) { properties._daysSinceCustomTime = 1; if (!$util.isInteger(message.daysSinceCustomTime)) return "daysSinceCustomTime: integer expected"; } - if (message.customTimeBefore != null && Object.hasOwnProperty.call(message, "customTimeBefore")) { + if (message.customTimeBefore != null && message.hasOwnProperty("customTimeBefore")) { var error = $root.google.type.Date.verify(message.customTimeBefore, long + 1); if (error) return "customTimeBefore." + error; } - if (message.daysSinceNoncurrentTime != null && Object.hasOwnProperty.call(message, "daysSinceNoncurrentTime")) { + if (message.daysSinceNoncurrentTime != null && message.hasOwnProperty("daysSinceNoncurrentTime")) { properties._daysSinceNoncurrentTime = 1; if (!$util.isInteger(message.daysSinceNoncurrentTime)) return "daysSinceNoncurrentTime: integer expected"; } - if (message.noncurrentTimeBefore != null && Object.hasOwnProperty.call(message, "noncurrentTimeBefore")) { + if (message.noncurrentTimeBefore != null && message.hasOwnProperty("noncurrentTimeBefore")) { var error = $root.google.type.Date.verify(message.noncurrentTimeBefore, long + 1); if (error) return "noncurrentTimeBefore." + error; } - if (message.matchesPrefix != null && Object.hasOwnProperty.call(message, "matchesPrefix")) { + 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 && Object.hasOwnProperty.call(message, "matchesSuffix")) { + 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) @@ -45584,8 +44106,6 @@ Condition.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Lifecycle.Rule.Condition) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Lifecycle.Rule.Condition: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45594,7 +44114,7 @@ if (object.ageDays != null) message.ageDays = object.ageDays | 0; if (object.createdBefore != null) { - if (!$util.isObject(object.createdBefore)) + 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, long + 1); } @@ -45612,14 +44132,14 @@ if (object.daysSinceCustomTime != null) message.daysSinceCustomTime = object.daysSinceCustomTime | 0; if (object.customTimeBefore != null) { - if (!$util.isObject(object.customTimeBefore)) + 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, long + 1); } if (object.daysSinceNoncurrentTime != null) message.daysSinceNoncurrentTime = object.daysSinceNoncurrentTime | 0; if (object.noncurrentTimeBefore != null) { - if (!$util.isObject(object.noncurrentTimeBefore)) + 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, long + 1); } @@ -45649,13 +44169,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Condition.toObject = function toObject(message, options, q) { + Condition.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.matchesStorageClass = []; @@ -45667,19 +44183,19 @@ object.customTimeBefore = null; object.noncurrentTimeBefore = null; } - if (message.ageDays != null && Object.hasOwnProperty.call(message, "ageDays")) { + if (message.ageDays != null && message.hasOwnProperty("ageDays")) { object.ageDays = message.ageDays; if (options.oneofs) object._ageDays = "ageDays"; } - if (message.createdBefore != null && Object.hasOwnProperty.call(message, "createdBefore")) - object.createdBefore = $root.google.type.Date.toObject(message.createdBefore, options, q + 1); - if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive")) { + 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 && Object.hasOwnProperty.call(message, "numNewerVersions")) { + if (message.numNewerVersions != null && message.hasOwnProperty("numNewerVersions")) { object.numNewerVersions = message.numNewerVersions; if (options.oneofs) object._numNewerVersions = "numNewerVersions"; @@ -45689,20 +44205,20 @@ for (var j = 0; j < message.matchesStorageClass.length; ++j) object.matchesStorageClass[j] = message.matchesStorageClass[j]; } - if (message.daysSinceCustomTime != null && Object.hasOwnProperty.call(message, "daysSinceCustomTime")) { + if (message.daysSinceCustomTime != null && message.hasOwnProperty("daysSinceCustomTime")) { object.daysSinceCustomTime = message.daysSinceCustomTime; if (options.oneofs) object._daysSinceCustomTime = "daysSinceCustomTime"; } - if (message.customTimeBefore != null && Object.hasOwnProperty.call(message, "customTimeBefore")) - object.customTimeBefore = $root.google.type.Date.toObject(message.customTimeBefore, options, q + 1); - if (message.daysSinceNoncurrentTime != null && Object.hasOwnProperty.call(message, "daysSinceNoncurrentTime")) { + 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 && Object.hasOwnProperty.call(message, "noncurrentTimeBefore")) - object.noncurrentTimeBefore = $root.google.type.Date.toObject(message.noncurrentTimeBefore, options, q + 1); + 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) @@ -45813,13 +44329,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Logging.encode = function encode(message, writer, q) { + Logging.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -45837,7 +44349,7 @@ * @returns {$protobuf.Writer} Writer */ Logging.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -45911,10 +44423,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.logBucket != null && Object.hasOwnProperty.call(message, "logBucket")) + if (message.logBucket != null && message.hasOwnProperty("logBucket")) if (!$util.isString(message.logBucket)) return "logBucket: string expected"; - if (message.logObjectPrefix != null && Object.hasOwnProperty.call(message, "logObjectPrefix")) + if (message.logObjectPrefix != null && message.hasOwnProperty("logObjectPrefix")) if (!$util.isString(message.logObjectPrefix)) return "logObjectPrefix: string expected"; return null; @@ -45931,8 +44443,6 @@ Logging.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Logging) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Logging: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45954,21 +44464,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Logging.toObject = function toObject(message, options, q) { + Logging.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.logBucket = ""; object.logObjectPrefix = ""; } - if (message.logBucket != null && Object.hasOwnProperty.call(message, "logBucket")) + if (message.logBucket != null && message.hasOwnProperty("logBucket")) object.logBucket = message.logBucket; - if (message.logObjectPrefix != null && Object.hasOwnProperty.call(message, "logObjectPrefix")) + if (message.logObjectPrefix != null && message.hasOwnProperty("logObjectPrefix")) object.logObjectPrefix = message.logObjectPrefix; return object; }; @@ -46055,13 +44561,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectRetention.encode = function encode(message, writer, q) { + ObjectRetention.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); return writer; @@ -46077,7 +44579,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -46147,7 +44649,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; return null; @@ -46164,8 +44666,6 @@ ObjectRetention.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.ObjectRetention) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.ObjectRetention: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -46185,17 +44685,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectRetention.toObject = function toObject(message, options, q) { + ObjectRetention.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.enabled = false; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; return object; }; @@ -46300,19 +44796,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RetentionPolicy.encode = function encode(message, writer, q) { + RetentionPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) - $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -46326,7 +44818,7 @@ * @returns {$protobuf.Writer} Writer */ RetentionPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -46404,15 +44896,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime, long + 1); if (error) return "effectiveTime." + error; } - if (message.isLocked != null && Object.hasOwnProperty.call(message, "isLocked")) + if (message.isLocked != null && message.hasOwnProperty("isLocked")) if (typeof message.isLocked !== "boolean") return "isLocked: boolean expected"; - if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) { + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { var error = $root.google.protobuf.Duration.verify(message.retentionDuration, long + 1); if (error) return "retentionDuration." + error; @@ -46431,22 +44923,20 @@ RetentionPolicy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.RetentionPolicy) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.RetentionPolicy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.Bucket.RetentionPolicy(); if (object.effectiveTime != null) { - if (!$util.isObject(object.effectiveTime)) + if (typeof object.effectiveTime !== "object") throw TypeError(".google.storage.v2.Bucket.RetentionPolicy.effectiveTime: object expected"); message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime, long + 1); } if (object.isLocked != null) message.isLocked = Boolean(object.isLocked); if (object.retentionDuration != null) { - if (!$util.isObject(object.retentionDuration)) + if (typeof object.retentionDuration !== "object") throw TypeError(".google.storage.v2.Bucket.RetentionPolicy.retentionDuration: object expected"); message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration, long + 1); } @@ -46462,25 +44952,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RetentionPolicy.toObject = function toObject(message, options, q) { + RetentionPolicy.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.effectiveTime = null; object.isLocked = false; object.retentionDuration = null; } - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) - object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options, q + 1); - if (message.isLocked != null && Object.hasOwnProperty.call(message, "isLocked")) + 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 && Object.hasOwnProperty.call(message, "retentionDuration")) - object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options, q + 1); + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) + object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); return object; }; @@ -46590,17 +45076,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftDeletePolicy.encode = function encode(message, writer, q) { + SoftDeletePolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) - $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -46614,7 +45096,7 @@ * @returns {$protobuf.Writer} Writer */ SoftDeletePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -46689,7 +45171,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) { + if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { properties._retentionDuration = 1; { var error = $root.google.protobuf.Duration.verify(message.retentionDuration, long + 1); @@ -46697,7 +45179,7 @@ return "retentionDuration." + error; } } - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) { + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { properties._effectiveTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime, long + 1); @@ -46719,20 +45201,18 @@ SoftDeletePolicy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.SoftDeletePolicy) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.SoftDeletePolicy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.Bucket.SoftDeletePolicy(); if (object.retentionDuration != null) { - if (!$util.isObject(object.retentionDuration)) + if (typeof object.retentionDuration !== "object") throw TypeError(".google.storage.v2.Bucket.SoftDeletePolicy.retentionDuration: object expected"); message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration, long + 1); } if (object.effectiveTime != null) { - if (!$util.isObject(object.effectiveTime)) + if (typeof object.effectiveTime !== "object") throw TypeError(".google.storage.v2.Bucket.SoftDeletePolicy.effectiveTime: object expected"); message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime, long + 1); } @@ -46748,21 +45228,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SoftDeletePolicy.toObject = function toObject(message, options, q) { + SoftDeletePolicy.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; - if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) { - object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "effectiveTime")) { - object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options, q + 1); + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); if (options.oneofs) object._effectiveTime = "effectiveTime"; } @@ -46851,13 +45327,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Versioning.encode = function encode(message, writer, q) { + Versioning.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); return writer; @@ -46873,7 +45345,7 @@ * @returns {$protobuf.Writer} Writer */ Versioning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -46943,7 +45415,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; return null; @@ -46960,8 +45432,6 @@ Versioning.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Versioning) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Versioning: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -46981,17 +45451,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Versioning.toObject = function toObject(message, options, q) { + Versioning.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.enabled = false; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; return object; }; @@ -47087,13 +45553,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Website.encode = function encode(message, writer, q) { + Website.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -47111,7 +45573,7 @@ * @returns {$protobuf.Writer} Writer */ Website.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -47185,10 +45647,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mainPageSuffix != null && Object.hasOwnProperty.call(message, "mainPageSuffix")) + if (message.mainPageSuffix != null && message.hasOwnProperty("mainPageSuffix")) if (!$util.isString(message.mainPageSuffix)) return "mainPageSuffix: string expected"; - if (message.notFoundPage != null && Object.hasOwnProperty.call(message, "notFoundPage")) + if (message.notFoundPage != null && message.hasOwnProperty("notFoundPage")) if (!$util.isString(message.notFoundPage)) return "notFoundPage: string expected"; return null; @@ -47205,8 +45667,6 @@ Website.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Website) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Website: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -47228,21 +45688,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Website.toObject = function toObject(message, options, q) { + Website.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.mainPageSuffix = ""; object.notFoundPage = ""; } - if (message.mainPageSuffix != null && Object.hasOwnProperty.call(message, "mainPageSuffix")) + if (message.mainPageSuffix != null && message.hasOwnProperty("mainPageSuffix")) object.mainPageSuffix = message.mainPageSuffix; - if (message.notFoundPage != null && Object.hasOwnProperty.call(message, "notFoundPage")) + if (message.notFoundPage != null && message.hasOwnProperty("notFoundPage")) object.notFoundPage = message.notFoundPage; return object; }; @@ -47330,13 +45786,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomPlacementConfig.encode = function encode(message, writer, q) { + CustomPlacementConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -47353,7 +45805,7 @@ * @returns {$protobuf.Writer} Writer */ CustomPlacementConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -47425,7 +45877,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dataLocations != null && Object.hasOwnProperty.call(message, "dataLocations")) { + 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) @@ -47446,8 +45898,6 @@ CustomPlacementConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.CustomPlacementConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.CustomPlacementConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -47472,13 +45922,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomPlacementConfig.toObject = function toObject(message, options, q) { + CustomPlacementConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.dataLocations = []; @@ -47614,21 +46060,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Autoclass.encode = function encode(message, writer, q) { + Autoclass.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.terminalStorageClassUpdateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -47642,7 +46084,7 @@ * @returns {$protobuf.Writer} Writer */ Autoclass.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -47725,20 +46167,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; - if (message.toggleTime != null && Object.hasOwnProperty.call(message, "toggleTime")) { + if (message.toggleTime != null && message.hasOwnProperty("toggleTime")) { var error = $root.google.protobuf.Timestamp.verify(message.toggleTime, long + 1); if (error) return "toggleTime." + error; } - if (message.terminalStorageClass != null && Object.hasOwnProperty.call(message, "terminalStorageClass")) { + if (message.terminalStorageClass != null && message.hasOwnProperty("terminalStorageClass")) { properties._terminalStorageClass = 1; if (!$util.isString(message.terminalStorageClass)) return "terminalStorageClass: string expected"; } - if (message.terminalStorageClassUpdateTime != null && Object.hasOwnProperty.call(message, "terminalStorageClassUpdateTime")) { + if (message.terminalStorageClassUpdateTime != null && message.hasOwnProperty("terminalStorageClassUpdateTime")) { properties._terminalStorageClassUpdateTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.terminalStorageClassUpdateTime, long + 1); @@ -47760,8 +46202,6 @@ Autoclass.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.Autoclass) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.Autoclass: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -47770,14 +46210,14 @@ if (object.enabled != null) message.enabled = Boolean(object.enabled); if (object.toggleTime != null) { - if (!$util.isObject(object.toggleTime)) + if (typeof object.toggleTime !== "object") throw TypeError(".google.storage.v2.Bucket.Autoclass.toggleTime: object expected"); message.toggleTime = $root.google.protobuf.Timestamp.fromObject(object.toggleTime, long + 1); } if (object.terminalStorageClass != null) message.terminalStorageClass = String(object.terminalStorageClass); if (object.terminalStorageClassUpdateTime != null) { - if (!$util.isObject(object.terminalStorageClassUpdateTime)) + if (typeof object.terminalStorageClassUpdateTime !== "object") throw TypeError(".google.storage.v2.Bucket.Autoclass.terminalStorageClassUpdateTime: object expected"); message.terminalStorageClassUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.terminalStorageClassUpdateTime, long + 1); } @@ -47793,29 +46233,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Autoclass.toObject = function toObject(message, options, q) { + Autoclass.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.enabled = false; object.toggleTime = null; } - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; - if (message.toggleTime != null && Object.hasOwnProperty.call(message, "toggleTime")) - object.toggleTime = $root.google.protobuf.Timestamp.toObject(message.toggleTime, options, q + 1); - if (message.terminalStorageClass != null && Object.hasOwnProperty.call(message, "terminalStorageClass")) { + 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 && Object.hasOwnProperty.call(message, "terminalStorageClassUpdateTime")) { - object.terminalStorageClassUpdateTime = $root.google.protobuf.Timestamp.toObject(message.terminalStorageClassUpdateTime, options, q + 1); + if (message.terminalStorageClassUpdateTime != null && message.hasOwnProperty("terminalStorageClassUpdateTime")) { + object.terminalStorageClassUpdateTime = $root.google.protobuf.Timestamp.toObject(message.terminalStorageClassUpdateTime, options); if (options.oneofs) object._terminalStorageClassUpdateTime = "terminalStorageClassUpdateTime"; } @@ -47962,20 +46398,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IpFilter.encode = function encode(message, writer, q) { + IpFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -47993,7 +46425,7 @@ * @returns {$protobuf.Writer} Writer */ IpFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -48082,12 +46514,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) { + if (message.mode != null && message.hasOwnProperty("mode")) { properties._mode = 1; if (!$util.isString(message.mode)) return "mode: string expected"; } - if (message.publicNetworkSource != null && Object.hasOwnProperty.call(message, "publicNetworkSource")) { + if (message.publicNetworkSource != null && message.hasOwnProperty("publicNetworkSource")) { properties._publicNetworkSource = 1; { var error = $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.verify(message.publicNetworkSource, long + 1); @@ -48095,7 +46527,7 @@ return "publicNetworkSource." + error; } } - if (message.vpcNetworkSources != null && Object.hasOwnProperty.call(message, "vpcNetworkSources")) { + 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) { @@ -48104,10 +46536,10 @@ return "vpcNetworkSources." + error; } } - if (message.allowCrossOrgVpcs != null && Object.hasOwnProperty.call(message, "allowCrossOrgVpcs")) + if (message.allowCrossOrgVpcs != null && message.hasOwnProperty("allowCrossOrgVpcs")) if (typeof message.allowCrossOrgVpcs !== "boolean") return "allowCrossOrgVpcs: boolean expected"; - if (message.allowAllServiceAgentAccess != null && Object.hasOwnProperty.call(message, "allowAllServiceAgentAccess")) { + if (message.allowAllServiceAgentAccess != null && message.hasOwnProperty("allowAllServiceAgentAccess")) { properties._allowAllServiceAgentAccess = 1; if (typeof message.allowAllServiceAgentAccess !== "boolean") return "allowAllServiceAgentAccess: boolean expected"; @@ -48126,8 +46558,6 @@ IpFilter.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.IpFilter) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.IpFilter: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48136,7 +46566,7 @@ if (object.mode != null) message.mode = String(object.mode); if (object.publicNetworkSource != null) { - if (!$util.isObject(object.publicNetworkSource)) + 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, long + 1); } @@ -48145,7 +46575,7 @@ throw TypeError(".google.storage.v2.Bucket.IpFilter.vpcNetworkSources: array expected"); message.vpcNetworkSources = []; for (var i = 0; i < object.vpcNetworkSources.length; ++i) { - if (!$util.isObject(object.vpcNetworkSources[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], long + 1); } @@ -48166,36 +46596,32 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IpFilter.toObject = function toObject(message, options, q) { + IpFilter.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.vpcNetworkSources = []; if (options.defaults) object.allowCrossOrgVpcs = false; - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) { + if (message.mode != null && message.hasOwnProperty("mode")) { object.mode = message.mode; if (options.oneofs) object._mode = "mode"; } - if (message.publicNetworkSource != null && Object.hasOwnProperty.call(message, "publicNetworkSource")) { - object.publicNetworkSource = $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource.toObject(message.publicNetworkSource, options, q + 1); + 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, q + 1); + object.vpcNetworkSources[j] = $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource.toObject(message.vpcNetworkSources[j], options); } - if (message.allowCrossOrgVpcs != null && Object.hasOwnProperty.call(message, "allowCrossOrgVpcs")) + if (message.allowCrossOrgVpcs != null && message.hasOwnProperty("allowCrossOrgVpcs")) object.allowCrossOrgVpcs = message.allowCrossOrgVpcs; - if (message.allowAllServiceAgentAccess != null && Object.hasOwnProperty.call(message, "allowAllServiceAgentAccess")) { + if (message.allowAllServiceAgentAccess != null && message.hasOwnProperty("allowAllServiceAgentAccess")) { object.allowAllServiceAgentAccess = message.allowAllServiceAgentAccess; if (options.oneofs) object._allowAllServiceAgentAccess = "allowAllServiceAgentAccess"; @@ -48283,13 +46709,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PublicNetworkSource.encode = function encode(message, writer, q) { + PublicNetworkSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -48306,7 +46728,7 @@ * @returns {$protobuf.Writer} Writer */ PublicNetworkSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -48378,7 +46800,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.allowedIpCidrRanges != null && Object.hasOwnProperty.call(message, "allowedIpCidrRanges")) { + 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) @@ -48399,8 +46821,6 @@ PublicNetworkSource.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.IpFilter.PublicNetworkSource) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.IpFilter.PublicNetworkSource: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48425,13 +46845,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PublicNetworkSource.toObject = function toObject(message, options, q) { + PublicNetworkSource.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.allowedIpCidrRanges = []; @@ -48544,13 +46960,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VpcNetworkSource.encode = function encode(message, writer, q) { + VpcNetworkSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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) @@ -48569,7 +46981,7 @@ * @returns {$protobuf.Writer} Writer */ VpcNetworkSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -48646,12 +47058,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.network != null && Object.hasOwnProperty.call(message, "network")) { + if (message.network != null && message.hasOwnProperty("network")) { properties._network = 1; if (!$util.isString(message.network)) return "network: string expected"; } - if (message.allowedIpCidrRanges != null && Object.hasOwnProperty.call(message, "allowedIpCidrRanges")) { + 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) @@ -48672,8 +47084,6 @@ VpcNetworkSource.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.IpFilter.VpcNetworkSource) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.IpFilter.VpcNetworkSource: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48700,17 +47110,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VpcNetworkSource.toObject = function toObject(message, options, q) { + VpcNetworkSource.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.allowedIpCidrRanges = []; - if (message.network != null && Object.hasOwnProperty.call(message, "network")) { + if (message.network != null && message.hasOwnProperty("network")) { object.network = message.network; if (options.oneofs) object._network = "network"; @@ -48808,13 +47214,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HierarchicalNamespace.encode = function encode(message, writer, q) { + HierarchicalNamespace.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); return writer; @@ -48830,7 +47232,7 @@ * @returns {$protobuf.Writer} Writer */ HierarchicalNamespace.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -48900,7 +47302,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; return null; @@ -48917,8 +47319,6 @@ HierarchicalNamespace.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Bucket.HierarchicalNamespace) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Bucket.HierarchicalNamespace: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48938,17 +47338,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HierarchicalNamespace.toObject = function toObject(message, options, q) { + HierarchicalNamespace.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.enabled = false; - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; return object; }; @@ -49110,13 +47506,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketAccessControl.encode = function encode(message, writer, q) { + BucketAccessControl.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -49130,7 +47522,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -49148,7 +47540,7 @@ * @returns {$protobuf.Writer} Writer */ BucketAccessControl.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -49250,31 +47642,31 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) if (!$util.isString(message.role)) return "role: string expected"; - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) if (!$util.isString(message.id)) return "id: string expected"; - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + if (message.entity != null && message.hasOwnProperty("entity")) if (!$util.isString(message.entity)) return "entity: string expected"; - if (message.entityAlt != null && Object.hasOwnProperty.call(message, "entityAlt")) + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) if (!$util.isString(message.entityAlt)) return "entityAlt: string expected"; - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + if (message.entityId != null && message.hasOwnProperty("entityId")) if (!$util.isString(message.entityId)) return "entityId: string expected"; - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; - if (message.email != null && Object.hasOwnProperty.call(message, "email")) + if (message.email != null && message.hasOwnProperty("email")) if (!$util.isString(message.email)) return "email: string expected"; - if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + if (message.domain != null && message.hasOwnProperty("domain")) if (!$util.isString(message.domain)) return "domain: string expected"; - if (message.projectTeam != null && Object.hasOwnProperty.call(message, "projectTeam")) { + if (message.projectTeam != null && message.hasOwnProperty("projectTeam")) { var error = $root.google.storage.v2.ProjectTeam.verify(message.projectTeam, long + 1); if (error) return "projectTeam." + error; @@ -49293,8 +47685,6 @@ BucketAccessControl.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.BucketAccessControl) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.BucketAccessControl: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -49317,7 +47707,7 @@ if (object.domain != null) message.domain = String(object.domain); if (object.projectTeam != null) { - if (!$util.isObject(object.projectTeam)) + if (typeof object.projectTeam !== "object") throw TypeError(".google.storage.v2.BucketAccessControl.projectTeam: object expected"); message.projectTeam = $root.google.storage.v2.ProjectTeam.fromObject(object.projectTeam, long + 1); } @@ -49333,13 +47723,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BucketAccessControl.toObject = function toObject(message, options, q) { + BucketAccessControl.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.role = ""; @@ -49352,23 +47738,23 @@ object.etag = ""; object.entityAlt = ""; } - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + if (message.entity != null && message.hasOwnProperty("entity")) object.entity = message.entity; - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + if (message.entityId != null && message.hasOwnProperty("entityId")) object.entityId = message.entityId; - if (message.email != null && Object.hasOwnProperty.call(message, "email")) + if (message.email != null && message.hasOwnProperty("email")) object.email = message.email; - if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + if (message.domain != null && message.hasOwnProperty("domain")) object.domain = message.domain; - if (message.projectTeam != null && Object.hasOwnProperty.call(message, "projectTeam")) - object.projectTeam = $root.google.storage.v2.ProjectTeam.toObject(message.projectTeam, options, q + 1); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + 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 && Object.hasOwnProperty.call(message, "entityAlt")) + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) object.entityAlt = message.entityAlt; return object; }; @@ -49473,13 +47859,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChecksummedData.encode = function encode(message, writer, q) { + ChecksummedData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -49497,7 +47879,7 @@ * @returns {$protobuf.Writer} Writer */ ChecksummedData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -49572,10 +47954,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.content != null && Object.hasOwnProperty.call(message, "content")) + 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 && Object.hasOwnProperty.call(message, "crc32c")) { + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { properties._crc32c = 1; if (!$util.isInteger(message.crc32c)) return "crc32c: integer expected"; @@ -49594,8 +47976,6 @@ ChecksummedData.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ChecksummedData) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ChecksummedData: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -49620,13 +48000,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChecksummedData.toObject = function toObject(message, options, q) { + ChecksummedData.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) if (options.bytes === String) @@ -49636,9 +48012,9 @@ if (options.bytes !== Array) object.content = $util.newBuffer(object.content); } - if (message.content != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "crc32c")) { + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { object.crc32c = message.crc32c; if (options.oneofs) object._crc32c = "crc32c"; @@ -49746,13 +48122,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectChecksums.encode = function encode(message, writer, q) { + ObjectChecksums.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -49770,7 +48142,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectChecksums.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -49845,12 +48217,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.crc32c != null && Object.hasOwnProperty.call(message, "crc32c")) { + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { properties._crc32c = 1; if (!$util.isInteger(message.crc32c)) return "crc32c: integer expected"; } - if (message.md5Hash != null && Object.hasOwnProperty.call(message, "md5Hash")) + 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; @@ -49867,8 +48239,6 @@ ObjectChecksums.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ObjectChecksums) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ObjectChecksums: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -49893,13 +48263,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectChecksums.toObject = function toObject(message, options, q) { + ObjectChecksums.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) if (options.bytes === String) @@ -49909,12 +48275,12 @@ if (options.bytes !== Array) object.md5Hash = $util.newBuffer(object.md5Hash); } - if (message.crc32c != null && Object.hasOwnProperty.call(message, "crc32c")) { + if (message.crc32c != null && message.hasOwnProperty("crc32c")) { object.crc32c = message.crc32c; if (options.oneofs) object._crc32c = "crc32c"; } - if (message.md5Hash != null && Object.hasOwnProperty.call(message, "md5Hash")) + 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; }; @@ -50019,19 +48385,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectCustomContextPayload.encode = function encode(message, writer, q) { + ObjectCustomContextPayload.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -50045,7 +48407,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectCustomContextPayload.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -50123,15 +48485,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (message.value != null && message.hasOwnProperty("value")) if (!$util.isString(message.value)) return "value: string expected"; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; @@ -50150,8 +48512,6 @@ ObjectCustomContextPayload.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ObjectCustomContextPayload) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ObjectCustomContextPayload: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50160,12 +48520,12 @@ if (object.value != null) message.value = String(object.value); if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.v2.ObjectCustomContextPayload.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.v2.ObjectCustomContextPayload.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -50181,25 +48541,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectCustomContextPayload.toObject = function toObject(message, options, q) { + ObjectCustomContextPayload.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.value = ""; object.createTime = null; object.updateTime = null; } - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (message.value != null && message.hasOwnProperty("value")) object.value = message.value; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + 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; }; @@ -50286,17 +48642,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectContexts.encode = function encode(message, writer, q) { + ObjectContexts.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim().ldelim(); + $root.google.storage.v2.ObjectCustomContextPayload.encode(message.custom[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } return writer; }; @@ -50311,7 +48663,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectContexts.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -50402,7 +48754,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { + if (message.custom != null && message.hasOwnProperty("custom")) { if (!$util.isObject(message.custom)) return "custom: object expected"; var key = Object.keys(message.custom); @@ -50426,21 +48778,19 @@ ObjectContexts.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ObjectContexts) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ObjectContexts: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.storage.v2.ObjectContexts(); if (object.custom) { - if (!$util.isObject(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 (keys[i] === "__proto__") $util.makeProp(message.custom, keys[i]); - if (!$util.isObject(object.custom[keys[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]], long + 1); } @@ -50457,13 +48807,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectContexts.toObject = function toObject(message, options, q) { + ObjectContexts.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.custom = {}; @@ -50473,7 +48819,7 @@ for (var j = 0; j < keys2.length; ++j) { if (keys2[j] === "__proto__") $util.makeProp(object.custom, keys2[j]); - object.custom[keys2[j]] = $root.google.storage.v2.ObjectCustomContextPayload.toObject(message.custom[keys2[j]], options, q + 1); + object.custom[keys2[j]] = $root.google.storage.v2.ObjectCustomContextPayload.toObject(message.custom[keys2[j]], options); } } return object; @@ -50570,13 +48916,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomerEncryption.encode = function encode(message, writer, q) { + CustomerEncryption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -50594,7 +48936,7 @@ * @returns {$protobuf.Writer} Writer */ CustomerEncryption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -50668,10 +49010,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionAlgorithm != null && Object.hasOwnProperty.call(message, "encryptionAlgorithm")) + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) if (!$util.isString(message.encryptionAlgorithm)) return "encryptionAlgorithm: string expected"; - if (message.keySha256Bytes != null && Object.hasOwnProperty.call(message, "keySha256Bytes")) + 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; @@ -50688,8 +49030,6 @@ CustomerEncryption.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.CustomerEncryption) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.CustomerEncryption: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50714,13 +49054,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomerEncryption.toObject = function toObject(message, options, q) { + CustomerEncryption.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.encryptionAlgorithm = ""; @@ -50732,9 +49068,9 @@ object.keySha256Bytes = $util.newBuffer(object.keySha256Bytes); } } - if (message.encryptionAlgorithm != null && Object.hasOwnProperty.call(message, "encryptionAlgorithm")) + if (message.encryptionAlgorithm != null && message.hasOwnProperty("encryptionAlgorithm")) object.encryptionAlgorithm = message.encryptionAlgorithm; - if (message.keySha256Bytes != null && Object.hasOwnProperty.call(message, "keySha256Bytes")) + 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; }; @@ -50768,56 +49104,56 @@ return CustomerEncryption; })(); - v2.StorageObject = (function() { + v2.Object = (function() { /** - * Properties of a StorageObject. + * Properties of an Object. * @memberof google.storage.v2 - * @interface IStorageObject - * @property {string|null} [name] StorageObject name - * @property {string|null} [bucket] StorageObject bucket - * @property {string|null} [etag] StorageObject etag - * @property {number|Long|null} [generation] StorageObject generation - * @property {string|null} [restoreToken] StorageObject restoreToken - * @property {number|Long|null} [metageneration] StorageObject metageneration - * @property {string|null} [storageClass] StorageObject storageClass - * @property {number|Long|null} [size] StorageObject size - * @property {string|null} [contentEncoding] StorageObject contentEncoding - * @property {string|null} [contentDisposition] StorageObject contentDisposition - * @property {string|null} [cacheControl] StorageObject cacheControl - * @property {Array.|null} [acl] StorageObject acl - * @property {string|null} [contentLanguage] StorageObject contentLanguage - * @property {google.protobuf.ITimestamp|null} [deleteTime] StorageObject deleteTime - * @property {google.protobuf.ITimestamp|null} [finalizeTime] StorageObject finalizeTime - * @property {string|null} [contentType] StorageObject contentType - * @property {google.protobuf.ITimestamp|null} [createTime] StorageObject createTime - * @property {number|null} [componentCount] StorageObject componentCount - * @property {google.storage.v2.IObjectChecksums|null} [checksums] StorageObject checksums - * @property {google.protobuf.ITimestamp|null} [updateTime] StorageObject updateTime - * @property {string|null} [kmsKey] StorageObject kmsKey - * @property {google.protobuf.ITimestamp|null} [updateStorageClassTime] StorageObject updateStorageClassTime - * @property {boolean|null} [temporaryHold] StorageObject temporaryHold - * @property {google.protobuf.ITimestamp|null} [retentionExpireTime] StorageObject retentionExpireTime - * @property {Object.|null} [metadata] StorageObject metadata - * @property {google.storage.v2.IObjectContexts|null} [contexts] StorageObject contexts - * @property {boolean|null} [eventBasedHold] StorageObject eventBasedHold - * @property {google.storage.v2.IOwner|null} [owner] StorageObject owner - * @property {google.storage.v2.ICustomerEncryption|null} [customerEncryption] StorageObject customerEncryption - * @property {google.protobuf.ITimestamp|null} [customTime] StorageObject customTime - * @property {google.protobuf.ITimestamp|null} [softDeleteTime] StorageObject softDeleteTime - * @property {google.protobuf.ITimestamp|null} [hardDeleteTime] StorageObject hardDeleteTime - * @property {google.storage.v2.StorageObject.IRetention|null} [retention] StorageObject retention - */ - - /** - * Constructs a new StorageObject. + * @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.StorageObject.IRetention|null} [retention] Object retention + */ + + /** + * Constructs a new Object. * @memberof google.storage.v2 - * @classdesc Represents a StorageObject. - * @implements IStorageObject + * @classdesc Represents an Object. + * @implements IObject * @constructor * @param {google.storage.v2.IStorageObject=} [properties] Properties to set */ - function StorageObject(properties) { + function Object(properties) { this.acl = []; this.metadata = {}; if (properties) @@ -50827,324 +49163,320 @@ } /** - * StorageObject name. + * Object name. * @member {string} name * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.name = ""; + Object.prototype.name = ""; /** - * StorageObject bucket. + * Object bucket. * @member {string} bucket * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.bucket = ""; + Object.prototype.bucket = ""; /** - * StorageObject etag. + * Object etag. * @member {string} etag * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.etag = ""; + Object.prototype.etag = ""; /** - * StorageObject generation. + * Object generation. * @member {number|Long} generation * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Object.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * StorageObject restoreToken. + * Object restoreToken. * @member {string|null|undefined} restoreToken * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.restoreToken = null; + Object.prototype.restoreToken = null; /** - * StorageObject metageneration. + * Object metageneration. * @member {number|Long} metageneration * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.metageneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Object.prototype.metageneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * StorageObject storageClass. + * Object storageClass. * @member {string} storageClass * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.storageClass = ""; + Object.prototype.storageClass = ""; /** - * StorageObject size. + * Object size. * @member {number|Long} size * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Object.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * StorageObject contentEncoding. + * Object contentEncoding. * @member {string} contentEncoding * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.contentEncoding = ""; + Object.prototype.contentEncoding = ""; /** - * StorageObject contentDisposition. + * Object contentDisposition. * @member {string} contentDisposition * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.contentDisposition = ""; + Object.prototype.contentDisposition = ""; /** - * StorageObject cacheControl. + * Object cacheControl. * @member {string} cacheControl * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.cacheControl = ""; + Object.prototype.cacheControl = ""; /** - * StorageObject acl. + * Object acl. * @member {Array.} acl * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.acl = $util.emptyArray; + Object.prototype.acl = $util.emptyArray; /** - * StorageObject contentLanguage. + * Object contentLanguage. * @member {string} contentLanguage * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.contentLanguage = ""; + Object.prototype.contentLanguage = ""; /** - * StorageObject deleteTime. + * Object deleteTime. * @member {google.protobuf.ITimestamp|null|undefined} deleteTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.deleteTime = null; + Object.prototype.deleteTime = null; /** - * StorageObject finalizeTime. + * Object finalizeTime. * @member {google.protobuf.ITimestamp|null|undefined} finalizeTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.finalizeTime = null; + Object.prototype.finalizeTime = null; /** - * StorageObject contentType. + * Object contentType. * @member {string} contentType * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.contentType = ""; + Object.prototype.contentType = ""; /** - * StorageObject createTime. + * Object createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.createTime = null; + Object.prototype.createTime = null; /** - * StorageObject componentCount. + * Object componentCount. * @member {number} componentCount * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.componentCount = 0; + Object.prototype.componentCount = 0; /** - * StorageObject checksums. + * Object checksums. * @member {google.storage.v2.IObjectChecksums|null|undefined} checksums * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.checksums = null; + Object.prototype.checksums = null; /** - * StorageObject updateTime. + * Object updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.updateTime = null; + Object.prototype.updateTime = null; /** - * StorageObject kmsKey. + * Object kmsKey. * @member {string} kmsKey * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.kmsKey = ""; + Object.prototype.kmsKey = ""; /** - * StorageObject updateStorageClassTime. + * Object updateStorageClassTime. * @member {google.protobuf.ITimestamp|null|undefined} updateStorageClassTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.updateStorageClassTime = null; + Object.prototype.updateStorageClassTime = null; /** - * StorageObject temporaryHold. + * Object temporaryHold. * @member {boolean} temporaryHold * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.temporaryHold = false; + Object.prototype.temporaryHold = false; /** - * StorageObject retentionExpireTime. + * Object retentionExpireTime. * @member {google.protobuf.ITimestamp|null|undefined} retentionExpireTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.retentionExpireTime = null; + Object.prototype.retentionExpireTime = null; /** - * StorageObject metadata. + * Object metadata. * @member {Object.} metadata * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.metadata = $util.emptyObject; + Object.prototype.metadata = $util.emptyObject; /** - * StorageObject contexts. + * Object contexts. * @member {google.storage.v2.IObjectContexts|null|undefined} contexts * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.contexts = null; + Object.prototype.contexts = null; /** - * StorageObject eventBasedHold. + * Object eventBasedHold. * @member {boolean|null|undefined} eventBasedHold * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.eventBasedHold = null; + Object.prototype.eventBasedHold = null; /** - * StorageObject owner. + * Object owner. * @member {google.storage.v2.IOwner|null|undefined} owner * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.owner = null; + Object.prototype.owner = null; /** - * StorageObject customerEncryption. + * Object customerEncryption. * @member {google.storage.v2.ICustomerEncryption|null|undefined} customerEncryption * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.customerEncryption = null; + Object.prototype.customerEncryption = null; /** - * StorageObject customTime. + * Object customTime. * @member {google.protobuf.ITimestamp|null|undefined} customTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.customTime = null; + Object.prototype.customTime = null; /** - * StorageObject softDeleteTime. + * Object softDeleteTime. * @member {google.protobuf.ITimestamp|null|undefined} softDeleteTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.softDeleteTime = null; + Object.prototype.softDeleteTime = null; /** - * StorageObject hardDeleteTime. + * Object hardDeleteTime. * @member {google.protobuf.ITimestamp|null|undefined} hardDeleteTime * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.hardDeleteTime = null; + Object.prototype.hardDeleteTime = null; /** - * StorageObject retention. + * Object retention. * @member {google.storage.v2.StorageObject.IRetention|null|undefined} retention * @memberof google.storage.v2.StorageObject * @instance */ - StorageObject.prototype.retention = null; + Object.prototype.retention = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field - Object.defineProperty(StorageObject.prototype, "_restoreToken", { + Object.defineProperty(Object.prototype, "_restoreToken", { get: $util.oneOfGetter($oneOfFields = ["restoreToken"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field - Object.defineProperty(StorageObject.prototype, "_eventBasedHold", { + Object.defineProperty(Object.prototype, "_eventBasedHold", { get: $util.oneOfGetter($oneOfFields = ["eventBasedHold"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field - Object.defineProperty(StorageObject.prototype, "_softDeleteTime", { + Object.defineProperty(Object.prototype, "_softDeleteTime", { get: $util.oneOfGetter($oneOfFields = ["softDeleteTime"]), set: $util.oneOfSetter($oneOfFields) }); // Virtual OneOf for proto3 optional field - Object.defineProperty(StorageObject.prototype, "_hardDeleteTime", { + Object.defineProperty(Object.prototype, "_hardDeleteTime", { get: $util.oneOfGetter($oneOfFields = ["hardDeleteTime"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new StorageObject instance using the specified properties. + * Creates a new Object instance using the specified properties. * @function create * @memberof google.storage.v2.StorageObject * @static * @param {google.storage.v2.IStorageObject=} [properties] Properties to set - * @returns {google.storage.v2.StorageObject} StorageObject instance + * @returns {google.storage.v2.StorageObject} Object instance */ - StorageObject.create = function create(properties) { - return new StorageObject(properties); + Object.create = function create(properties) { + return new Object(properties); }; /** - * Encodes the specified StorageObject message. Does not implicitly {@link google.storage.v2.StorageObject.verify|verify} messages. + * Encodes the specified Object message. Does not implicitly {@link google.storage.v2.StorageObject.verify|verify} messages. * @function encode * @memberof google.storage.v2.StorageObject * @static - * @param {google.storage.v2.IStorageObject} message StorageObject message or plain object to encode + * @param {google.storage.v2.IStorageObject} message Object message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StorageObject.encode = function encode(message, writer, q) { + Object.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -51165,82 +49497,82 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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.StorageObject.Retention.encode(message.retention, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.storage.v2.ObjectContexts.encode(message.contexts, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); return writer; }; /** - * Encodes the specified StorageObject message, length delimited. Does not implicitly {@link google.storage.v2.StorageObject.verify|verify} messages. + * Encodes the specified Object message, length delimited. Does not implicitly {@link google.storage.v2.StorageObject.verify|verify} messages. * @function encodeDelimited * @memberof google.storage.v2.StorageObject * @static - * @param {google.storage.v2.IStorageObject} message StorageObject message or plain object to encode + * @param {google.storage.v2.IStorageObject} message Object message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StorageObject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + Object.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; /** - * Decodes a StorageObject message from the specified reader or buffer. + * Decodes an Object message from the specified reader or buffer. * @function decode * @memberof google.storage.v2.StorageObject * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storage.v2.StorageObject} StorageObject + * @returns {google.storage.v2.StorageObject} Object * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StorageObject.decode = function decode(reader, length, error, long) { + Object.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) @@ -51417,30 +49749,30 @@ }; /** - * Decodes a StorageObject message from the specified reader or buffer, length delimited. + * Decodes an Object message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.storage.v2.StorageObject * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storage.v2.StorageObject} StorageObject + * @returns {google.storage.v2.StorageObject} Object * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StorageObject.decodeDelimited = function decodeDelimited(reader) { + Object.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StorageObject message. + * Verifies an Object message. * @function verify * @memberof google.storage.v2.StorageObject * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StorageObject.verify = function verify(message, long) { + Object.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -51448,42 +49780,42 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + 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 && Object.hasOwnProperty.call(message, "restoreToken")) { + if (message.restoreToken != null && message.hasOwnProperty("restoreToken")) { properties._restoreToken = 1; if (!$util.isString(message.restoreToken)) return "restoreToken: string expected"; } - if (message.metageneration != null && Object.hasOwnProperty.call(message, "metageneration")) + 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 && Object.hasOwnProperty.call(message, "storageClass")) + if (message.storageClass != null && message.hasOwnProperty("storageClass")) if (!$util.isString(message.storageClass)) return "storageClass: string expected"; - if (message.size != null && Object.hasOwnProperty.call(message, "size")) + 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 && Object.hasOwnProperty.call(message, "contentEncoding")) + if (message.contentEncoding != null && message.hasOwnProperty("contentEncoding")) if (!$util.isString(message.contentEncoding)) return "contentEncoding: string expected"; - if (message.contentDisposition != null && Object.hasOwnProperty.call(message, "contentDisposition")) + if (message.contentDisposition != null && message.hasOwnProperty("contentDisposition")) if (!$util.isString(message.contentDisposition)) return "contentDisposition: string expected"; - if (message.cacheControl != null && Object.hasOwnProperty.call(message, "cacheControl")) + if (message.cacheControl != null && message.hasOwnProperty("cacheControl")) if (!$util.isString(message.cacheControl)) return "cacheControl: string expected"; - if (message.acl != null && Object.hasOwnProperty.call(message, "acl")) { + 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) { @@ -51492,57 +49824,57 @@ return "acl." + error; } } - if (message.contentLanguage != null && Object.hasOwnProperty.call(message, "contentLanguage")) + if (message.contentLanguage != null && message.hasOwnProperty("contentLanguage")) if (!$util.isString(message.contentLanguage)) return "contentLanguage: string expected"; - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) { + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { var error = $root.google.protobuf.Timestamp.verify(message.deleteTime, long + 1); if (error) return "deleteTime." + error; } - if (message.finalizeTime != null && Object.hasOwnProperty.call(message, "finalizeTime")) { + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { var error = $root.google.protobuf.Timestamp.verify(message.finalizeTime, long + 1); if (error) return "finalizeTime." + error; } - if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + if (message.contentType != null && message.hasOwnProperty("contentType")) if (!$util.isString(message.contentType)) return "contentType: string expected"; - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.componentCount != null && Object.hasOwnProperty.call(message, "componentCount")) + if (message.componentCount != null && message.hasOwnProperty("componentCount")) if (!$util.isInteger(message.componentCount)) return "componentCount: integer expected"; - if (message.checksums != null && Object.hasOwnProperty.call(message, "checksums")) { + if (message.checksums != null && message.hasOwnProperty("checksums")) { var error = $root.google.storage.v2.ObjectChecksums.verify(message.checksums, long + 1); if (error) return "checksums." + error; } - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) if (!$util.isString(message.kmsKey)) return "kmsKey: string expected"; - if (message.updateStorageClassTime != null && Object.hasOwnProperty.call(message, "updateStorageClassTime")) { + if (message.updateStorageClassTime != null && message.hasOwnProperty("updateStorageClassTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateStorageClassTime, long + 1); if (error) return "updateStorageClassTime." + error; } - if (message.temporaryHold != null && Object.hasOwnProperty.call(message, "temporaryHold")) + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) if (typeof message.temporaryHold !== "boolean") return "temporaryHold: boolean expected"; - if (message.retentionExpireTime != null && Object.hasOwnProperty.call(message, "retentionExpireTime")) { + if (message.retentionExpireTime != null && message.hasOwnProperty("retentionExpireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.retentionExpireTime, long + 1); if (error) return "retentionExpireTime." + error; } - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { + if (message.metadata != null && message.hasOwnProperty("metadata")) { if (!$util.isObject(message.metadata)) return "metadata: object expected"; var key = Object.keys(message.metadata); @@ -51550,32 +49882,32 @@ if (!$util.isString(message.metadata[key[i]])) return "metadata: string{k:string} expected"; } - if (message.contexts != null && Object.hasOwnProperty.call(message, "contexts")) { + if (message.contexts != null && message.hasOwnProperty("contexts")) { var error = $root.google.storage.v2.ObjectContexts.verify(message.contexts, long + 1); if (error) return "contexts." + error; } - if (message.eventBasedHold != null && Object.hasOwnProperty.call(message, "eventBasedHold")) { + if (message.eventBasedHold != null && message.hasOwnProperty("eventBasedHold")) { properties._eventBasedHold = 1; if (typeof message.eventBasedHold !== "boolean") return "eventBasedHold: boolean expected"; } - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) { + if (message.owner != null && message.hasOwnProperty("owner")) { var error = $root.google.storage.v2.Owner.verify(message.owner, long + 1); if (error) return "owner." + error; } - if (message.customerEncryption != null && Object.hasOwnProperty.call(message, "customerEncryption")) { + if (message.customerEncryption != null && message.hasOwnProperty("customerEncryption")) { var error = $root.google.storage.v2.CustomerEncryption.verify(message.customerEncryption, long + 1); if (error) return "customerEncryption." + error; } - if (message.customTime != null && Object.hasOwnProperty.call(message, "customTime")) { + if (message.customTime != null && message.hasOwnProperty("customTime")) { var error = $root.google.protobuf.Timestamp.verify(message.customTime, long + 1); if (error) return "customTime." + error; } - if (message.softDeleteTime != null && Object.hasOwnProperty.call(message, "softDeleteTime")) { + if (message.softDeleteTime != null && message.hasOwnProperty("softDeleteTime")) { properties._softDeleteTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.softDeleteTime, long + 1); @@ -51583,7 +49915,7 @@ return "softDeleteTime." + error; } } - if (message.hardDeleteTime != null && Object.hasOwnProperty.call(message, "hardDeleteTime")) { + if (message.hardDeleteTime != null && message.hasOwnProperty("hardDeleteTime")) { properties._hardDeleteTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.hardDeleteTime, long + 1); @@ -51591,7 +49923,7 @@ return "hardDeleteTime." + error; } } - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) { + if (message.retention != null && message.hasOwnProperty("retention")) { var error = $root.google.storage.v2.StorageObject.Retention.verify(message.retention, long + 1); if (error) return "retention." + error; @@ -51600,18 +49932,16 @@ }; /** - * Creates a StorageObject message from a plain object. Also converts values to their respective internal types. + * Creates an Object message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.storage.v2.StorageObject * @static * @param {Object.} object Plain object - * @returns {google.storage.v2.StorageObject} StorageObject + * @returns {google.storage.v2.StorageObject} Object */ - StorageObject.fromObject = function fromObject(object, long) { + Object.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.StorageObject) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.StorageObject: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -51625,7 +49955,7 @@ message.etag = String(object.etag); if (object.generation != null) if ($util.Long) - message.generation = $util.Long.fromValue(object.generation, false); + (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") @@ -51636,7 +49966,7 @@ message.restoreToken = String(object.restoreToken); if (object.metageneration != null) if ($util.Long) - message.metageneration = $util.Long.fromValue(object.metageneration, false); + (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") @@ -51647,7 +49977,7 @@ message.storageClass = String(object.storageClass); if (object.size != null) if ($util.Long) - message.size = $util.Long.fromValue(object.size, false); + (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") @@ -51665,7 +49995,7 @@ throw TypeError(".google.storage.v2.StorageObject.acl: array expected"); message.acl = []; for (var i = 0; i < object.acl.length; ++i) { - if (!$util.isObject(object.acl[i])) + if (typeof object.acl[i] !== "object") throw TypeError(".google.storage.v2.StorageObject.acl: object expected"); message.acl[i] = $root.google.storage.v2.ObjectAccessControl.fromObject(object.acl[i], long + 1); } @@ -51673,50 +50003,50 @@ if (object.contentLanguage != null) message.contentLanguage = String(object.contentLanguage); if (object.deleteTime != null) { - if (!$util.isObject(object.deleteTime)) + if (typeof object.deleteTime !== "object") throw TypeError(".google.storage.v2.StorageObject.deleteTime: object expected"); message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime, long + 1); } if (object.finalizeTime != null) { - if (!$util.isObject(object.finalizeTime)) + if (typeof object.finalizeTime !== "object") throw TypeError(".google.storage.v2.StorageObject.finalizeTime: object expected"); message.finalizeTime = $root.google.protobuf.Timestamp.fromObject(object.finalizeTime, long + 1); } if (object.contentType != null) message.contentType = String(object.contentType); if (object.createTime != null) { - if (!$util.isObject(object.createTime)) + if (typeof object.createTime !== "object") throw TypeError(".google.storage.v2.StorageObject.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.componentCount != null) message.componentCount = object.componentCount | 0; if (object.checksums != null) { - if (!$util.isObject(object.checksums)) + if (typeof object.checksums !== "object") throw TypeError(".google.storage.v2.StorageObject.checksums: object expected"); message.checksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.checksums, long + 1); } if (object.updateTime != null) { - if (!$util.isObject(object.updateTime)) + if (typeof object.updateTime !== "object") throw TypeError(".google.storage.v2.StorageObject.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } if (object.kmsKey != null) message.kmsKey = String(object.kmsKey); if (object.updateStorageClassTime != null) { - if (!$util.isObject(object.updateStorageClassTime)) + if (typeof object.updateStorageClassTime !== "object") throw TypeError(".google.storage.v2.StorageObject.updateStorageClassTime: object expected"); message.updateStorageClassTime = $root.google.protobuf.Timestamp.fromObject(object.updateStorageClassTime, long + 1); } if (object.temporaryHold != null) message.temporaryHold = Boolean(object.temporaryHold); if (object.retentionExpireTime != null) { - if (!$util.isObject(object.retentionExpireTime)) + if (typeof object.retentionExpireTime !== "object") throw TypeError(".google.storage.v2.StorageObject.retentionExpireTime: object expected"); message.retentionExpireTime = $root.google.protobuf.Timestamp.fromObject(object.retentionExpireTime, long + 1); } if (object.metadata) { - if (!$util.isObject(object.metadata)) + if (typeof object.metadata !== "object") throw TypeError(".google.storage.v2.StorageObject.metadata: object expected"); message.metadata = {}; for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { @@ -51726,39 +50056,39 @@ } } if (object.contexts != null) { - if (!$util.isObject(object.contexts)) + if (typeof object.contexts !== "object") throw TypeError(".google.storage.v2.StorageObject.contexts: object expected"); message.contexts = $root.google.storage.v2.ObjectContexts.fromObject(object.contexts, long + 1); } if (object.eventBasedHold != null) message.eventBasedHold = Boolean(object.eventBasedHold); if (object.owner != null) { - if (!$util.isObject(object.owner)) + if (typeof object.owner !== "object") throw TypeError(".google.storage.v2.StorageObject.owner: object expected"); message.owner = $root.google.storage.v2.Owner.fromObject(object.owner, long + 1); } if (object.customerEncryption != null) { - if (!$util.isObject(object.customerEncryption)) + if (typeof object.customerEncryption !== "object") throw TypeError(".google.storage.v2.StorageObject.customerEncryption: object expected"); message.customerEncryption = $root.google.storage.v2.CustomerEncryption.fromObject(object.customerEncryption, long + 1); } if (object.customTime != null) { - if (!$util.isObject(object.customTime)) + if (typeof object.customTime !== "object") throw TypeError(".google.storage.v2.StorageObject.customTime: object expected"); message.customTime = $root.google.protobuf.Timestamp.fromObject(object.customTime, long + 1); } if (object.softDeleteTime != null) { - if (!$util.isObject(object.softDeleteTime)) + if (typeof object.softDeleteTime !== "object") throw TypeError(".google.storage.v2.StorageObject.softDeleteTime: object expected"); message.softDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.softDeleteTime, long + 1); } if (object.hardDeleteTime != null) { - if (!$util.isObject(object.hardDeleteTime)) + if (typeof object.hardDeleteTime !== "object") throw TypeError(".google.storage.v2.StorageObject.hardDeleteTime: object expected"); message.hardDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.hardDeleteTime, long + 1); } if (object.retention != null) { - if (!$util.isObject(object.retention)) + if (typeof object.retention !== "object") throw TypeError(".google.storage.v2.StorageObject.retention: object expected"); message.retention = $root.google.storage.v2.StorageObject.Retention.fromObject(object.retention, long + 1); } @@ -51766,21 +50096,17 @@ }; /** - * Creates a plain object from a StorageObject message. Also converts values to other types if specified. + * Creates a plain object from an Object message. Also converts values to other types if specified. * @function toObject * @memberof google.storage.v2.StorageObject * @static - * @param {google.storage.v2.StorageObject} message StorageObject + * @param {google.storage.v2.StorageObject} message Object * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StorageObject.toObject = function toObject(message, options, q) { + Object.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.acl = []; @@ -51791,20 +50117,20 @@ 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.generation = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.metageneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.metageneration = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.size = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.size = options.longs === String ? "0" : 0; object.contentEncoding = ""; object.contentDisposition = ""; object.cacheControl = ""; @@ -51827,66 +50153,60 @@ object.finalizeTime = null; object.contexts = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = message.bucket; - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.generation = typeof message.generation === "number" ? BigInt(message.generation) : $util.Long.fromBits(message.generation.low >>> 0, message.generation.high >>> 0, false).toBigInt(); - else if (typeof message.generation === "number") + 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 && Object.hasOwnProperty.call(message, "metageneration")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.metageneration = typeof message.metageneration === "number" ? BigInt(message.metageneration) : $util.Long.fromBits(message.metageneration.low >>> 0, message.metageneration.high >>> 0, false).toBigInt(); - else if (typeof message.metageneration === "number") + 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 && Object.hasOwnProperty.call(message, "storageClass")) + if (message.storageClass != null && message.hasOwnProperty("storageClass")) object.storageClass = message.storageClass; - if (message.size != null && Object.hasOwnProperty.call(message, "size")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.size = typeof message.size === "number" ? BigInt(message.size) : $util.Long.fromBits(message.size.low >>> 0, message.size.high >>> 0, false).toBigInt(); - else if (typeof message.size === "number") + 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 && Object.hasOwnProperty.call(message, "contentEncoding")) + if (message.contentEncoding != null && message.hasOwnProperty("contentEncoding")) object.contentEncoding = message.contentEncoding; - if (message.contentDisposition != null && Object.hasOwnProperty.call(message, "contentDisposition")) + if (message.contentDisposition != null && message.hasOwnProperty("contentDisposition")) object.contentDisposition = message.contentDisposition; - if (message.cacheControl != null && Object.hasOwnProperty.call(message, "cacheControl")) + 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, q + 1); + object.acl[j] = $root.google.storage.v2.ObjectAccessControl.toObject(message.acl[j], options); } - if (message.contentLanguage != null && Object.hasOwnProperty.call(message, "contentLanguage")) + if (message.contentLanguage != null && message.hasOwnProperty("contentLanguage")) object.contentLanguage = message.contentLanguage; - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options, q + 1); - if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + 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 && Object.hasOwnProperty.call(message, "createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); - if (message.componentCount != null && Object.hasOwnProperty.call(message, "componentCount")) + 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 && Object.hasOwnProperty.call(message, "checksums")) - object.checksums = $root.google.storage.v2.ObjectChecksums.toObject(message.checksums, options, q + 1); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); - if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + 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 && Object.hasOwnProperty.call(message, "updateStorageClassTime")) - object.updateStorageClassTime = $root.google.protobuf.Timestamp.toObject(message.updateStorageClassTime, options, q + 1); - if (message.temporaryHold != null && Object.hasOwnProperty.call(message, "temporaryHold")) + 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 && Object.hasOwnProperty.call(message, "retentionExpireTime")) - object.retentionExpireTime = $root.google.protobuf.Timestamp.toObject(message.retentionExpireTime, options, q + 1); + 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 = {}; @@ -51896,70 +50216,70 @@ object.metadata[keys2[j]] = message.metadata[keys2[j]]; } } - if (message.eventBasedHold != null && Object.hasOwnProperty.call(message, "eventBasedHold")) { + if (message.eventBasedHold != null && message.hasOwnProperty("eventBasedHold")) { object.eventBasedHold = message.eventBasedHold; if (options.oneofs) object._eventBasedHold = "eventBasedHold"; } - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - object.owner = $root.google.storage.v2.Owner.toObject(message.owner, options, q + 1); - if (message.customerEncryption != null && Object.hasOwnProperty.call(message, "customerEncryption")) - object.customerEncryption = $root.google.storage.v2.CustomerEncryption.toObject(message.customerEncryption, options, q + 1); - if (message.customTime != null && Object.hasOwnProperty.call(message, "customTime")) - object.customTime = $root.google.protobuf.Timestamp.toObject(message.customTime, options, q + 1); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + 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 && Object.hasOwnProperty.call(message, "softDeleteTime")) { - object.softDeleteTime = $root.google.protobuf.Timestamp.toObject(message.softDeleteTime, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "hardDeleteTime")) { - object.hardDeleteTime = $root.google.protobuf.Timestamp.toObject(message.hardDeleteTime, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "retention")) - object.retention = $root.google.storage.v2.StorageObject.Retention.toObject(message.retention, options, q + 1); - if (message.restoreToken != null && Object.hasOwnProperty.call(message, "restoreToken")) { + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = $root.google.storage.v2.StorageObject.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 && Object.hasOwnProperty.call(message, "finalizeTime")) - object.finalizeTime = $root.google.protobuf.Timestamp.toObject(message.finalizeTime, options, q + 1); - if (message.contexts != null && Object.hasOwnProperty.call(message, "contexts")) - object.contexts = $root.google.storage.v2.ObjectContexts.toObject(message.contexts, options, q + 1); + 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 StorageObject to JSON. + * Converts this Object to JSON. * @function toJSON * @memberof google.storage.v2.StorageObject * @instance * @returns {Object.} JSON object */ - StorageObject.prototype.toJSON = function toJSON() { + Object.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StorageObject + * Gets the default type url for Object * @function getTypeUrl * @memberof google.storage.v2.StorageObject * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StorageObject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Object.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/google.storage.v2.StorageObject"; }; - StorageObject.Retention = (function() { + Object.Retention = (function() { /** * Properties of a Retention. @@ -52021,17 +50341,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Retention.encode = function encode(message, writer, q) { + Retention.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.retainUntilTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -52045,7 +50361,7 @@ * @returns {$protobuf.Writer} Writer */ Retention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -52119,7 +50435,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + if (message.mode != null && message.hasOwnProperty("mode")) switch (message.mode) { default: return "mode: enum value expected"; @@ -52128,7 +50444,7 @@ case 2: break; } - if (message.retainUntilTime != null && Object.hasOwnProperty.call(message, "retainUntilTime")) { + if (message.retainUntilTime != null && message.hasOwnProperty("retainUntilTime")) { var error = $root.google.protobuf.Timestamp.verify(message.retainUntilTime, long + 1); if (error) return "retainUntilTime." + error; @@ -52147,8 +50463,6 @@ Retention.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.StorageObject.Retention) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.StorageObject.Retention: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52175,7 +50489,7 @@ break; } if (object.retainUntilTime != null) { - if (!$util.isObject(object.retainUntilTime)) + if (typeof object.retainUntilTime !== "object") throw TypeError(".google.storage.v2.StorageObject.Retention.retainUntilTime: object expected"); message.retainUntilTime = $root.google.protobuf.Timestamp.fromObject(object.retainUntilTime, long + 1); } @@ -52191,22 +50505,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Retention.toObject = function toObject(message, options, q) { + Retention.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; object.retainUntilTime = null; } - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + if (message.mode != null && message.hasOwnProperty("mode")) object.mode = options.enums === String ? $root.google.storage.v2.StorageObject.Retention.Mode[message.mode] === undefined ? message.mode : $root.google.storage.v2.StorageObject.Retention.Mode[message.mode] : message.mode; - if (message.retainUntilTime != null && Object.hasOwnProperty.call(message, "retainUntilTime")) - object.retainUntilTime = $root.google.protobuf.Timestamp.toObject(message.retainUntilTime, options, q + 1); + if (message.retainUntilTime != null && message.hasOwnProperty("retainUntilTime")) + object.retainUntilTime = $root.google.protobuf.Timestamp.toObject(message.retainUntilTime, options); return object; }; @@ -52255,7 +50565,7 @@ return Retention; })(); - return StorageObject; + return Object; })(); v2.ObjectAccessControl = (function() { @@ -52383,13 +50693,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectAccessControl.encode = function encode(message, writer, q) { + ObjectAccessControl.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -52403,7 +50709,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -52421,7 +50727,7 @@ * @returns {$protobuf.Writer} Writer */ ObjectAccessControl.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -52523,31 +50829,31 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) if (!$util.isString(message.role)) return "role: string expected"; - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) if (!$util.isString(message.id)) return "id: string expected"; - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + if (message.entity != null && message.hasOwnProperty("entity")) if (!$util.isString(message.entity)) return "entity: string expected"; - if (message.entityAlt != null && Object.hasOwnProperty.call(message, "entityAlt")) + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) if (!$util.isString(message.entityAlt)) return "entityAlt: string expected"; - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + if (message.entityId != null && message.hasOwnProperty("entityId")) if (!$util.isString(message.entityId)) return "entityId: string expected"; - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; - if (message.email != null && Object.hasOwnProperty.call(message, "email")) + if (message.email != null && message.hasOwnProperty("email")) if (!$util.isString(message.email)) return "email: string expected"; - if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + if (message.domain != null && message.hasOwnProperty("domain")) if (!$util.isString(message.domain)) return "domain: string expected"; - if (message.projectTeam != null && Object.hasOwnProperty.call(message, "projectTeam")) { + if (message.projectTeam != null && message.hasOwnProperty("projectTeam")) { var error = $root.google.storage.v2.ProjectTeam.verify(message.projectTeam, long + 1); if (error) return "projectTeam." + error; @@ -52566,8 +50872,6 @@ ObjectAccessControl.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ObjectAccessControl) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ObjectAccessControl: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52590,7 +50894,7 @@ if (object.domain != null) message.domain = String(object.domain); if (object.projectTeam != null) { - if (!$util.isObject(object.projectTeam)) + if (typeof object.projectTeam !== "object") throw TypeError(".google.storage.v2.ObjectAccessControl.projectTeam: object expected"); message.projectTeam = $root.google.storage.v2.ProjectTeam.fromObject(object.projectTeam, long + 1); } @@ -52606,13 +50910,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectAccessControl.toObject = function toObject(message, options, q) { + ObjectAccessControl.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.role = ""; @@ -52625,23 +50925,23 @@ object.etag = ""; object.entityAlt = ""; } - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + if (message.entity != null && message.hasOwnProperty("entity")) object.entity = message.entity; - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + if (message.entityId != null && message.hasOwnProperty("entityId")) object.entityId = message.entityId; - if (message.email != null && Object.hasOwnProperty.call(message, "email")) + if (message.email != null && message.hasOwnProperty("email")) object.email = message.email; - if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + if (message.domain != null && message.hasOwnProperty("domain")) object.domain = message.domain; - if (message.projectTeam != null && Object.hasOwnProperty.call(message, "projectTeam")) - object.projectTeam = $root.google.storage.v2.ProjectTeam.toObject(message.projectTeam, options, q + 1); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + 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 && Object.hasOwnProperty.call(message, "entityAlt")) + if (message.entityAlt != null && message.hasOwnProperty("entityAlt")) object.entityAlt = message.entityAlt; return object; }; @@ -52748,16 +51048,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListObjectsResponse.encode = function encode(message, writer, q) { + ListObjectsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.objects != null && message.objects.length) for (var i = 0; i < message.objects.length; ++i) - $root.google.storage.v2.StorageObject.encode(message.objects[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.storage.v2.StorageObject.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]); @@ -52776,7 +51072,7 @@ * @returns {$protobuf.Writer} Writer */ ListObjectsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -52858,7 +51154,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.objects != null && Object.hasOwnProperty.call(message, "objects")) { + 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) { @@ -52867,14 +51163,14 @@ return "objects." + error; } } - if (message.prefixes != null && Object.hasOwnProperty.call(message, "prefixes")) { + 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 && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -52891,8 +51187,6 @@ ListObjectsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ListObjectsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ListObjectsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52903,7 +51197,7 @@ throw TypeError(".google.storage.v2.ListObjectsResponse.objects: array expected"); message.objects = []; for (var i = 0; i < object.objects.length; ++i) { - if (!$util.isObject(object.objects[i])) + if (typeof object.objects[i] !== "object") throw TypeError(".google.storage.v2.ListObjectsResponse.objects: object expected"); message.objects[i] = $root.google.storage.v2.StorageObject.fromObject(object.objects[i], long + 1); } @@ -52929,13 +51223,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListObjectsResponse.toObject = function toObject(message, options, q) { + ListObjectsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.objects = []; @@ -52946,14 +51236,14 @@ if (message.objects && message.objects.length) { object.objects = []; for (var j = 0; j < message.objects.length; ++j) - object.objects[j] = $root.google.storage.v2.StorageObject.toObject(message.objects[j], options, q + 1); + object.objects[j] = $root.google.storage.v2.StorageObject.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 && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -53049,13 +51339,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProjectTeam.encode = function encode(message, writer, q) { + ProjectTeam.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -53073,7 +51359,7 @@ * @returns {$protobuf.Writer} Writer */ ProjectTeam.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -53147,10 +51433,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectNumber != null && Object.hasOwnProperty.call(message, "projectNumber")) + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) if (!$util.isString(message.projectNumber)) return "projectNumber: string expected"; - if (message.team != null && Object.hasOwnProperty.call(message, "team")) + if (message.team != null && message.hasOwnProperty("team")) if (!$util.isString(message.team)) return "team: string expected"; return null; @@ -53167,8 +51453,6 @@ ProjectTeam.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ProjectTeam) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ProjectTeam: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53190,21 +51474,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProjectTeam.toObject = function toObject(message, options, q) { + ProjectTeam.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectNumber = ""; object.team = ""; } - if (message.projectNumber != null && Object.hasOwnProperty.call(message, "projectNumber")) + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) object.projectNumber = message.projectNumber; - if (message.team != null && Object.hasOwnProperty.call(message, "team")) + if (message.team != null && message.hasOwnProperty("team")) object.team = message.team; return object; }; @@ -53300,13 +51580,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Owner.encode = function encode(message, writer, q) { + Owner.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -53324,7 +51600,7 @@ * @returns {$protobuf.Writer} Writer */ Owner.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -53398,10 +51674,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + if (message.entity != null && message.hasOwnProperty("entity")) if (!$util.isString(message.entity)) return "entity: string expected"; - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + if (message.entityId != null && message.hasOwnProperty("entityId")) if (!$util.isString(message.entityId)) return "entityId: string expected"; return null; @@ -53418,8 +51694,6 @@ Owner.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.Owner) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.Owner: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53441,21 +51715,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Owner.toObject = function toObject(message, options, q) { + Owner.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.entity = ""; object.entityId = ""; } - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + if (message.entity != null && message.hasOwnProperty("entity")) object.entity = message.entity; - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + if (message.entityId != null && message.hasOwnProperty("entityId")) object.entityId = message.entityId; return object; }; @@ -53560,13 +51830,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContentRange.encode = function encode(message, writer, q) { + ContentRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -53586,7 +51852,7 @@ * @returns {$protobuf.Writer} Writer */ ContentRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -53664,13 +51930,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + 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 && Object.hasOwnProperty.call(message, "end")) + 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 && Object.hasOwnProperty.call(message, "completeLength")) + 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; @@ -53687,8 +51953,6 @@ ContentRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.storage.v2.ContentRange) return object; - if (!$util.isObject(object)) - throw TypeError(".google.storage.v2.ContentRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53696,7 +51960,7 @@ var message = new $root.google.storage.v2.ContentRange(); if (object.start != null) if ($util.Long) - message.start = $util.Long.fromValue(object.start, false); + (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") @@ -53705,7 +51969,7 @@ 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, false); + (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") @@ -53714,7 +51978,7 @@ 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, false); + (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") @@ -53733,49 +51997,39 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContentRange.toObject = function toObject(message, options, q) { + ContentRange.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.start = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.start = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.end = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.completeLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.completeLength = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.completeLength = options.longs === String ? "0" : 0; } - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.start = typeof message.start === "number" ? BigInt(message.start) : $util.Long.fromBits(message.start.low >>> 0, message.start.high >>> 0, false).toBigInt(); - else if (typeof message.start === "number") + 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 && Object.hasOwnProperty.call(message, "end")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.end = typeof message.end === "number" ? BigInt(message.end) : $util.Long.fromBits(message.end.low >>> 0, message.end.high >>> 0, false).toBigInt(); - else if (typeof message.end === "number") + 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 && Object.hasOwnProperty.call(message, "completeLength")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.completeLength = typeof message.completeLength === "number" ? BigInt(message.completeLength) : $util.Long.fromBits(message.completeLength.low >>> 0, message.completeLength.high >>> 0, false).toBigInt(); - else if (typeof message.completeLength === "number") + 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; @@ -53889,16 +52143,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer, q) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -53914,7 +52164,7 @@ * @returns {$protobuf.Writer} Writer */ Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -53990,7 +52240,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rules != null && Object.hasOwnProperty.call(message, "rules")) { + 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) { @@ -53999,7 +52249,7 @@ return "rules." + error; } } - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) if (typeof message.fullyDecodeReservedExpansion !== "boolean") return "fullyDecodeReservedExpansion: boolean expected"; return null; @@ -54016,8 +52266,6 @@ Http.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.Http) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.Http: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54028,7 +52276,7 @@ throw TypeError(".google.api.Http.rules: array expected"); message.rules = []; for (var i = 0; i < object.rules.length; ++i) { - if (!$util.isObject(object.rules[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], long + 1); } @@ -54047,13 +52295,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options, q) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.rules = []; @@ -54062,9 +52306,9 @@ 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, q + 1); + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; @@ -54247,13 +52491,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer, q) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -54269,10 +52509,10 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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; @@ -54288,7 +52528,7 @@ * @returns {$protobuf.Writer} Writer */ HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -54397,43 +52637,43 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (message.selector != null && message.hasOwnProperty("selector")) if (!$util.isString(message.selector)) return "selector: string expected"; - if (message.get != null && Object.hasOwnProperty.call(message, "get")) { + if (message.get != null && message.hasOwnProperty("get")) { properties.pattern = 1; if (!$util.isString(message.get)) return "get: string expected"; } - if (message.put != null && Object.hasOwnProperty.call(message, "put")) { + 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 && Object.hasOwnProperty.call(message, "post")) { + 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 && Object.hasOwnProperty.call(message, "delete")) { + 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 && Object.hasOwnProperty.call(message, "patch")) { + 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 && Object.hasOwnProperty.call(message, "custom")) { + if (message.custom != null && message.hasOwnProperty("custom")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; @@ -54443,13 +52683,13 @@ return "custom." + error; } } - if (message.body != null && Object.hasOwnProperty.call(message, "body")) + if (message.body != null && message.hasOwnProperty("body")) if (!$util.isString(message.body)) return "body: string expected"; - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + if (message.responseBody != null && message.hasOwnProperty("responseBody")) if (!$util.isString(message.responseBody)) return "responseBody: string expected"; - if (message.additionalBindings != null && Object.hasOwnProperty.call(message, "additionalBindings")) { + 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) { @@ -54472,8 +52712,6 @@ HttpRule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.HttpRule) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.HttpRule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54492,7 +52730,7 @@ if (object.patch != null) message.patch = String(object.patch); if (object.custom != null) { - if (!$util.isObject(object.custom)) + if (typeof object.custom !== "object") throw TypeError(".google.api.HttpRule.custom: object expected"); message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom, long + 1); } @@ -54505,7 +52743,7 @@ throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); message.additionalBindings = []; for (var i = 0; i < object.additionalBindings.length; ++i) { - if (!$util.isObject(object.additionalBindings[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], long + 1); } @@ -54522,13 +52760,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options, q) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.additionalBindings = []; @@ -54537,46 +52771,46 @@ object.body = ""; object.responseBody = ""; } - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (message.selector != null && message.hasOwnProperty("selector")) object.selector = message.selector; - if (message.get != null && Object.hasOwnProperty.call(message, "get")) { + if (message.get != null && message.hasOwnProperty("get")) { object.get = message.get; if (options.oneofs) object.pattern = "get"; } - if (message.put != null && Object.hasOwnProperty.call(message, "put")) { + if (message.put != null && message.hasOwnProperty("put")) { object.put = message.put; if (options.oneofs) object.pattern = "put"; } - if (message.post != null && Object.hasOwnProperty.call(message, "post")) { + if (message.post != null && message.hasOwnProperty("post")) { object.post = message.post; if (options.oneofs) object.pattern = "post"; } - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { + if (message["delete"] != null && message.hasOwnProperty("delete")) { object["delete"] = message["delete"]; if (options.oneofs) object.pattern = "delete"; } - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) { + if (message.patch != null && message.hasOwnProperty("patch")) { object.patch = message.patch; if (options.oneofs) object.pattern = "patch"; } - if (message.body != null && Object.hasOwnProperty.call(message, "body")) + if (message.body != null && message.hasOwnProperty("body")) object.body = message.body; - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options, q + 1); + 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, q + 1); + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + if (message.responseBody != null && message.hasOwnProperty("responseBody")) object.responseBody = message.responseBody; return object; }; @@ -54672,13 +52906,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer, q) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -54696,7 +52926,7 @@ * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -54770,10 +53000,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (message.kind != null && message.hasOwnProperty("kind")) if (!$util.isString(message.kind)) return "kind: string expected"; - if (message.path != null && Object.hasOwnProperty.call(message, "path")) + if (message.path != null && message.hasOwnProperty("path")) if (!$util.isString(message.path)) return "path: string expected"; return null; @@ -54790,8 +53020,6 @@ CustomHttpPattern.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.CustomHttpPattern) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.CustomHttpPattern: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54813,21 +53041,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options, q) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.kind = ""; object.path = ""; } - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; - if (message.path != null && Object.hasOwnProperty.call(message, "path")) + if (message.path != null && message.hasOwnProperty("path")) object.path = message.path; return object; }; @@ -54933,13 +53157,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommonLanguageSettings.encode = function encode(message, writer, q) { + CommonLanguageSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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) { @@ -54949,7 +53169,7 @@ writer.ldelim(); } if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) - $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -54963,7 +53183,7 @@ * @returns {$protobuf.Writer} Writer */ CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -55048,10 +53268,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) if (!$util.isString(message.referenceDocsUri)) return "referenceDocsUri: string expected"; - if (message.destinations != null && Object.hasOwnProperty.call(message, "destinations")) { + 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) @@ -55064,7 +53284,7 @@ break; } } - if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) { + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration, long + 1); if (error) return "selectiveGapicGeneration." + error; @@ -55083,8 +53303,6 @@ CommonLanguageSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.CommonLanguageSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.CommonLanguageSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -55118,7 +53336,7 @@ } } if (object.selectiveGapicGeneration != null) { - if (!$util.isObject(object.selectiveGapicGeneration)) + if (typeof object.selectiveGapicGeneration !== "object") throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration, long + 1); } @@ -55134,13 +53352,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommonLanguageSettings.toObject = function toObject(message, options, q) { + CommonLanguageSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.destinations = []; @@ -55148,15 +53362,15 @@ object.referenceDocsUri = ""; object.selectiveGapicGeneration = null; } - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "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]; } - if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) - object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options, q + 1); + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); return object; }; @@ -55332,13 +53546,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientLibrarySettings.encode = function encode(message, writer, q) { + ClientLibrarySettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -55346,21 +53556,21 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); return writer; }; @@ -55374,7 +53584,7 @@ * @returns {$protobuf.Writer} Writer */ ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -55484,10 +53694,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.version != null && Object.hasOwnProperty.call(message, "version")) + if (message.version != null && message.hasOwnProperty("version")) if (!$util.isString(message.version)) return "version: string expected"; - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + if (message.launchStage != null && message.hasOwnProperty("launchStage")) switch (message.launchStage) { default: return "launchStage: enum value expected"; @@ -55501,45 +53711,45 @@ case 5: break; } - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) if (typeof message.restNumericEnums !== "boolean") return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) { + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { var error = $root.google.api.JavaSettings.verify(message.javaSettings, long + 1); if (error) return "javaSettings." + error; } - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) { + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { var error = $root.google.api.CppSettings.verify(message.cppSettings, long + 1); if (error) return "cppSettings." + error; } - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) { + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { var error = $root.google.api.PhpSettings.verify(message.phpSettings, long + 1); if (error) return "phpSettings." + error; } - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) { + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { var error = $root.google.api.PythonSettings.verify(message.pythonSettings, long + 1); if (error) return "pythonSettings." + error; } - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) { + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { var error = $root.google.api.NodeSettings.verify(message.nodeSettings, long + 1); if (error) return "nodeSettings." + error; } - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) { + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings, long + 1); if (error) return "dotnetSettings." + error; } - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) { + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { var error = $root.google.api.RubySettings.verify(message.rubySettings, long + 1); if (error) return "rubySettings." + error; } - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) { + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { var error = $root.google.api.GoSettings.verify(message.goSettings, long + 1); if (error) return "goSettings." + error; @@ -55558,8 +53768,6 @@ ClientLibrarySettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.ClientLibrarySettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.ClientLibrarySettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -55610,42 +53818,42 @@ if (object.restNumericEnums != null) message.restNumericEnums = Boolean(object.restNumericEnums); if (object.javaSettings != null) { - if (!$util.isObject(object.javaSettings)) + if (typeof object.javaSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings, long + 1); } if (object.cppSettings != null) { - if (!$util.isObject(object.cppSettings)) + if (typeof object.cppSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings, long + 1); } if (object.phpSettings != null) { - if (!$util.isObject(object.phpSettings)) + if (typeof object.phpSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings, long + 1); } if (object.pythonSettings != null) { - if (!$util.isObject(object.pythonSettings)) + if (typeof object.pythonSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings, long + 1); } if (object.nodeSettings != null) { - if (!$util.isObject(object.nodeSettings)) + if (typeof object.nodeSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings, long + 1); } if (object.dotnetSettings != null) { - if (!$util.isObject(object.dotnetSettings)) + if (typeof object.dotnetSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings, long + 1); } if (object.rubySettings != null) { - if (!$util.isObject(object.rubySettings)) + if (typeof object.rubySettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings, long + 1); } if (object.goSettings != null) { - if (!$util.isObject(object.goSettings)) + if (typeof object.goSettings !== "object") throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings, long + 1); } @@ -55661,13 +53869,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientLibrarySettings.toObject = function toObject(message, options, q) { + ClientLibrarySettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.version = ""; @@ -55682,28 +53886,28 @@ object.rubySettings = null; object.goSettings = null; } - if (message.version != null && Object.hasOwnProperty.call(message, "version")) + if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + 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 && Object.hasOwnProperty.call(message, "restNumericEnums")) + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options, q + 1); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options, q + 1); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options, q + 1); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options, q + 1); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options, q + 1); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options, q + 1); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options, q + 1); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options, q + 1); + 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; }; @@ -55882,16 +54086,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Publishing.encode = function encode(message, writer, q) { + Publishing.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -55909,7 +54109,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -55927,7 +54127,7 @@ * @returns {$protobuf.Writer} Writer */ Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -56043,7 +54243,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.methodSettings != null && Object.hasOwnProperty.call(message, "methodSettings")) { + 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) { @@ -56052,29 +54252,29 @@ return "methodSettings." + error; } } - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) if (!$util.isString(message.newIssueUri)) return "newIssueUri: string expected"; - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) if (!$util.isString(message.documentationUri)) return "documentationUri: string expected"; - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) if (!$util.isString(message.apiShortName)) return "apiShortName: string expected"; - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) if (!$util.isString(message.githubLabel)) return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && Object.hasOwnProperty.call(message, "codeownerGithubTeams")) { + 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 && Object.hasOwnProperty.call(message, "docTagPrefix")) + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) if (!$util.isString(message.docTagPrefix)) return "docTagPrefix: string expected"; - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + if (message.organization != null && message.hasOwnProperty("organization")) switch (message.organization) { default: return "organization: enum value expected"; @@ -56088,7 +54288,7 @@ case 7: break; } - if (message.librarySettings != null && Object.hasOwnProperty.call(message, "librarySettings")) { + 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) { @@ -56097,10 +54297,10 @@ return "librarySettings." + error; } } - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) if (!$util.isString(message.protoReferenceDocumentationUri)) return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) if (!$util.isString(message.restReferenceDocumentationUri)) return "restReferenceDocumentationUri: string expected"; return null; @@ -56117,8 +54317,6 @@ Publishing.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.Publishing) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.Publishing: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56129,7 +54327,7 @@ throw TypeError(".google.api.Publishing.methodSettings: array expected"); message.methodSettings = []; for (var i = 0; i < object.methodSettings.length; ++i) { - if (!$util.isObject(object.methodSettings[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], long + 1); } @@ -56196,7 +54394,7 @@ throw TypeError(".google.api.Publishing.librarySettings: array expected"); message.librarySettings = []; for (var i = 0; i < object.librarySettings.length; ++i) { - if (!$util.isObject(object.librarySettings[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], long + 1); } @@ -56217,13 +54415,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Publishing.toObject = function toObject(message, options, q) { + Publishing.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.methodSettings = []; @@ -56243,33 +54437,33 @@ 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, q + 1); + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); } - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) object.documentationUri = message.documentationUri; - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) object.apiShortName = message.apiShortName; - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + 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 && Object.hasOwnProperty.call(message, "docTagPrefix")) + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + 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, q + 1); + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); } - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; return object; }; @@ -56375,20 +54569,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - JavaSettings.encode = function encode(message, writer, q) { + JavaSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -56402,7 +54592,7 @@ * @returns {$protobuf.Writer} Writer */ JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -56501,10 +54691,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) if (!$util.isString(message.libraryPackage)) return "libraryPackage: string expected"; - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) { + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { if (!$util.isObject(message.serviceClassNames)) return "serviceClassNames: object expected"; var key = Object.keys(message.serviceClassNames); @@ -56512,7 +54702,7 @@ if (!$util.isString(message.serviceClassNames[key[i]])) return "serviceClassNames: string{k:string} expected"; } - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -56531,8 +54721,6 @@ JavaSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.JavaSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.JavaSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56541,7 +54729,7 @@ if (object.libraryPackage != null) message.libraryPackage = String(object.libraryPackage); if (object.serviceClassNames) { - if (!$util.isObject(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) { @@ -56551,7 +54739,7 @@ } } if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.JavaSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -56567,13 +54755,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - JavaSettings.toObject = function toObject(message, options, q) { + JavaSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.serviceClassNames = {}; @@ -56581,7 +54765,7 @@ object.libraryPackage = ""; object.common = null; } - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) object.libraryPackage = message.libraryPackage; var keys2; if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { @@ -56592,8 +54776,8 @@ object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; } } - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; @@ -56679,15 +54863,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CppSettings.encode = function encode(message, writer, q) { + CppSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -56701,7 +54881,7 @@ * @returns {$protobuf.Writer} Writer */ CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -56771,7 +54951,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -56790,15 +54970,13 @@ CppSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.CppSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.CppSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.CppSettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.CppSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -56814,18 +54992,14 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CppSettings.toObject = function toObject(message, options, q) { + CppSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.common = null; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; @@ -56911,15 +55085,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PhpSettings.encode = function encode(message, writer, q) { + PhpSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -56933,7 +55103,7 @@ * @returns {$protobuf.Writer} Writer */ PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -57003,7 +55173,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -57022,15 +55192,13 @@ PhpSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.PhpSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.PhpSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.PhpSettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.PhpSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -57046,18 +55214,14 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PhpSettings.toObject = function toObject(message, options, q) { + PhpSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.common = null; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; @@ -57152,17 +55316,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PythonSettings.encode = function encode(message, writer, q) { + PythonSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) - $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -57176,7 +55336,7 @@ * @returns {$protobuf.Writer} Writer */ PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -57250,12 +55410,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; } - if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) { + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures, long + 1); if (error) return "experimentalFeatures." + error; @@ -57274,20 +55434,18 @@ PythonSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.PythonSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.PythonSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.PythonSettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } if (object.experimentalFeatures != null) { - if (!$util.isObject(object.experimentalFeatures)) + if (typeof object.experimentalFeatures !== "object") throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures, long + 1); } @@ -57303,22 +55461,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PythonSettings.toObject = function toObject(message, options, q) { + PythonSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.common = null; object.experimentalFeatures = null; } - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); - if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) - object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options, q + 1); + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); return object; }; @@ -57419,13 +55573,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExperimentalFeatures.encode = function encode(message, writer, q) { + ExperimentalFeatures.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) @@ -57445,7 +55595,7 @@ * @returns {$protobuf.Writer} Writer */ ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -57523,13 +55673,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) if (typeof message.restAsyncIoEnabled !== "boolean") return "restAsyncIoEnabled: boolean expected"; - if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) if (typeof message.protobufPythonicTypesEnabled !== "boolean") return "protobufPythonicTypesEnabled: boolean expected"; - if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) if (typeof message.unversionedPackageDisabled !== "boolean") return "unversionedPackageDisabled: boolean expected"; return null; @@ -57546,8 +55696,6 @@ ExperimentalFeatures.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.PythonSettings.ExperimentalFeatures: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -57571,24 +55719,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExperimentalFeatures.toObject = function toObject(message, options, q) { + ExperimentalFeatures.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.restAsyncIoEnabled = false; object.protobufPythonicTypesEnabled = false; object.unversionedPackageDisabled = false; } - if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) object.restAsyncIoEnabled = message.restAsyncIoEnabled; - if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; - if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) object.unversionedPackageDisabled = message.unversionedPackageDisabled; return object; }; @@ -57678,15 +55822,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeSettings.encode = function encode(message, writer, q) { + NodeSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -57700,7 +55840,7 @@ * @returns {$protobuf.Writer} Writer */ NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -57770,7 +55910,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -57789,15 +55929,13 @@ NodeSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.NodeSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.NodeSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.NodeSettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.NodeSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -57813,18 +55951,14 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeSettings.toObject = function toObject(message, options, q) { + NodeSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.common = null; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; @@ -57960,15 +56094,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DotnetSettings.encode = function encode(message, writer, q) { + DotnetSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(); @@ -57997,7 +56127,7 @@ * @returns {$protobuf.Writer} Writer */ DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -58135,12 +56265,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; } - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { if (!$util.isObject(message.renamedServices)) return "renamedServices: object expected"; var key = Object.keys(message.renamedServices); @@ -58148,7 +56278,7 @@ if (!$util.isString(message.renamedServices[key[i]])) return "renamedServices: string{k:string} expected"; } - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) { + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { if (!$util.isObject(message.renamedResources)) return "renamedResources: object expected"; var key = Object.keys(message.renamedResources); @@ -58156,21 +56286,21 @@ if (!$util.isString(message.renamedResources[key[i]])) return "renamedResources: string{k:string} expected"; } - if (message.ignoredResources != null && Object.hasOwnProperty.call(message, "ignoredResources")) { + 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 && Object.hasOwnProperty.call(message, "forcedNamespaceAliases")) { + 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 && Object.hasOwnProperty.call(message, "handwrittenSignatures")) { + 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) @@ -58191,20 +56321,18 @@ DotnetSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.DotnetSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.DotnetSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.DotnetSettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.DotnetSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } if (object.renamedServices) { - if (!$util.isObject(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) { @@ -58214,7 +56342,7 @@ } } if (object.renamedResources) { - if (!$util.isObject(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) { @@ -58256,13 +56384,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DotnetSettings.toObject = function toObject(message, options, q) { + DotnetSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.ignoredResources = []; @@ -58275,8 +56399,8 @@ } if (options.defaults) object.common = null; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + 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 = {}; @@ -58394,15 +56518,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RubySettings.encode = function encode(message, writer, q) { + RubySettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -58416,7 +56536,7 @@ * @returns {$protobuf.Writer} Writer */ RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -58486,7 +56606,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -58505,15 +56625,13 @@ RubySettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.RubySettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.RubySettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.RubySettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.RubySettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -58529,18 +56647,14 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RubySettings.toObject = function toObject(message, options, q) { + RubySettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.common = null; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; @@ -58636,15 +56750,11 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GoSettings.encode = function encode(message, writer, q) { + GoSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(); @@ -58661,7 +56771,7 @@ * @returns {$protobuf.Writer} Writer */ GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -58756,12 +56866,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + if (message.common != null && message.hasOwnProperty("common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; } - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { if (!$util.isObject(message.renamedServices)) return "renamedServices: object expected"; var key = Object.keys(message.renamedServices); @@ -58783,20 +56893,18 @@ GoSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.GoSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.GoSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.GoSettings(); if (object.common != null) { - if (!$util.isObject(object.common)) + if (typeof object.common !== "object") throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } if (object.renamedServices) { - if (!$util.isObject(object.renamedServices)) + if (typeof object.renamedServices !== "object") throw TypeError(".google.api.GoSettings.renamedServices: object expected"); message.renamedServices = {}; for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { @@ -58817,20 +56925,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GoSettings.toObject = function toObject(message, options, q) { + GoSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.renamedServices = {}; if (options.defaults) object.common = null; - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + 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 = {}; @@ -58944,17 +57048,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodSettings.encode = function encode(message, writer, q) { + MethodSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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]); @@ -58971,7 +57071,7 @@ * @returns {$protobuf.Writer} Writer */ MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -59051,15 +57151,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (message.selector != null && message.hasOwnProperty("selector")) if (!$util.isString(message.selector)) return "selector: string expected"; - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) { + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning, long + 1); if (error) return "longRunning." + error; } - if (message.autoPopulatedFields != null && Object.hasOwnProperty.call(message, "autoPopulatedFields")) { + 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) @@ -59080,8 +57180,6 @@ MethodSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.MethodSettings) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.MethodSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59090,7 +57188,7 @@ if (object.selector != null) message.selector = String(object.selector); if (object.longRunning != null) { - if (!$util.isObject(object.longRunning)) + if (typeof object.longRunning !== "object") throw TypeError(".google.api.MethodSettings.longRunning: object expected"); message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning, long + 1); } @@ -59113,13 +57211,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodSettings.toObject = function toObject(message, options, q) { + MethodSettings.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.autoPopulatedFields = []; @@ -59127,10 +57221,10 @@ object.selector = ""; object.longRunning = null; } - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (message.selector != null && message.hasOwnProperty("selector")) object.selector = message.selector; - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options, q + 1); + 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) @@ -59245,21 +57339,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LongRunning.encode = function encode(message, writer, q) { + LongRunning.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -59273,7 +57363,7 @@ * @returns {$protobuf.Writer} Writer */ LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -59355,20 +57445,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) { + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { var error = $root.google.protobuf.Duration.verify(message.initialPollDelay, long + 1); if (error) return "initialPollDelay." + error; } - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) if (typeof message.pollDelayMultiplier !== "number") return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) { + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { var error = $root.google.protobuf.Duration.verify(message.maxPollDelay, long + 1); if (error) return "maxPollDelay." + error; } - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) { + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout, long + 1); if (error) return "totalPollTimeout." + error; @@ -59387,27 +57477,25 @@ LongRunning.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.MethodSettings.LongRunning) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.MethodSettings.LongRunning: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.MethodSettings.LongRunning(); if (object.initialPollDelay != null) { - if (!$util.isObject(object.initialPollDelay)) + if (typeof object.initialPollDelay !== "object") throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay, long + 1); } if (object.pollDelayMultiplier != null) message.pollDelayMultiplier = Number(object.pollDelayMultiplier); if (object.maxPollDelay != null) { - if (!$util.isObject(object.maxPollDelay)) + if (typeof object.maxPollDelay !== "object") throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay, long + 1); } if (object.totalPollTimeout != null) { - if (!$util.isObject(object.totalPollTimeout)) + if (typeof object.totalPollTimeout !== "object") throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout, long + 1); } @@ -59423,13 +57511,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LongRunning.toObject = function toObject(message, options, q) { + LongRunning.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.initialPollDelay = null; @@ -59437,14 +57521,14 @@ object.maxPollDelay = null; object.totalPollTimeout = null; } - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options, q + 1); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + 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 && Object.hasOwnProperty.call(message, "maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options, q + 1); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options, q + 1); + 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; }; @@ -59585,13 +57669,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SelectiveGapicGeneration.encode = function encode(message, writer, q) { + SelectiveGapicGeneration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.methods != null && message.methods.length) for (var i = 0; i < message.methods.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); @@ -59610,7 +57690,7 @@ * @returns {$protobuf.Writer} Writer */ SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -59686,14 +57766,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.methods != null && Object.hasOwnProperty.call(message, "methods")) { + if (message.methods != null && message.hasOwnProperty("methods")) { if (!Array.isArray(message.methods)) return "methods: array expected"; for (var i = 0; i < message.methods.length; ++i) if (!$util.isString(message.methods[i])) return "methods: string[] expected"; } - if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) if (typeof message.generateOmittedAsInternal !== "boolean") return "generateOmittedAsInternal: boolean expected"; return null; @@ -59710,8 +57790,6 @@ SelectiveGapicGeneration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.SelectiveGapicGeneration) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.SelectiveGapicGeneration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59738,13 +57816,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SelectiveGapicGeneration.toObject = function toObject(message, options, q) { + SelectiveGapicGeneration.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.methods = []; @@ -59755,7 +57829,7 @@ for (var j = 0; j < message.methods.length; ++j) object.methods[j] = message.methods[j]; } - if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) object.generateOmittedAsInternal = message.generateOmittedAsInternal; return object; }; @@ -59906,18 +57980,14 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldInfo.encode = function encode(message, writer, q) { + FieldInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.format != null && Object.hasOwnProperty.call(message, "format")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); if (message.referencedTypes != null && message.referencedTypes.length) for (var i = 0; i < message.referencedTypes.length; ++i) - $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -59931,7 +58001,7 @@ * @returns {$protobuf.Writer} Writer */ FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -60007,7 +58077,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.format != null && Object.hasOwnProperty.call(message, "format")) + if (message.format != null && message.hasOwnProperty("format")) switch (message.format) { default: return "format: enum value expected"; @@ -60018,7 +58088,7 @@ case 4: break; } - if (message.referencedTypes != null && Object.hasOwnProperty.call(message, "referencedTypes")) { + if (message.referencedTypes != null && message.hasOwnProperty("referencedTypes")) { if (!Array.isArray(message.referencedTypes)) return "referencedTypes: array expected"; for (var i = 0; i < message.referencedTypes.length; ++i) { @@ -60041,8 +58111,6 @@ FieldInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.FieldInfo) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.FieldInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60081,7 +58149,7 @@ throw TypeError(".google.api.FieldInfo.referencedTypes: array expected"); message.referencedTypes = []; for (var i = 0; i < object.referencedTypes.length; ++i) { - if (!$util.isObject(object.referencedTypes[i])) + if (typeof object.referencedTypes[i] !== "object") throw TypeError(".google.api.FieldInfo.referencedTypes: object expected"); message.referencedTypes[i] = $root.google.api.TypeReference.fromObject(object.referencedTypes[i], long + 1); } @@ -60098,24 +58166,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldInfo.toObject = function toObject(message, options, q) { + FieldInfo.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.referencedTypes = []; if (options.defaults) object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && Object.hasOwnProperty.call(message, "format")) + 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; if (message.referencedTypes && message.referencedTypes.length) { object.referencedTypes = []; for (var j = 0; j < message.referencedTypes.length; ++j) - object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options, q + 1); + object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options); } return object; }; @@ -60222,13 +58286,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TypeReference.encode = function encode(message, writer, q) { + TypeReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeName); return writer; @@ -60244,7 +58304,7 @@ * @returns {$protobuf.Writer} Writer */ TypeReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -60314,7 +58374,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (message.typeName != null && message.hasOwnProperty("typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; return null; @@ -60331,8 +58391,6 @@ TypeReference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.TypeReference) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.TypeReference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60352,17 +58410,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TypeReference.toObject = function toObject(message, options, q) { + TypeReference.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.typeName = ""; - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; return object; }; @@ -60505,13 +58559,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer, q) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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) @@ -60544,7 +58594,7 @@ * @returns {$protobuf.Writer} Writer */ ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -60647,20 +58697,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.pattern != null && Object.hasOwnProperty.call(message, "pattern")) { + 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 && Object.hasOwnProperty.call(message, "nameField")) + if (message.nameField != null && message.hasOwnProperty("nameField")) if (!$util.isString(message.nameField)) return "nameField: string expected"; - if (message.history != null && Object.hasOwnProperty.call(message, "history")) + if (message.history != null && message.hasOwnProperty("history")) switch (message.history) { default: return "history: enum value expected"; @@ -60669,13 +58719,13 @@ case 2: break; } - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + if (message.plural != null && message.hasOwnProperty("plural")) if (!$util.isString(message.plural)) return "plural: string expected"; - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + if (message.singular != null && message.hasOwnProperty("singular")) if (!$util.isString(message.singular)) return "singular: string expected"; - if (message.style != null && Object.hasOwnProperty.call(message, "style")) { + 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) @@ -60701,8 +58751,6 @@ ResourceDescriptor.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.ResourceDescriptor) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.ResourceDescriptor: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60776,13 +58824,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options, q) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.pattern = []; @@ -60795,20 +58839,20 @@ object.plural = ""; object.singular = ""; } - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + 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 && Object.hasOwnProperty.call(message, "nameField")) + if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; - if (message.history != null && Object.hasOwnProperty.call(message, "history")) + 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 && Object.hasOwnProperty.call(message, "plural")) + if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + if (message.singular != null && message.hasOwnProperty("singular")) object.singular = message.singular; if (message.style && message.style.length) { object.style = []; @@ -60939,13 +58983,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer, q) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -60963,7 +59003,7 @@ * @returns {$protobuf.Writer} Writer */ ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -61037,10 +59077,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + if (message.childType != null && message.hasOwnProperty("childType")) if (!$util.isString(message.childType)) return "childType: string expected"; return null; @@ -61057,8 +59097,6 @@ ResourceReference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.ResourceReference) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.ResourceReference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61080,21 +59118,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options, q) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.type = ""; object.childType = ""; } - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + if (message.childType != null && message.hasOwnProperty("childType")) object.childType = message.childType; return object; }; @@ -61182,16 +59216,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RoutingRule.encode = function encode(message, writer, q) { + RoutingRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -61205,7 +59235,7 @@ * @returns {$protobuf.Writer} Writer */ RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -61277,7 +59307,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.routingParameters != null && Object.hasOwnProperty.call(message, "routingParameters")) { + 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) { @@ -61300,8 +59330,6 @@ RoutingRule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.RoutingRule) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.RoutingRule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61312,7 +59340,7 @@ throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); message.routingParameters = []; for (var i = 0; i < object.routingParameters.length; ++i) { - if (!$util.isObject(object.routingParameters[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], long + 1); } @@ -61329,20 +59357,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RoutingRule.toObject = function toObject(message, options, q) { + RoutingRule.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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, q + 1); + object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); } return object; }; @@ -61438,13 +59462,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RoutingParameter.encode = function encode(message, writer, q) { + RoutingParameter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -61462,7 +59482,7 @@ * @returns {$protobuf.Writer} Writer */ RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -61536,10 +59556,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.field != null && Object.hasOwnProperty.call(message, "field")) + if (message.field != null && message.hasOwnProperty("field")) if (!$util.isString(message.field)) return "field: string expected"; - if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) if (!$util.isString(message.pathTemplate)) return "pathTemplate: string expected"; return null; @@ -61556,8 +59576,6 @@ RoutingParameter.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.RoutingParameter) return object; - if (!$util.isObject(object)) - throw TypeError(".google.api.RoutingParameter: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61579,21 +59597,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RoutingParameter.toObject = function toObject(message, options, q) { + RoutingParameter.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.field = ""; object.pathTemplate = ""; } - if (message.field != null && Object.hasOwnProperty.call(message, "field")) + if (message.field != null && message.hasOwnProperty("field")) object.field = message.field; - if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) object.pathTemplate = message.pathTemplate; return object; }; @@ -61693,16 +59707,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer, q) { + FileDescriptorSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -61716,7 +59726,7 @@ * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -61788,7 +59798,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.file != null && Object.hasOwnProperty.call(message, "file")) { + 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) { @@ -61811,8 +59821,6 @@ FileDescriptorSet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FileDescriptorSet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61823,7 +59831,7 @@ throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); message.file = []; for (var i = 0; i < object.file.length; ++i) { - if (!$util.isObject(object.file[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], long + 1); } @@ -61840,20 +59848,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options, q) { + FileDescriptorSet.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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, q + 1); + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); } return object; }; @@ -62099,13 +60103,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer, q) { + FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -62115,20 +60115,20 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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]); @@ -62155,7 +60155,7 @@ * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -62303,41 +60303,41 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + if (message["package"] != null && message.hasOwnProperty("package")) if (!$util.isString(message["package"])) return "package: string expected"; - if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) { + 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 && Object.hasOwnProperty.call(message, "publicDependency")) { + 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 && Object.hasOwnProperty.call(message, "weakDependency")) { + 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.optionDependency != null && Object.hasOwnProperty.call(message, "optionDependency")) { + if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { if (!Array.isArray(message.optionDependency)) return "optionDependency: array expected"; for (var i = 0; i < message.optionDependency.length; ++i) if (!$util.isString(message.optionDependency[i])) return "optionDependency: string[] expected"; } - if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { + 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) { @@ -62346,7 +60346,7 @@ return "messageType." + error; } } - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { + 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) { @@ -62355,7 +60355,7 @@ return "enumType." + error; } } - if (message.service != null && Object.hasOwnProperty.call(message, "service")) { + 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) { @@ -62364,7 +60364,7 @@ return "service." + error; } } - if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { + 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) { @@ -62373,20 +60373,20 @@ return "extension." + error; } } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FileOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) { + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo, long + 1); if (error) return "sourceCodeInfo." + error; } - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + if (message.edition != null && message.hasOwnProperty("edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -62418,8 +60418,6 @@ FileDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FileDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -62462,7 +60460,7 @@ throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); message.messageType = []; for (var i = 0; i < object.messageType.length; ++i) { - if (!$util.isObject(object.messageType[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], long + 1); } @@ -62472,7 +60470,7 @@ throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { - if (!$util.isObject(object.enumType[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], long + 1); } @@ -62482,7 +60480,7 @@ throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); message.service = []; for (var i = 0; i < object.service.length; ++i) { - if (!$util.isObject(object.service[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], long + 1); } @@ -62492,18 +60490,18 @@ throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { - if (!$util.isObject(object.extension[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], long + 1); } } if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FileOptions.fromObject(object.options, long + 1); } if (object.sourceCodeInfo != null) { - if (!$util.isObject(object.sourceCodeInfo)) + if (typeof object.sourceCodeInfo !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo, long + 1); } @@ -62577,13 +60575,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options, q) { + FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.dependency = []; @@ -62603,9 +60597,9 @@ object.syntax = ""; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + if (message["package"] != null && message.hasOwnProperty("package")) object["package"] = message["package"]; if (message.dependency && message.dependency.length) { object.dependency = []; @@ -62615,27 +60609,27 @@ 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, q + 1); + 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, q + 1); + 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, q + 1); + 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, q + 1); + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options, q + 1); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options, q + 1); + 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) @@ -62646,9 +60640,9 @@ for (var j = 0; j < message.weakDependency.length; ++j) object.weakDependency[j] = message.weakDependency[j]; } - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + 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; if (message.optionDependency && message.optionDependency.length) { object.optionDependency = []; @@ -62838,38 +60832,34 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer, q) { + DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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]); @@ -62888,7 +60878,7 @@ * @returns {$protobuf.Writer} Writer */ DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -63014,10 +61004,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.field != null && Object.hasOwnProperty.call(message, "field")) { + 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) { @@ -63026,7 +61016,7 @@ return "field." + error; } } - if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { + 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) { @@ -63035,7 +61025,7 @@ return "extension." + error; } } - if (message.nestedType != null && Object.hasOwnProperty.call(message, "nestedType")) { + 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) { @@ -63044,7 +61034,7 @@ return "nestedType." + error; } } - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { + 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) { @@ -63053,7 +61043,7 @@ return "enumType." + error; } } - if (message.extensionRange != null && Object.hasOwnProperty.call(message, "extensionRange")) { + 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) { @@ -63062,7 +61052,7 @@ return "extensionRange." + error; } } - if (message.oneofDecl != null && Object.hasOwnProperty.call(message, "oneofDecl")) { + 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) { @@ -63071,12 +61061,12 @@ return "oneofDecl." + error; } } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MessageOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { + 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) { @@ -63085,14 +61075,14 @@ return "reservedRange." + error; } } - if (message.reservedName != null && Object.hasOwnProperty.call(message, "reservedName")) { + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + if (message.visibility != null && message.hasOwnProperty("visibility")) switch (message.visibility) { default: return "visibility: enum value expected"; @@ -63115,8 +61105,6 @@ DescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.DescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63129,7 +61117,7 @@ throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); message.field = []; for (var i = 0; i < object.field.length; ++i) { - if (!$util.isObject(object.field[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], long + 1); } @@ -63139,7 +61127,7 @@ throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { - if (!$util.isObject(object.extension[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], long + 1); } @@ -63149,7 +61137,7 @@ throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); message.nestedType = []; for (var i = 0; i < object.nestedType.length; ++i) { - if (!$util.isObject(object.nestedType[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], long + 1); } @@ -63159,7 +61147,7 @@ throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { - if (!$util.isObject(object.enumType[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], long + 1); } @@ -63169,7 +61157,7 @@ throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); message.extensionRange = []; for (var i = 0; i < object.extensionRange.length; ++i) { - if (!$util.isObject(object.extensionRange[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], long + 1); } @@ -63179,13 +61167,13 @@ throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); message.oneofDecl = []; for (var i = 0; i < object.oneofDecl.length; ++i) { - if (!$util.isObject(object.oneofDecl[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], long + 1); } } if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); message.options = $root.google.protobuf.MessageOptions.fromObject(object.options, long + 1); } @@ -63194,7 +61182,7 @@ throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { - if (!$util.isObject(object.reservedRange[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], long + 1); } @@ -63238,13 +61226,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options, q) { + DescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.field = []; @@ -63261,51 +61245,51 @@ object.options = null; object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + 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, q + 1); + 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, q + 1); + 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, q + 1); + 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, q + 1); + 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, q + 1); + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options, q + 1); + 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, q + 1); + 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, q + 1); + 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]; } - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + if (message.visibility != null && message.hasOwnProperty("visibility")) object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -63407,19 +61391,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRange.encode = function encode(message, writer, q) { + ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -63433,7 +61413,7 @@ * @returns {$protobuf.Writer} Writer */ ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -63511,13 +61491,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -63536,8 +61516,6 @@ ExtensionRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63548,7 +61526,7 @@ if (object.end != null) message.end = object.end | 0; if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options, long + 1); } @@ -63564,25 +61542,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRange.toObject = function toObject(message, options, q) { + ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = 0; object.end = 0; object.options = null; } - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options, q + 1); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); return object; }; @@ -63677,13 +61651,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReservedRange.encode = function encode(message, writer, q) { + ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -63701,7 +61671,7 @@ * @returns {$protobuf.Writer} Writer */ ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -63775,10 +61745,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; @@ -63795,8 +61765,6 @@ ReservedRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.DescriptorProto.ReservedRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63818,21 +61786,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReservedRange.toObject = function toObject(message, options, q) { + ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; @@ -63951,23 +61915,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, writer, q) { + ExtensionRangeOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; @@ -63981,7 +61941,7 @@ * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -64067,7 +62027,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -64076,7 +62036,7 @@ return "uninterpretedOption." + error; } } - if (message.declaration != null && Object.hasOwnProperty.call(message, "declaration")) { + 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) { @@ -64085,12 +62045,12 @@ return "declaration." + error; } } - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + if (message.verification != null && message.hasOwnProperty("verification")) switch (message.verification) { default: return "verification: enum value expected"; @@ -64112,8 +62072,6 @@ ExtensionRangeOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.ExtensionRangeOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64124,7 +62082,7 @@ throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -64134,13 +62092,13 @@ throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); message.declaration = []; for (var i = 0; i < object.declaration.length; ++i) { - if (!$util.isObject(object.declaration[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], long + 1); } } if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -64172,13 +62130,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options, q) { + ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.declaration = []; @@ -64191,16 +62145,16 @@ 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, q + 1); + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); } - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + 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 && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; @@ -64320,13 +62274,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Declaration.encode = function encode(message, writer, q) { + Declaration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -64350,7 +62300,7 @@ * @returns {$protobuf.Writer} Writer */ Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -64436,19 +62386,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + if (message.fullName != null && message.hasOwnProperty("fullName")) if (!$util.isString(message.fullName)) return "fullName: string expected"; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + if (message.reserved != null && message.hasOwnProperty("reserved")) if (typeof message.reserved !== "boolean") return "reserved: boolean expected"; - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + if (message.repeated != null && message.hasOwnProperty("repeated")) if (typeof message.repeated !== "boolean") return "repeated: boolean expected"; return null; @@ -64465,8 +62415,6 @@ Declaration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.Declaration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64494,13 +62442,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Declaration.toObject = function toObject(message, options, q) { + Declaration.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.number = 0; @@ -64509,15 +62453,15 @@ object.reserved = false; object.repeated = false; } - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + if (message.fullName != null && message.hasOwnProperty("fullName")) object.fullName = message.fullName; - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + if (message.reserved != null && message.hasOwnProperty("reserved")) object.reserved = message.reserved; - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + if (message.repeated != null && message.hasOwnProperty("repeated")) object.repeated = message.repeated; return object; }; @@ -64711,13 +62655,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer, q) { + FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -64733,7 +62673,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -64753,7 +62693,7 @@ * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -64863,13 +62803,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; - if (message.label != null && Object.hasOwnProperty.call(message, "label")) + if (message.label != null && message.hasOwnProperty("label")) switch (message.label) { default: return "label: enum value expected"; @@ -64878,7 +62818,7 @@ case 2: break; } - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; @@ -64902,27 +62842,27 @@ case 18: break; } - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (message.typeName != null && message.hasOwnProperty("typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + if (message.extendee != null && message.hasOwnProperty("extendee")) if (!$util.isString(message.extendee)) return "extendee: string expected"; - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) if (!$util.isString(message.defaultValue)) return "defaultValue: string expected"; - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) if (!$util.isInteger(message.oneofIndex)) return "oneofIndex: integer expected"; - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + if (message.jsonName != null && message.hasOwnProperty("jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FieldOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) if (typeof message.proto3Optional !== "boolean") return "proto3Optional: boolean expected"; return null; @@ -64939,8 +62879,6 @@ FieldDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FieldDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65061,7 +62999,7 @@ if (object.jsonName != null) message.jsonName = String(object.jsonName); if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options, long + 1); } @@ -65079,13 +63017,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options, q) { + FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -65100,27 +63034,27 @@ object.jsonName = ""; object.proto3Optional = false; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + if (message.extendee != null && message.hasOwnProperty("extendee")) object.extendee = message.extendee; - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; - if (message.label != null && Object.hasOwnProperty.call(message, "label")) + 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 && Object.hasOwnProperty.call(message, "type")) + 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 && Object.hasOwnProperty.call(message, "typeName")) + if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) object.defaultValue = message.defaultValue; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options, q + 1); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + 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 && Object.hasOwnProperty.call(message, "jsonName")) + if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) object.proto3Optional = message.proto3Optional; return object; }; @@ -65278,17 +63212,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer, q) { + OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -65302,7 +63232,7 @@ * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -65376,10 +63306,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.OneofOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -65398,8 +63328,6 @@ OneofDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.OneofDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65408,7 +63336,7 @@ if (object.name != null) message.name = String(object.name); if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); message.options = $root.google.protobuf.OneofOptions.fromObject(object.options, long + 1); } @@ -65424,22 +63352,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofDescriptorProto.toObject = function toObject(message, options, q) { + OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.options = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options, q + 1); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; @@ -65573,23 +63497,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, writer, q) { + EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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]); @@ -65608,7 +63528,7 @@ * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -65704,10 +63624,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.value != null && Object.hasOwnProperty.call(message, "value")) { + 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) { @@ -65716,12 +63636,12 @@ return "value." + error; } } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { + 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) { @@ -65730,14 +63650,14 @@ return "reservedRange." + error; } } - if (message.reservedName != null && Object.hasOwnProperty.call(message, "reservedName")) { + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + if (message.visibility != null && message.hasOwnProperty("visibility")) switch (message.visibility) { default: return "visibility: enum value expected"; @@ -65760,8 +63680,6 @@ EnumDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.EnumDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65774,13 +63692,13 @@ throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); message.value = []; for (var i = 0; i < object.value.length; ++i) { - if (!$util.isObject(object.value[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], long + 1); } } if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumOptions.fromObject(object.options, long + 1); } @@ -65789,7 +63707,7 @@ throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { - if (!$util.isObject(object.reservedRange[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], long + 1); } @@ -65833,13 +63751,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options, q) { + EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.value = []; @@ -65851,26 +63765,26 @@ object.options = null; object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + 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, q + 1); + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options, q + 1); + 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, q + 1); + 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]; } - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + if (message.visibility != null && message.hasOwnProperty("visibility")) object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; return object; }; @@ -65963,13 +63877,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumReservedRange.encode = function encode(message, writer, q) { + EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -65987,7 +63897,7 @@ * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -66061,10 +63971,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; @@ -66081,8 +63991,6 @@ EnumReservedRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.EnumDescriptorProto.EnumReservedRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66104,21 +64012,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumReservedRange.toObject = function toObject(message, options, q) { + EnumReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; @@ -66226,19 +64130,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, writer, q) { + EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -66252,7 +64152,7 @@ * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -66330,13 +64230,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumValueOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -66355,8 +64255,6 @@ EnumValueDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.EnumValueDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66367,7 +64265,7 @@ if (object.number != null) message.number = object.number | 0; if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options, long + 1); } @@ -66383,25 +64281,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options, q) { + EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.number = 0; object.options = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options, q + 1); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; @@ -66506,20 +64400,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer, q) { + ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -66533,7 +64423,7 @@ * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -66613,10 +64503,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.method != null && Object.hasOwnProperty.call(message, "method")) { + 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) { @@ -66625,7 +64515,7 @@ return "method." + error; } } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ServiceOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -66644,8 +64534,6 @@ ServiceDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.ServiceDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66658,13 +64546,13 @@ throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); message.method = []; for (var i = 0; i < object.method.length; ++i) { - if (!$util.isObject(object.method[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], long + 1); } } if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options, long + 1); } @@ -66680,13 +64568,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options, q) { + ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.method = []; @@ -66694,15 +64578,15 @@ object.name = ""; object.options = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + 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, q + 1); + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); } - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options, q + 1); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; @@ -66833,13 +64717,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer, q) { + MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -66847,7 +64727,7 @@ 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(), q + 1).ldelim(); + $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")) @@ -66865,7 +64745,7 @@ * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -66955,24 +64835,24 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + if (message.inputType != null && message.hasOwnProperty("inputType")) if (!$util.isString(message.inputType)) return "inputType: string expected"; - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + if (message.outputType != null && message.hasOwnProperty("outputType")) if (!$util.isString(message.outputType)) return "outputType: string expected"; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MethodOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) if (typeof message.clientStreaming !== "boolean") return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) if (typeof message.serverStreaming !== "boolean") return "serverStreaming: boolean expected"; return null; @@ -66989,8 +64869,6 @@ MethodDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.MethodDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67003,7 +64881,7 @@ if (object.outputType != null) message.outputType = String(object.outputType); if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); message.options = $root.google.protobuf.MethodOptions.fromObject(object.options, long + 1); } @@ -67023,13 +64901,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options, q) { + MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -67039,17 +64913,17 @@ object.clientStreaming = false; object.serverStreaming = false; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + if (message.inputType != null && message.hasOwnProperty("inputType")) object.inputType = message.inputType; - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + if (message.outputType != null && message.hasOwnProperty("outputType")) object.outputType = message.outputType; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options, q + 1); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + 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 && Object.hasOwnProperty.call(message, "serverStreaming")) + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) object.serverStreaming = message.serverStreaming; return object; }; @@ -67327,13 +65201,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer, q) { + FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -67373,13 +65243,13 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -67393,7 +65263,7 @@ * @returns {$protobuf.Writer} Writer */ FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -67551,22 +65421,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) if (!$util.isString(message.javaPackage)) return "javaPackage: string expected"; - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) if (!$util.isString(message.javaOuterClassname)) return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) if (typeof message.javaMultipleFiles !== "boolean") return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) if (typeof message.javaGenerateEqualsAndHash !== "boolean") return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) if (typeof message.javaStringCheckUtf8 !== "boolean") return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) switch (message.optimizeFor) { default: return "optimizeFor: enum value expected"; @@ -67575,51 +65445,51 @@ case 3: break; } - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + if (message.goPackage != null && message.hasOwnProperty("goPackage")) if (!$util.isString(message.goPackage)) return "goPackage: string expected"; - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) if (typeof message.ccGenericServices !== "boolean") return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) if (typeof message.javaGenericServices !== "boolean") return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) if (typeof message.pyGenericServices !== "boolean") return "pyGenericServices: boolean expected"; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) if (typeof message.ccEnableArenas !== "boolean") return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) if (!$util.isString(message.objcClassPrefix)) return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) if (!$util.isString(message.csharpNamespace)) return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) if (!$util.isString(message.swiftPrefix)) return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) if (!$util.isString(message.phpClassPrefix)) return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) if (!$util.isString(message.phpNamespace)) return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) if (!$util.isString(message.phpMetadataNamespace)) return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -67628,7 +65498,7 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resourceDefinition"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceDefinition")) { + 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) { @@ -67651,8 +65521,6 @@ FileOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FileOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FileOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67715,7 +65583,7 @@ if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.FileOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -67724,7 +65592,7 @@ throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -67734,7 +65602,7 @@ 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 (!$util.isObject(object[".google.api.resourceDefinition"][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], long + 1); } @@ -67751,13 +65619,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options, q) { + FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; @@ -67785,55 +65649,55 @@ object.rubyPackage = ""; object.features = null; } - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + 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 && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + if (message.goPackage != null && message.hasOwnProperty("goPackage")) object.goPackage = message.goPackage; - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) object.rubyPackage = message.rubyPackage; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + 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, q + 1); + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); } return object; }; @@ -68000,13 +65864,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer, q) { + MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -68018,12 +65878,12 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -68037,7 +65897,7 @@ * @returns {$protobuf.Writer} Writer */ MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -68137,27 +65997,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) if (typeof message.messageSetWireFormat !== "boolean") return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) if (typeof message.noStandardDescriptorAccessor !== "boolean") return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -68166,7 +66026,7 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) { + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"], long + 1); if (error) return ".google.api.resource." + error; @@ -68185,8 +66045,6 @@ MessageOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.MessageOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.MessageOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68203,7 +66061,7 @@ if (object.deprecatedLegacyJsonFieldConflicts != null) message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.MessageOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -68212,13 +66070,13 @@ throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } } if (object[".google.api.resource"] != null) { - if (!$util.isObject(object[".google.api.resource"])) + 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"], long + 1); } @@ -68234,13 +66092,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options, q) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -68253,25 +66107,25 @@ object.features = null; object[".google.api.resource"] = null; } - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options, q + 1); + 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; }; @@ -68505,13 +66359,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer, q) { + FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -68535,21 +66385,21 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); return writer; }; @@ -68563,7 +66413,7 @@ * @returns {$protobuf.Writer} Writer */ FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -68715,7 +66565,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + if (message.ctype != null && message.hasOwnProperty("ctype")) switch (message.ctype) { default: return "ctype: enum value expected"; @@ -68724,10 +66574,10 @@ case 2: break; } - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + if (message.packed != null && message.hasOwnProperty("packed")) if (typeof message.packed !== "boolean") return "packed: boolean expected"; - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + if (message.jstype != null && message.hasOwnProperty("jstype")) switch (message.jstype) { default: return "jstype: enum value expected"; @@ -68736,22 +66586,22 @@ case 2: break; } - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) if (typeof message.unverifiedLazy !== "boolean") return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + if (message.weak != null && message.hasOwnProperty("weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + if (message.retention != null && message.hasOwnProperty("retention")) switch (message.retention) { default: return "retention: enum value expected"; @@ -68760,7 +66610,7 @@ case 2: break; } - if (message.targets != null && Object.hasOwnProperty.call(message, "targets")) { + 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) @@ -68780,7 +66630,7 @@ break; } } - if (message.editionDefaults != null && Object.hasOwnProperty.call(message, "editionDefaults")) { + 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) { @@ -68789,17 +66639,17 @@ return "editionDefaults." + error; } } - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); if (error) return "featureSupport." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -68808,7 +66658,7 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.fieldBehavior"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldBehavior")) { + 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) @@ -68827,12 +66677,12 @@ break; } } - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) { + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"], long + 1); if (error) return ".google.api.fieldInfo." + error; } - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) { + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"], long + 1); if (error) return ".google.api.resourceReference." + error; @@ -68851,8 +66701,6 @@ FieldOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FieldOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68988,18 +66836,18 @@ throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); message.editionDefaults = []; for (var i = 0; i < object.editionDefaults.length; ++i) { - if (!$util.isObject(object.editionDefaults[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], long + 1); } } if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } if (object.featureSupport != null) { - if (!$util.isObject(object.featureSupport)) + if (typeof object.featureSupport !== "object") throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); } @@ -69008,7 +66856,7 @@ throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -69063,12 +66911,12 @@ } } if (object[".google.api.fieldInfo"] != null) { - if (!$util.isObject(object[".google.api.fieldInfo"])) + 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"], long + 1); } if (object[".google.api.resourceReference"] != null) { - if (!$util.isObject(object[".google.api.resourceReference"])) + 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"], long + 1); } @@ -69084,13 +66932,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options, q) { + FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.targets = []; @@ -69113,23 +66957,23 @@ object[".google.api.resourceReference"] = null; object[".google.api.fieldInfo"] = null; } - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + 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 && Object.hasOwnProperty.call(message, "packed")) + if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + 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 && Object.hasOwnProperty.call(message, "weak")) + if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) object.debugRedact = message.debugRedact; - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + 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 = []; @@ -69139,26 +66983,26 @@ 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, q + 1); + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); } - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, 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, q + 1); + 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 && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options, q + 1); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options, q + 1); + 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; }; @@ -69328,13 +67172,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EditionDefault.encode = function encode(message, writer, q) { + EditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -69352,7 +67192,7 @@ * @returns {$protobuf.Writer} Writer */ EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -69426,7 +67266,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + if (message.edition != null && message.hasOwnProperty("edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -69444,7 +67284,7 @@ case 2147483647: break; } - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (message.value != null && message.hasOwnProperty("value")) if (!$util.isString(message.value)) return "value: string expected"; return null; @@ -69461,8 +67301,6 @@ EditionDefault.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FieldOptions.EditionDefault: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69538,21 +67376,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options, q) { + EditionDefault.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.value = ""; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (message.value != null && message.hasOwnProperty("value")) object.value = message.value; - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + 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; }; @@ -69666,13 +67500,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSupport.encode = function encode(message, writer, q) { + FeatureSupport.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) @@ -69694,7 +67524,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -69776,7 +67606,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) switch (message.editionIntroduced) { default: return "editionIntroduced: enum value expected"; @@ -69794,7 +67624,7 @@ case 2147483647: break; } - if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) switch (message.editionDeprecated) { default: return "editionDeprecated: enum value expected"; @@ -69812,10 +67642,10 @@ case 2147483647: break; } - if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) if (!$util.isString(message.deprecationWarning)) return "deprecationWarning: string expected"; - if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) switch (message.editionRemoved) { default: return "editionRemoved: enum value expected"; @@ -69847,8 +67677,6 @@ FeatureSupport.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FieldOptions.FeatureSupport: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70036,13 +67864,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSupport.toObject = function toObject(message, options, q) { + FeatureSupport.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; @@ -70050,13 +67874,13 @@ object.deprecationWarning = ""; object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; - if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; - if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) object.deprecationWarning = message.deprecationWarning; - if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; return object; }; @@ -70156,18 +67980,14 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer, q) { + OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; @@ -70181,7 +68001,7 @@ * @returns {$protobuf.Writer} Writer */ OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -70257,12 +68077,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -70285,15 +68105,13 @@ OneofOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.OneofOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.OneofOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.protobuf.OneofOptions(); if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.OneofOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -70302,7 +68120,7 @@ throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -70319,24 +68137,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options, q) { + OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) object.features = null; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; @@ -70460,13 +68274,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer, q) { + EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -70474,10 +68284,10 @@ 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; @@ -70491,7 +68301,7 @@ * @returns {$protobuf.Writer} Writer */ EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -70579,21 +68389,21 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) if (typeof message.allowAlias !== "boolean") return "allowAlias: boolean expected"; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -70616,8 +68426,6 @@ EnumOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.EnumOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70630,7 +68438,7 @@ if (object.deprecatedLegacyJsonFieldConflicts != null) message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.EnumOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -70639,7 +68447,7 @@ throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -70656,13 +68464,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options, q) { + EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -70672,18 +68476,18 @@ object.deprecatedLegacyJsonFieldConflicts = false; object.features = null; } - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) object.allowAlias = message.allowAlias; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; @@ -70807,24 +68611,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer, q) { + EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).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(), q + 1).ldelim(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; @@ -70838,7 +68638,7 @@ * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -70926,23 +68726,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); if (error) return "featureSupport." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -70965,8 +68765,6 @@ EnumValueOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumValueOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.EnumValueOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70975,14 +68773,14 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); if (object.featureSupport != null) { - if (!$util.isObject(object.featureSupport)) + if (typeof object.featureSupport !== "object") throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); } @@ -70991,7 +68789,7 @@ throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -71008,13 +68806,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options, q) { + EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -71024,18 +68818,18 @@ object.debugRedact = false; object.featureSupport = null; } - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + 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.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; @@ -71168,20 +68962,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer, q) { + ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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")) @@ -71201,7 +68991,7 @@ * @returns {$protobuf.Writer} Writer */ ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -71293,15 +69083,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -71310,13 +69100,13 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + 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 && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + 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 && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + 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; @@ -71333,15 +69123,13 @@ ServiceOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ServiceOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.ServiceOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.protobuf.ServiceOptions(); if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -71352,7 +69140,7 @@ throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } @@ -71375,13 +69163,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options, q) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -71392,20 +69176,20 @@ object[".google.api.oauthScopes"] = ""; object[".google.api.apiVersion"] = ""; } - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + 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 && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + 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 && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; return object; }; @@ -71557,31 +69341,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer, q) { + MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).fork()).ldelim(); return writer; }; @@ -71595,7 +69375,7 @@ * @returns {$protobuf.Writer} Writer */ MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -71697,10 +69477,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) switch (message.idempotencyLevel) { default: return "idempotencyLevel: enum value expected"; @@ -71709,12 +69489,12 @@ case 2: break; } - if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + if (message.features != null && message.hasOwnProperty("features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + 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) { @@ -71723,24 +69503,24 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) { + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { var error = $root.google.api.HttpRule.verify(message[".google.api.http"], long + 1); if (error) return ".google.api.http." + error; } - if (message[".google.api.methodSignature"] != null && Object.hasOwnProperty.call(message, ".google.api.methodSignature")) { + 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 && Object.hasOwnProperty.call(message, ".google.api.routing")) { + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"], long + 1); if (error) return ".google.api.routing." + error; } - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) { + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"], long + 1); if (error) return ".google.longrunning.operationInfo." + error; @@ -71759,8 +69539,6 @@ MethodOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.MethodOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.MethodOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -71789,7 +69567,7 @@ break; } if (object.features != null) { - if (!$util.isObject(object.features)) + if (typeof object.features !== "object") throw TypeError(".google.protobuf.MethodOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -71798,13 +69576,13 @@ throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (!$util.isObject(object.uninterpretedOption[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], long + 1); } } if (object[".google.api.http"] != null) { - if (!$util.isObject(object[".google.api.http"])) + 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"], long + 1); } @@ -71816,12 +69594,12 @@ message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } if (object[".google.api.routing"] != null) { - if (!$util.isObject(object[".google.api.routing"])) + 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"], long + 1); } if (object[".google.longrunning.operationInfo"] != null) { - if (!$util.isObject(object[".google.longrunning.operationInfo"])) + 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"], long + 1); } @@ -71837,13 +69615,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options, q) { + MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; @@ -71857,28 +69631,28 @@ object[".google.api.http"] = null; object[".google.api.routing"] = null; } - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + 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 && Object.hasOwnProperty.call(message, "features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + 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, q + 1); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options, q + 1); + 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 && Object.hasOwnProperty.call(message, ".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options, q + 1); - if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) - object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options, q + 1); + 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; }; @@ -72035,16 +69809,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer, q) { + UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -72070,7 +69840,7 @@ * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -72166,7 +69936,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) { + 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) { @@ -72175,22 +69945,22 @@ return "name." + error; } } - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) if (!$util.isString(message.identifierValue)) return "identifierValue: string expected"; - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + 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 && Object.hasOwnProperty.call(message, "negativeIntValue")) + 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 && Object.hasOwnProperty.call(message, "doubleValue")) + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + 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 && Object.hasOwnProperty.call(message, "aggregateValue")) + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) if (!$util.isString(message.aggregateValue)) return "aggregateValue: string expected"; return null; @@ -72207,8 +69977,6 @@ UninterpretedOption.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.UninterpretedOption) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.UninterpretedOption: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72219,7 +69987,7 @@ throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); message.name = []; for (var i = 0; i < object.name.length; ++i) { - if (!$util.isObject(object.name[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], long + 1); } @@ -72228,7 +69996,7 @@ message.identifierValue = String(object.identifierValue); if (object.positiveIntValue != null) if ($util.Long) - message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue, true); + (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") @@ -72237,7 +70005,7 @@ 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, false); + (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") @@ -72265,13 +70033,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options, q) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.name = []; @@ -72279,14 +70043,14 @@ 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.positiveIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.negativeIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.negativeIntValue = options.longs === String ? "0" : 0; object.doubleValue = 0; if (options.bytes === String) object.stringValue = ""; @@ -72300,29 +70064,25 @@ 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, q + 1); + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.positiveIntValue = typeof message.positiveIntValue === "number" ? BigInt(message.positiveIntValue) : $util.Long.fromBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0, true).toBigInt(); - else if (typeof message.positiveIntValue === "number") + 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 && Object.hasOwnProperty.call(message, "negativeIntValue")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.negativeIntValue = typeof message.negativeIntValue === "number" ? BigInt(message.negativeIntValue) : $util.Long.fromBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0, false).toBigInt(); - else if (typeof message.negativeIntValue === "number") + 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 && Object.hasOwnProperty.call(message, "doubleValue")) + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + 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 && Object.hasOwnProperty.call(message, "aggregateValue")) + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) object.aggregateValue = message.aggregateValue; return object; }; @@ -72415,13 +70175,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encode = function encode(message, writer, q) { + NamePart.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); return writer; @@ -72437,7 +70193,7 @@ * @returns {$protobuf.Writer} Writer */ NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -72477,9 +70233,9 @@ break; } } - if (!Object.hasOwnProperty.call(message, "namePart")) + if (!message.hasOwnProperty("namePart")) throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!Object.hasOwnProperty.call(message, "isExtension")) + if (!message.hasOwnProperty("isExtension")) throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; @@ -72533,8 +70289,6 @@ NamePart.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.UninterpretedOption.NamePart: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72556,21 +70310,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options, q) { + NamePart.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.namePart = ""; object.isExtension = false; } - if (message.namePart != null && Object.hasOwnProperty.call(message, "namePart")) + if (message.namePart != null && message.hasOwnProperty("namePart")) object.namePart = message.namePart; - if (message.isExtension != null && Object.hasOwnProperty.call(message, "isExtension")) + if (message.isExtension != null && message.hasOwnProperty("isExtension")) object.isExtension = message.isExtension; return object; }; @@ -72723,13 +70473,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSet.encode = function encode(message, writer, q) { + FeatureSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -72759,7 +70505,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -72857,7 +70603,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) switch (message.fieldPresence) { default: return "fieldPresence: enum value expected"; @@ -72867,7 +70613,7 @@ case 3: break; } - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + if (message.enumType != null && message.hasOwnProperty("enumType")) switch (message.enumType) { default: return "enumType: enum value expected"; @@ -72876,7 +70622,7 @@ case 2: break; } - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) switch (message.repeatedFieldEncoding) { default: return "repeatedFieldEncoding: enum value expected"; @@ -72885,7 +70631,7 @@ case 2: break; } - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) switch (message.utf8Validation) { default: return "utf8Validation: enum value expected"; @@ -72894,7 +70640,7 @@ case 3: break; } - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) switch (message.messageEncoding) { default: return "messageEncoding: enum value expected"; @@ -72903,7 +70649,7 @@ case 2: break; } - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) switch (message.jsonFormat) { default: return "jsonFormat: enum value expected"; @@ -72912,7 +70658,7 @@ case 2: break; } - if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) switch (message.enforceNamingStyle) { default: return "enforceNamingStyle: enum value expected"; @@ -72921,7 +70667,7 @@ case 2: break; } - if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) switch (message.defaultSymbolVisibility) { default: return "defaultSymbolVisibility: enum value expected"; @@ -72946,8 +70692,6 @@ FeatureSet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSet) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FeatureSet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -73137,13 +70881,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSet.toObject = function toObject(message, options, q) { + FeatureSet.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; @@ -73155,21 +70895,21 @@ object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; } - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + 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 && Object.hasOwnProperty.call(message, "enumType")) + 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 && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + 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 && Object.hasOwnProperty.call(message, "utf8Validation")) + 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 && Object.hasOwnProperty.call(message, "messageEncoding")) + 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 && Object.hasOwnProperty.call(message, "jsonFormat")) + 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; - if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; - if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; return object; }; @@ -73358,13 +71098,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VisibilityFeature.encode = function encode(message, writer, q) { + VisibilityFeature.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); return writer; }; @@ -73378,7 +71114,7 @@ * @returns {$protobuf.Writer} Writer */ VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -73458,6 +71194,10 @@ VisibilityFeature.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); return new $root.google.protobuf.FeatureSet.VisibilityFeature(); }; @@ -73598,16 +71338,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSetDefaults.encode = function encode(message, writer, q) { + FeatureSetDefaults.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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")) @@ -73625,7 +71361,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -73705,7 +71441,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.defaults != null && Object.hasOwnProperty.call(message, "defaults")) { + 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) { @@ -73714,7 +71450,7 @@ return "defaults." + error; } } - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) switch (message.minimumEdition) { default: return "minimumEdition: enum value expected"; @@ -73732,7 +71468,7 @@ case 2147483647: break; } - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) switch (message.maximumEdition) { default: return "maximumEdition: enum value expected"; @@ -73764,8 +71500,6 @@ FeatureSetDefaults.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSetDefaults) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FeatureSetDefaults: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -73776,7 +71510,7 @@ throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); message.defaults = []; for (var i = 0; i < object.defaults.length; ++i) { - if (!$util.isObject(object.defaults[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], long + 1); } @@ -73905,13 +71639,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSetDefaults.toObject = function toObject(message, options, q) { + FeatureSetDefaults.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.defaults = []; @@ -73922,11 +71652,11 @@ 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, q + 1); + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); } - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + 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 && Object.hasOwnProperty.call(message, "maximumEdition")) + 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; }; @@ -74028,19 +71758,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSetEditionDefault.encode = function encode(message, writer, q) { + FeatureSetEditionDefault.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) - $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) - $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -74054,7 +71780,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -74132,7 +71858,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + if (message.edition != null && message.hasOwnProperty("edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -74150,12 +71876,12 @@ case 2147483647: break; } - if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) { + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures, long + 1); if (error) return "overridableFeatures." + error; } - if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) { + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures, long + 1); if (error) return "fixedFeatures." + error; @@ -74174,8 +71900,6 @@ FeatureSetEditionDefault.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74238,12 +71962,12 @@ break; } if (object.overridableFeatures != null) { - if (!$util.isObject(object.overridableFeatures)) + if (typeof object.overridableFeatures !== "object") throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures, long + 1); } if (object.fixedFeatures != null) { - if (!$util.isObject(object.fixedFeatures)) + if (typeof object.fixedFeatures !== "object") throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures, long + 1); } @@ -74259,25 +71983,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSetEditionDefault.toObject = function toObject(message, options, q) { + FeatureSetEditionDefault.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; object.overridableFeatures = null; object.fixedFeatures = null; } - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + 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; - if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) - object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options, q + 1); - if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) - object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options, q + 1); + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); return object; }; @@ -74367,16 +72087,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer, q) { + SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -74390,7 +72106,7 @@ * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -74462,7 +72178,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.location != null && Object.hasOwnProperty.call(message, "location")) { + 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) { @@ -74485,8 +72201,6 @@ SourceCodeInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.SourceCodeInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74497,7 +72211,7 @@ throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); message.location = []; for (var i = 0; i < object.location.length; ++i) { - if (!$util.isObject(object.location[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], long + 1); } @@ -74514,20 +72228,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options, q) { + SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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, q + 1); + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } return object; }; @@ -74650,13 +72360,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer, q) { + Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) @@ -74689,7 +72395,7 @@ * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -74791,27 +72497,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.path != null && Object.hasOwnProperty.call(message, "path")) { + 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 && Object.hasOwnProperty.call(message, "span")) { + 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 && Object.hasOwnProperty.call(message, "leadingComments")) + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) if (!$util.isString(message.leadingComments)) return "leadingComments: string expected"; - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) if (!$util.isString(message.trailingComments)) return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && Object.hasOwnProperty.call(message, "leadingDetachedComments")) { + 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) @@ -74832,8 +72538,6 @@ Location.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74876,13 +72580,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options, q) { + Location.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.path = []; @@ -74903,9 +72603,9 @@ for (var j = 0; j < message.span.length; ++j) object.span[j] = message.span[j]; } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) object.leadingComments = message.leadingComments; - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) object.trailingComments = message.trailingComments; if (message.leadingDetachedComments && message.leadingDetachedComments.length) { object.leadingDetachedComments = []; @@ -75001,16 +72701,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer, q) { + GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -75024,7 +72720,7 @@ * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -75096,7 +72792,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) { + 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) { @@ -75119,8 +72815,6 @@ GeneratedCodeInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.GeneratedCodeInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -75131,7 +72825,7 @@ throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); message.annotation = []; for (var i = 0; i < object.annotation.length; ++i) { - if (!$util.isObject(object.annotation[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], long + 1); } @@ -75148,20 +72842,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options, q) { + GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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, q + 1); + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; @@ -75282,13 +72972,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Annotation.encode = function encode(message, writer, q) { + Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) @@ -75316,7 +73002,7 @@ * @returns {$protobuf.Writer} Writer */ Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -75409,23 +73095,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.path != null && Object.hasOwnProperty.call(message, "path")) { + 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 && Object.hasOwnProperty.call(message, "sourceFile")) + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) if (!$util.isString(message.sourceFile)) return "sourceFile: string expected"; - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + if (message.begin != null && message.hasOwnProperty("begin")) if (!$util.isInteger(message.begin)) return "begin: integer expected"; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + if (message.semantic != null && message.hasOwnProperty("semantic")) switch (message.semantic) { default: return "semantic: enum value expected"; @@ -75448,8 +73134,6 @@ Annotation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -75500,13 +73184,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Annotation.toObject = function toObject(message, options, q) { + Annotation.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.path = []; @@ -75521,13 +73201,13 @@ for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) object.sourceFile = message.sourceFile; - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + if (message.begin != null && message.hasOwnProperty("begin")) object.begin = message.begin; - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + 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; }; @@ -75658,13 +73338,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer, q) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -75682,7 +73358,7 @@ * @returns {$protobuf.Writer} Writer */ Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -75756,10 +73432,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + 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 && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; @@ -75776,8 +73452,6 @@ Duration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Duration) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.Duration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -75785,7 +73459,7 @@ var message = new $root.google.protobuf.Duration(); if (object.seconds != null) if ($util.Long) - message.seconds = $util.Long.fromValue(object.seconds, false); + (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") @@ -75806,30 +73480,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options, q) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.seconds = options.longs === String ? "0" : 0; object.nanos = 0; } - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); - else if (typeof message.seconds === "number") + 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 && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) object.nanos = message.nanos; return object; }; @@ -75917,13 +73585,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encode = function encode(message, writer, q) { + FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -75940,7 +73604,7 @@ * @returns {$protobuf.Writer} Writer */ FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -76012,7 +73676,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.paths != null && Object.hasOwnProperty.call(message, "paths")) { + 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) @@ -76033,8 +73697,6 @@ FieldMask.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldMask) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.FieldMask: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -76059,13 +73721,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options, q) { + FieldMask.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.paths = []; @@ -76168,13 +73826,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer, q) { + Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -76192,7 +73846,7 @@ * @returns {$protobuf.Writer} Writer */ Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -76266,10 +73920,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + if (message.type_url != null && message.hasOwnProperty("type_url")) if (!$util.isString(message.type_url)) return "type_url: string expected"; - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + 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; @@ -76286,8 +73940,6 @@ Any.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Any) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.Any: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -76312,13 +73964,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options, q) { + Any.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.type_url = ""; @@ -76330,9 +73978,9 @@ object.value = $util.newBuffer(object.value); } } - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + if (message.type_url != null && message.hasOwnProperty("type_url")) object.type_url = message.type_url; - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + 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; }; @@ -76410,13 +74058,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, writer, q) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); return writer; }; @@ -76430,7 +74074,7 @@ * @returns {$protobuf.Writer} Writer */ Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -76510,6 +74154,10 @@ Empty.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Empty) return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); return new $root.google.protobuf.Empty(); }; @@ -76617,13 +74265,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer, q) { + Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -76641,7 +74285,7 @@ * @returns {$protobuf.Writer} Writer */ Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -76715,10 +74359,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + 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 && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; @@ -76735,8 +74379,6 @@ Timestamp.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Timestamp) return object; - if (!$util.isObject(object)) - throw TypeError(".google.protobuf.Timestamp: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -76744,7 +74386,7 @@ var message = new $root.google.protobuf.Timestamp(); if (object.seconds != null) if ($util.Long) - message.seconds = $util.Long.fromValue(object.seconds, false); + (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") @@ -76765,30 +74407,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options, q) { + Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.seconds = options.longs === String ? "0" : 0; object.nanos = 0; } - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - if (typeof BigInt !== "undefined" && options.longs === BigInt) - object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); - else if (typeof message.seconds === "number") + 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 && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) object.nanos = message.nanos; return object; }; @@ -76895,7 +74531,7 @@ * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** @@ -76928,7 +74564,7 @@ * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** @@ -76961,7 +74597,7 @@ * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** @@ -77048,19 +74684,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetIamPolicyRequest.encode = function encode(message, writer, q) { + SetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -77074,7 +74706,7 @@ * @returns {$protobuf.Writer} Writer */ SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -77152,15 +74784,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) { + if (message.policy != null && message.hasOwnProperty("policy")) { var error = $root.google.iam.v1.Policy.verify(message.policy, long + 1); if (error) return "policy." + error; } - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; @@ -77179,8 +74811,6 @@ SetIamPolicyRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.SetIamPolicyRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77189,12 +74819,12 @@ if (object.resource != null) message.resource = String(object.resource); if (object.policy != null) { - if (!$util.isObject(object.policy)) + if (typeof object.policy !== "object") throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); message.policy = $root.google.iam.v1.Policy.fromObject(object.policy, long + 1); } if (object.updateMask != null) { - if (!$util.isObject(object.updateMask)) + if (typeof object.updateMask !== "object") throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -77210,25 +74840,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetIamPolicyRequest.toObject = function toObject(message, options, q) { + SetIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resource = ""; object.policy = null; object.updateMask = null; } - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options, q + 1); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + 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; }; @@ -77323,17 +74949,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIamPolicyRequest.encode = function encode(message, writer, q) { + GetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -77347,7 +74969,7 @@ * @returns {$protobuf.Writer} Writer */ GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -77421,10 +75043,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -77443,8 +75065,6 @@ GetIamPolicyRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.GetIamPolicyRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77453,7 +75073,7 @@ if (object.resource != null) message.resource = String(object.resource); if (object.options != null) { - if (!$util.isObject(object.options)) + if (typeof object.options !== "object") throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options, long + 1); } @@ -77469,22 +75089,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIamPolicyRequest.toObject = function toObject(message, options, q) { + GetIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resource = ""; object.options = null; } - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options, q + 1); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); return object; }; @@ -77580,13 +75196,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsRequest.encode = function encode(message, writer, q) { + TestIamPermissionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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) @@ -77605,7 +75217,7 @@ * @returns {$protobuf.Writer} Writer */ TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -77681,10 +75293,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; - if (message.permissions != null && Object.hasOwnProperty.call(message, "permissions")) { + 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) @@ -77705,8 +75317,6 @@ TestIamPermissionsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77733,19 +75343,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestIamPermissionsRequest.toObject = function toObject(message, options, q) { + TestIamPermissionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.permissions = []; if (options.defaults) object.resource = ""; - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; if (message.permissions && message.permissions.length) { object.permissions = []; @@ -77838,13 +75444,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsResponse.encode = function encode(message, writer, q) { + TestIamPermissionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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]); @@ -77861,7 +75463,7 @@ * @returns {$protobuf.Writer} Writer */ TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -77933,7 +75535,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.permissions != null && Object.hasOwnProperty.call(message, "permissions")) { + 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) @@ -77954,8 +75556,6 @@ TestIamPermissionsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77980,13 +75580,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestIamPermissionsResponse.toObject = function toObject(message, options, q) { + TestIamPermissionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.permissions = []; @@ -78080,13 +75676,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetPolicyOptions.encode = function encode(message, writer, q) { + GetPolicyOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); return writer; @@ -78102,7 +75694,7 @@ * @returns {$protobuf.Writer} Writer */ GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -78172,7 +75764,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) if (!$util.isInteger(message.requestedPolicyVersion)) return "requestedPolicyVersion: integer expected"; return null; @@ -78189,8 +75781,6 @@ GetPolicyOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.GetPolicyOptions) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.GetPolicyOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -78210,17 +75800,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetPolicyOptions.toObject = function toObject(message, options, q) { + GetPolicyOptions.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) object.requestedPolicyVersion = message.requestedPolicyVersion; return object; }; @@ -78336,23 +75922,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Policy.encode = function encode(message, writer, q) { + Policy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -78366,7 +75948,7 @@ * @returns {$protobuf.Writer} Writer */ Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -78452,10 +76034,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.version != null && Object.hasOwnProperty.call(message, "version")) + if (message.version != null && message.hasOwnProperty("version")) if (!$util.isInteger(message.version)) return "version: integer expected"; - if (message.bindings != null && Object.hasOwnProperty.call(message, "bindings")) { + 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) { @@ -78464,7 +76046,7 @@ return "bindings." + error; } } - if (message.auditConfigs != null && Object.hasOwnProperty.call(message, "auditConfigs")) { + 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) { @@ -78473,7 +76055,7 @@ return "auditConfigs." + error; } } - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + 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; @@ -78490,8 +76072,6 @@ Policy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.Policy) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.Policy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -78504,7 +76084,7 @@ throw TypeError(".google.iam.v1.Policy.bindings: array expected"); message.bindings = []; for (var i = 0; i < object.bindings.length; ++i) { - if (!$util.isObject(object.bindings[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], long + 1); } @@ -78514,7 +76094,7 @@ throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); message.auditConfigs = []; for (var i = 0; i < object.auditConfigs.length; ++i) { - if (!$util.isObject(object.auditConfigs[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], long + 1); } @@ -78536,13 +76116,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Policy.toObject = function toObject(message, options, q) { + Policy.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.bindings = []; @@ -78558,19 +76134,19 @@ object.etag = $util.newBuffer(object.etag); } } - if (message.version != null && Object.hasOwnProperty.call(message, "version")) + if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + 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, q + 1); + 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, q + 1); + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); } return object; }; @@ -78676,20 +76252,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Binding.encode = function encode(message, writer, q) { + Binding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -78703,7 +76275,7 @@ * @returns {$protobuf.Writer} Writer */ Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -78783,17 +76355,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) if (!$util.isString(message.role)) return "role: string expected"; - if (message.members != null && Object.hasOwnProperty.call(message, "members")) { + 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 && Object.hasOwnProperty.call(message, "condition")) { + if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.type.Expr.verify(message.condition, long + 1); if (error) return "condition." + error; @@ -78812,8 +76384,6 @@ Binding.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.Binding) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.Binding: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -78829,7 +76399,7 @@ message.members[i] = String(object.members[i]); } if (object.condition != null) { - if (!$util.isObject(object.condition)) + if (typeof object.condition !== "object") throw TypeError(".google.iam.v1.Binding.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition, long + 1); } @@ -78845,13 +76415,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Binding.toObject = function toObject(message, options, q) { + Binding.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.members = []; @@ -78859,15 +76425,15 @@ object.role = ""; object.condition = null; } - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + 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 && Object.hasOwnProperty.call(message, "condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options, q + 1); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; @@ -78963,18 +76529,14 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditConfig.encode = function encode(message, writer, q) { + AuditConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -78988,7 +76550,7 @@ * @returns {$protobuf.Writer} Writer */ AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -79064,10 +76626,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.service != null && Object.hasOwnProperty.call(message, "service")) + if (message.service != null && message.hasOwnProperty("service")) if (!$util.isString(message.service)) return "service: string expected"; - if (message.auditLogConfigs != null && Object.hasOwnProperty.call(message, "auditLogConfigs")) { + 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) { @@ -79090,8 +76652,6 @@ AuditConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.AuditConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.AuditConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79104,7 +76664,7 @@ throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); message.auditLogConfigs = []; for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (!$util.isObject(object.auditLogConfigs[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], long + 1); } @@ -79121,24 +76681,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditConfig.toObject = function toObject(message, options, q) { + AuditConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.auditLogConfigs = []; if (options.defaults) object.service = ""; - if (message.service != null && Object.hasOwnProperty.call(message, "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, q + 1); + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); } return object; }; @@ -79235,13 +76791,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditLogConfig.encode = function encode(message, writer, q) { + AuditLogConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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) @@ -79260,7 +76812,7 @@ * @returns {$protobuf.Writer} Writer */ AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -79336,7 +76888,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + if (message.logType != null && message.hasOwnProperty("logType")) switch (message.logType) { default: return "logType: enum value expected"; @@ -79346,7 +76898,7 @@ case 3: break; } - if (message.exemptedMembers != null && Object.hasOwnProperty.call(message, "exemptedMembers")) { + 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) @@ -79367,8 +76919,6 @@ AuditLogConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.AuditLogConfig) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.AuditLogConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79417,19 +76967,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditLogConfig.toObject = function toObject(message, options, q) { + AuditLogConfig.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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 && Object.hasOwnProperty.call(message, "logType")) + 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 = []; @@ -79550,19 +77096,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PolicyDelta.encode = function encode(message, writer, q) { + PolicyDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -79576,7 +77118,7 @@ * @returns {$protobuf.Writer} Writer */ PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -79654,7 +77196,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.bindingDeltas != null && Object.hasOwnProperty.call(message, "bindingDeltas")) { + 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) { @@ -79663,7 +77205,7 @@ return "bindingDeltas." + error; } } - if (message.auditConfigDeltas != null && Object.hasOwnProperty.call(message, "auditConfigDeltas")) { + 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) { @@ -79686,8 +77228,6 @@ PolicyDelta.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.PolicyDelta) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.PolicyDelta: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79698,7 +77238,7 @@ throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); message.bindingDeltas = []; for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (!$util.isObject(object.bindingDeltas[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], long + 1); } @@ -79708,7 +77248,7 @@ throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); message.auditConfigDeltas = []; for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (!$util.isObject(object.auditConfigDeltas[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], long + 1); } @@ -79725,13 +77265,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PolicyDelta.toObject = function toObject(message, options, q) { + PolicyDelta.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.bindingDeltas = []; @@ -79740,12 +77276,12 @@ 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, q + 1); + 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, q + 1); + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); } return object; }; @@ -79859,13 +77395,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BindingDelta.encode = function encode(message, writer, q) { + BindingDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -79873,7 +77405,7 @@ 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(), q + 1).ldelim(); + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -79887,7 +77419,7 @@ * @returns {$protobuf.Writer} Writer */ BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -79969,7 +77501,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.action != null && Object.hasOwnProperty.call(message, "action")) + if (message.action != null && message.hasOwnProperty("action")) switch (message.action) { default: return "action: enum value expected"; @@ -79978,13 +77510,13 @@ case 2: break; } - if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) if (!$util.isString(message.role)) return "role: string expected"; - if (message.member != null && Object.hasOwnProperty.call(message, "member")) + if (message.member != null && message.hasOwnProperty("member")) if (!$util.isString(message.member)) return "member: string expected"; - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) { + if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.type.Expr.verify(message.condition, long + 1); if (error) return "condition." + error; @@ -80003,8 +77535,6 @@ BindingDelta.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.BindingDelta) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.BindingDelta: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80035,7 +77565,7 @@ if (object.member != null) message.member = String(object.member); if (object.condition != null) { - if (!$util.isObject(object.condition)) + if (typeof object.condition !== "object") throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition, long + 1); } @@ -80051,13 +77581,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BindingDelta.toObject = function toObject(message, options, q) { + BindingDelta.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; @@ -80065,14 +77591,14 @@ object.member = ""; object.condition = null; } - if (message.action != null && Object.hasOwnProperty.call(message, "action")) + 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 && Object.hasOwnProperty.call(message, "role")) + if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; - if (message.member != null && Object.hasOwnProperty.call(message, "member")) + if (message.member != null && message.hasOwnProperty("member")) object.member = message.member; - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options, q + 1); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; @@ -80201,13 +77727,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditConfigDelta.encode = function encode(message, writer, q) { + AuditConfigDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -80229,7 +77751,7 @@ * @returns {$protobuf.Writer} Writer */ AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -80311,7 +77833,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.action != null && Object.hasOwnProperty.call(message, "action")) + if (message.action != null && message.hasOwnProperty("action")) switch (message.action) { default: return "action: enum value expected"; @@ -80320,13 +77842,13 @@ case 2: break; } - if (message.service != null && Object.hasOwnProperty.call(message, "service")) + if (message.service != null && message.hasOwnProperty("service")) if (!$util.isString(message.service)) return "service: string expected"; - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) if (!$util.isString(message.exemptedMember)) return "exemptedMember: string expected"; - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + if (message.logType != null && message.hasOwnProperty("logType")) if (!$util.isString(message.logType)) return "logType: string expected"; return null; @@ -80343,8 +77865,6 @@ AuditConfigDelta.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.AuditConfigDelta) return object; - if (!$util.isObject(object)) - throw TypeError(".google.iam.v1.AuditConfigDelta: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80388,13 +77908,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditConfigDelta.toObject = function toObject(message, options, q) { + AuditConfigDelta.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; @@ -80402,13 +77918,13 @@ object.exemptedMember = ""; object.logType = ""; } - if (message.action != null && Object.hasOwnProperty.call(message, "action")) + 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 && Object.hasOwnProperty.call(message, "service")) + if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) object.exemptedMember = message.exemptedMember; - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + if (message.logType != null && message.hasOwnProperty("logType")) object.logType = message.logType; return object; }; @@ -80553,13 +78069,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Expr.encode = function encode(message, writer, q) { + Expr.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -80581,7 +78093,7 @@ * @returns {$protobuf.Writer} Writer */ Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -80663,16 +78175,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + if (message.expression != null && message.hasOwnProperty("expression")) if (!$util.isString(message.expression)) return "expression: string expected"; - if (message.title != null && Object.hasOwnProperty.call(message, "title")) + if (message.title != null && message.hasOwnProperty("title")) if (!$util.isString(message.title)) return "title: string expected"; - if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (message.location != null && message.hasOwnProperty("location")) if (!$util.isString(message.location)) return "location: string expected"; return null; @@ -80689,8 +78201,6 @@ Expr.fromObject = function fromObject(object, long) { if (object instanceof $root.google.type.Expr) return object; - if (!$util.isObject(object)) - throw TypeError(".google.type.Expr: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80716,13 +78226,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Expr.toObject = function toObject(message, options, q) { + Expr.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.expression = ""; @@ -80730,13 +78236,13 @@ object.description = ""; object.location = ""; } - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + if (message.expression != null && message.hasOwnProperty("expression")) object.expression = message.expression; - if (message.title != null && Object.hasOwnProperty.call(message, "title")) + if (message.title != null && message.hasOwnProperty("title")) object.title = message.title; - if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; - if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (message.location != null && message.hasOwnProperty("location")) object.location = message.location; return object; }; @@ -80832,17 +78338,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Interval.encode = function encode(message, writer, q) { + Interval.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -80856,7 +78358,7 @@ * @returns {$protobuf.Writer} Writer */ Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -80930,12 +78432,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + if (message.startTime != null && message.hasOwnProperty("startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + if (message.endTime != null && message.hasOwnProperty("endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; @@ -80954,20 +78456,18 @@ Interval.fromObject = function fromObject(object, long) { if (object instanceof $root.google.type.Interval) return object; - if (!$util.isObject(object)) - throw TypeError(".google.type.Interval: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.type.Interval(); if (object.startTime != null) { - if (!$util.isObject(object.startTime)) + if (typeof object.startTime !== "object") throw TypeError(".google.type.Interval.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.endTime != null) { - if (!$util.isObject(object.endTime)) + if (typeof object.endTime !== "object") throw TypeError(".google.type.Interval.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -80983,22 +78483,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Interval.toObject = function toObject(message, options, q) { + Interval.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.startTime = null; object.endTime = null; } - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; @@ -81102,13 +78598,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Date.encode = function encode(message, writer, q) { + Date.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -81128,7 +78620,7 @@ * @returns {$protobuf.Writer} Writer */ Date.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -81206,13 +78698,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.year != null && Object.hasOwnProperty.call(message, "year")) + if (message.year != null && message.hasOwnProperty("year")) if (!$util.isInteger(message.year)) return "year: integer expected"; - if (message.month != null && Object.hasOwnProperty.call(message, "month")) + if (message.month != null && message.hasOwnProperty("month")) if (!$util.isInteger(message.month)) return "month: integer expected"; - if (message.day != null && Object.hasOwnProperty.call(message, "day")) + if (message.day != null && message.hasOwnProperty("day")) if (!$util.isInteger(message.day)) return "day: integer expected"; return null; @@ -81229,8 +78721,6 @@ Date.fromObject = function fromObject(object, long) { if (object instanceof $root.google.type.Date) return object; - if (!$util.isObject(object)) - throw TypeError(".google.type.Date: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81254,24 +78744,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Date.toObject = function toObject(message, options, q) { + Date.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.year = 0; object.month = 0; object.day = 0; } - if (message.year != null && Object.hasOwnProperty.call(message, "year")) + if (message.year != null && message.hasOwnProperty("year")) object.year = message.year; - if (message.month != null && Object.hasOwnProperty.call(message, "month")) + if (message.month != null && message.hasOwnProperty("month")) object.month = message.month; - if (message.day != null && Object.hasOwnProperty.call(message, "day")) + if (message.day != null && message.hasOwnProperty("day")) object.day = message.day; return object; }; @@ -81369,7 +78855,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); }, "name", { value: "ListOperations" }); /** @@ -81402,7 +78888,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "GetOperation" }); /** @@ -81435,7 +78921,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteOperation" }); /** @@ -81468,7 +78954,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "CancelOperation" }); /** @@ -81501,7 +78987,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return $protobuf.rpc.Service.prototype.rpcCall.call(this, waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "WaitOperation" }); /** @@ -81620,23 +79106,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Operation.encode = function encode(message, writer, q) { + Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $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(), q + 1).ldelim(); + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -81650,7 +79132,7 @@ * @returns {$protobuf.Writer} Writer */ Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -81737,18 +79219,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { + if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.protobuf.Any.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.done != null && Object.hasOwnProperty.call(message, "done")) + if (message.done != null && message.hasOwnProperty("done")) if (typeof message.done !== "boolean") return "done: boolean expected"; - if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + if (message.error != null && message.hasOwnProperty("error")) { properties.result = 1; { var error = $root.google.rpc.Status.verify(message.error, long + 1); @@ -81756,7 +79238,7 @@ return "error." + error; } } - if (message.response != null && Object.hasOwnProperty.call(message, "response")) { + if (message.response != null && message.hasOwnProperty("response")) { if (properties.result === 1) return "result: multiple values"; properties.result = 1; @@ -81780,8 +79262,6 @@ Operation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.Operation) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.Operation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81790,19 +79270,19 @@ if (object.name != null) message.name = String(object.name); if (object.metadata != null) { - if (!$util.isObject(object.metadata)) + if (typeof object.metadata !== "object") throw TypeError(".google.longrunning.Operation.metadata: object expected"); message.metadata = $root.google.protobuf.Any.fromObject(object.metadata, long + 1); } if (object.done != null) message.done = Boolean(object.done); if (object.error != null) { - if (!$util.isObject(object.error)) + if (typeof object.error !== "object") throw TypeError(".google.longrunning.Operation.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); } if (object.response != null) { - if (!$util.isObject(object.response)) + if (typeof object.response !== "object") throw TypeError(".google.longrunning.Operation.response: object expected"); message.response = $root.google.protobuf.Any.fromObject(object.response, long + 1); } @@ -81818,32 +79298,28 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Operation.toObject = function toObject(message, options, q) { + Operation.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.metadata = null; object.done = false; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options, q + 1); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) + 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 && Object.hasOwnProperty.call(message, "error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); + 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 && Object.hasOwnProperty.call(message, "response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options, q + 1); + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); if (options.oneofs) object.result = "response"; } @@ -81932,13 +79408,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOperationRequest.encode = function encode(message, writer, q) { + GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -81954,7 +79426,7 @@ * @returns {$protobuf.Writer} Writer */ GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -82024,7 +79496,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -82041,8 +79513,6 @@ GetOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.GetOperationRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.GetOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82062,17 +79532,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOperationRequest.toObject = function toObject(message, options, q) { + GetOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -82186,13 +79652,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListOperationsRequest.encode = function encode(message, writer, q) { + ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -82214,7 +79676,7 @@ * @returns {$protobuf.Writer} Writer */ ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -82296,16 +79758,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -82322,8 +79784,6 @@ ListOperationsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.ListOperationsRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.ListOperationsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82349,13 +79809,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListOperationsRequest.toObject = function toObject(message, options, q) { + ListOperationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.filter = ""; @@ -82363,13 +79819,13 @@ object.pageToken = ""; object.name = ""; } - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -82466,16 +79922,12 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListOperationsResponse.encode = function encode(message, writer, q) { + ListOperationsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $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; @@ -82491,7 +79943,7 @@ * @returns {$protobuf.Writer} Writer */ ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -82567,7 +80019,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operations != null && Object.hasOwnProperty.call(message, "operations")) { + 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) { @@ -82576,7 +80028,7 @@ return "operations." + error; } } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -82593,8 +80045,6 @@ ListOperationsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.ListOperationsResponse) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.ListOperationsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82605,7 +80055,7 @@ throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { - if (!$util.isObject(object.operations[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], long + 1); } @@ -82624,13 +80074,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListOperationsResponse.toObject = function toObject(message, options, q) { + ListOperationsResponse.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.operations = []; @@ -82639,9 +80085,9 @@ 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, q + 1); + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); } - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -82728,13 +80174,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelOperationRequest.encode = function encode(message, writer, q) { + CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -82750,7 +80192,7 @@ * @returns {$protobuf.Writer} Writer */ CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -82820,7 +80262,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -82837,8 +80279,6 @@ CancelOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.CancelOperationRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.CancelOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82858,17 +80298,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CancelOperationRequest.toObject = function toObject(message, options, q) { + CancelOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -82955,13 +80391,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteOperationRequest.encode = function encode(message, writer, q) { + DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -82977,7 +80409,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -83047,7 +80479,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -83064,8 +80496,6 @@ DeleteOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.DeleteOperationRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.DeleteOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83085,17 +80515,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteOperationRequest.toObject = function toObject(message, options, q) { + DeleteOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; @@ -83191,17 +80617,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WaitOperationRequest.encode = function encode(message, writer, q) { + WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -83215,7 +80637,7 @@ * @returns {$protobuf.Writer} Writer */ WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -83289,10 +80711,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) { + if (message.timeout != null && message.hasOwnProperty("timeout")) { var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); if (error) return "timeout." + error; @@ -83311,8 +80733,6 @@ WaitOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.WaitOperationRequest) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.WaitOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83321,7 +80741,7 @@ if (object.name != null) message.name = String(object.name); if (object.timeout != null) { - if (!$util.isObject(object.timeout)) + if (typeof object.timeout !== "object") throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); } @@ -83337,22 +80757,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WaitOperationRequest.toObject = function toObject(message, options, q) { + WaitOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.timeout = null; } - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options, q + 1); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); return object; }; @@ -83447,13 +80863,9 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationInfo.encode = function encode(message, writer, q) { + OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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")) @@ -83471,7 +80883,7 @@ * @returns {$protobuf.Writer} Writer */ OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -83545,10 +80957,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + if (message.responseType != null && message.hasOwnProperty("responseType")) if (!$util.isString(message.responseType)) return "responseType: string expected"; - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + if (message.metadataType != null && message.hasOwnProperty("metadataType")) if (!$util.isString(message.metadataType)) return "metadataType: string expected"; return null; @@ -83565,8 +80977,6 @@ OperationInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.OperationInfo) return object; - if (!$util.isObject(object)) - throw TypeError(".google.longrunning.OperationInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83588,21 +80998,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationInfo.toObject = function toObject(message, options, q) { + OperationInfo.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.responseType = ""; object.metadataType = ""; } - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + if (message.responseType != null && message.hasOwnProperty("responseType")) object.responseType = message.responseType; - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + if (message.metadataType != null && message.hasOwnProperty("metadataType")) object.metadataType = message.metadataType; return object; }; @@ -83720,20 +81126,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Status.encode = function encode(message, writer, q) { + Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); 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(), q + 1).ldelim(); + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -83747,7 +81149,7 @@ * @returns {$protobuf.Writer} Writer */ Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + return this.encode(message, writer).ldelim(); }; /** @@ -83827,13 +81229,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.code != null && Object.hasOwnProperty.call(message, "code")) + if (message.code != null && message.hasOwnProperty("code")) if (!$util.isInteger(message.code)) return "code: integer expected"; - if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (message.message != null && message.hasOwnProperty("message")) if (!$util.isString(message.message)) return "message: string expected"; - if (message.details != null && Object.hasOwnProperty.call(message, "details")) { + 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) { @@ -83856,8 +81258,6 @@ Status.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.Status) return object; - if (!$util.isObject(object)) - throw TypeError(".google.rpc.Status: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83872,7 +81272,7 @@ throw TypeError(".google.rpc.Status.details: array expected"); message.details = []; for (var i = 0; i < object.details.length; ++i) { - if (!$util.isObject(object.details[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], long + 1); } @@ -83889,13 +81289,9 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Status.toObject = function toObject(message, options, q) { + Status.toObject = function toObject(message, options) { if (!options) options = {}; - if (q === undefined) - q = 0; - if (q > $util.recursionLimit) - throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.details = []; @@ -83903,14 +81299,14 @@ object.code = 0; object.message = ""; } - if (message.code != null && Object.hasOwnProperty.call(message, "code")) + if (message.code != null && message.hasOwnProperty("code")) object.code = message.code; - if (message.message != null && Object.hasOwnProperty.call(message, "message")) + 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, q + 1); + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); } return object; }; diff --git a/packages/google-storage-control/src/util/index_fix_utils.ts b/packages/google-storage-control/src/util/index_fix_utils.ts index 645b92f74dd1..b7d987480c4b 100644 --- a/packages/google-storage-control/src/util/index_fix_utils.ts +++ b/packages/google-storage-control/src/util/index_fix_utils.ts @@ -15,16 +15,7 @@ import * as fs from 'fs'; import * as path from 'path'; -/** - * Fixes the content of an index file by overwriting it with a predefined correct content. - * This function is specifically designed to correct `synthtool`-generated index files - * to ensure the proper export of `v2`, `StorageControlClient`, and `protos`. - * - * @param filePath The path to the index file to fix, relative to the project root. - */ -export function fixIndexFile(filePath: string): void { - const fullPath = path.join(__dirname, '..', '..', filePath); - const correctContent = `// Copyright 2026 Google LLC +const LICENSE_HEADER = `// 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. @@ -37,7 +28,18 @@ export function fixIndexFile(filePath: string): void { // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +//`; + +/** + * Fixes the content of an index file by overwriting it with a predefined correct content. + * This function is specifically designed to correct `synthtool`-generated index files + * to ensure the proper export of `v2`, `StorageControlClient`, and `protos`. + * + * @param filePath The path to the index file to fix, relative to the project root. + */ +export function fixIndexFile(filePath: string): void { + const fullPath = path.join(__dirname, '..', '..', filePath); + const correctContent = `${LICENSE_HEADER} // ** This file is automatically generated by synthtool. ** // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** @@ -66,19 +68,20 @@ export {protos}; * @param filePath The path to the v2 index file to fix, relative to the current directory. */ export function fixV2Index(filePath: string): void { - // TODO: this function can be removed when the nodejs_gapic_combined_pkg correctly exports from both libraries. const fullPath = path.join(__dirname, '..', filePath); - if (fs.existsSync(fullPath)) { - try { - const data = fs.readFileSync(fullPath, 'utf8'); - if (!data.includes("export {StorageClient} from './storage_client';")) { - const result = - data + "\nexport {StorageClient} from './storage_client';"; - fs.writeFileSync(fullPath, result, 'utf8'); - console.log(`Successfully fixed: ${fullPath}`); - } - } catch (err) { - console.error(`Error processing file ${fullPath}:`, err); - } + const correctContent = `${LICENSE_HEADER} +// ** 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'; +export {StorageClient} from './storage_client'; +`; + + try { + fs.writeFileSync(fullPath, correctContent, 'utf8'); + console.log(`Successfully fixed: ${fullPath}`); + } catch (err) { + console.error(`Error writing to file ${fullPath}:`, err); } } diff --git a/packages/google-storage-control/src/util/proto_utils.ts b/packages/google-storage-control/src/util/proto_utils.ts index b22659e4cc73..533cacfe656e 100644 --- a/packages/google-storage-control/src/util/proto_utils.ts +++ b/packages/google-storage-control/src/util/proto_utils.ts @@ -17,6 +17,9 @@ import * as path from 'path'; export const filesToUpdate: string[] = [ 'protos/google/storage/v2/storage.proto', + 'protos/protos.d.ts', + 'protos/protos.js', + 'protos/protos.json', ]; export interface Replacement { @@ -26,8 +29,19 @@ export interface Replacement { export const replacements: Replacement[] = [ { - pattern: /\bObject\b/g, - replacement: 'StorageObject', + // Rename Object and IObject to StorageObject and IStorageObject (Global, skipped for protos.js) + pattern: /\b(I)?Object\b/g, + replacement: '$1StorageObject', + }, + { + // Correct articles: "an StorageObject" -> "a StorageObject" (Global, skipped for protos.js) + pattern: /\b([Aa])n StorageObject\b/g, + replacement: '$1 StorageObject', + }, + { + // Rename namespace-prefixed object/Iobject/Object/IObject references (Safe for all files) + pattern: /\b((\$root\.)?google\.storage\.v2\.)(I)?[Oo]bject\b/g, + replacement: '$1$3StorageObject', }, ]; @@ -45,6 +59,14 @@ export function cleanObjectReferences( const fullPath = path.join(__dirname, '..', '..', filePath); if (fs.existsSync(fullPath)) { replacements.forEach(({pattern, replacement}) => { + // Skip global Object and article replacements for protos.js to avoid corrupting native JS methods + if ( + filePath.endsWith('protos.js') && + (pattern.toString() === '/\\b(I)?Object\\b/g' || + pattern.toString() === '/\\b([Aa])n StorageObject\\b/g') + ) { + return; + } try { const data = fs.readFileSync(fullPath, 'utf8'); const result = data.replace(pattern, replacement); diff --git a/packages/google-storage-control/src/util/samples_and_doc_fix_utils.ts b/packages/google-storage-control/src/util/samples_and_doc_fix_utils.ts index f6807ae42c35..452f14fa078c 100644 --- a/packages/google-storage-control/src/util/samples_and_doc_fix_utils.ts +++ b/packages/google-storage-control/src/util/samples_and_doc_fix_utils.ts @@ -40,7 +40,7 @@ export function updateSamples() { let content = fs.readFileSync(filePath, 'utf8'); content = content.replace( - /const\s+\{StorageClient\}\s*=\s*require\('@google-cloud\/storage'\)\.v2;/g, + /const\s+\{StorageClient\}\s*=\s*require\('@google-cloud\/(storage|storage-control)'\)\.v2;/g, "const {StorageControlClient} = require('@google-cloud/storage-control');", ); diff --git a/packages/google-storage-control/src/v2/index.ts b/packages/google-storage-control/src/v2/index.ts index 2017cc9d1a21..ef2e551d7e1c 100644 --- a/packages/google-storage-control/src/v2/index.ts +++ b/packages/google-storage-control/src/v2/index.ts @@ -16,6 +16,5 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export { StorageControlClient } from './storage_control_client'; - -export {StorageClient} from './storage_client'; \ No newline at end of file +export {StorageControlClient} from './storage_control_client'; +export {StorageClient} from './storage_client'; diff --git a/packages/google-storage-control/src/v2/storage_client.ts b/packages/google-storage-control/src/v2/storage_client.ts index a2384eccfa8a..c51051ef8307 100644 --- a/packages/google-storage-control/src/v2/storage_client.ts +++ b/packages/google-storage-control/src/v2/storage_client.ts @@ -80,7 +80,7 @@ export class StorageClient { private _defaults: { [method: string]: gax.CallSettings }; private _universeDomain: string; private _servicePath: string; - private _log = logging.log('storage'); + private _log = logging.log('storage-control'); auth: gax.GoogleAuth; descriptors: Descriptors = {