From 723d429fc69717376df5ee5fcbb620311080b3fe Mon Sep 17 00:00:00 2001 From: "owlbot-bootstrapper[bot]" <104649659+owlbot-bootstrapper[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 11:36:59 -0700 Subject: [PATCH 1/2] feat: add initial files for google.maps.routeoptimization.v1 (#5362) * feat: initial commit * feat: initial generation of library Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGVvcHRpbWl6YXRpb24vLk93bEJvdC55YW1sIiwiaCI6Ijc3YmNiZTI2NzU1MjhlZWMxNWRjNDZjYWViZWZmMmRiOWRlOTY1NDMifQ== --------- Co-authored-by: Owlbot Bootstrapper Co-authored-by: Owl Bot Co-authored-by: Daniel Bankhead Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> Co-authored-by: Sofia Leon --- .../.OwlBot.yaml | 19 + .../.eslintignore | 7 + .../.eslintrc.json | 3 + .../.gitattributes | 4 + .../google-maps-routeoptimization/.gitignore | 14 + .../google-maps-routeoptimization/.jsdoc.js | 55 + .../google-maps-routeoptimization/.mocharc.js | 29 + packages/google-maps-routeoptimization/.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 17 + .../.repo-metadata.json | 17 + .../CODE_OF_CONDUCT.md | 94 + .../CONTRIBUTING.md | 76 + .../google-maps-routeoptimization/LICENSE | 202 + .../google-maps-routeoptimization/README.md | 365 + .../package.json | 70 + .../v1/route_optimization_service.proto | 2537 ++ .../protos/protos.d.ts | 13382 ++++++ .../protos/protos.js | 36681 ++++++++++++++++ .../protos/protos.json | 3583 ++ .../samples/README.md | 86 + ...route_optimization.batch_optimize_tours.js | 72 + .../v1/route_optimization.optimize_tours.js | 254 + ...data_google.maps.routeoptimization.v1.json | 163 + .../samples/package.json | 24 + .../samples/quickstart.js | 290 + .../samples/test/quickstart.js | 41 + .../src/index.ts | 27 + .../src/v1/gapic_metadata.json | 43 + .../src/v1/index.ts | 19 + .../src/v1/route_optimization_client.ts | 1046 + .../v1/route_optimization_client_config.json | 47 + .../src/v1/route_optimization_proto_list.json | 3 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../system-test/install.ts | 51 + .../test/gapic_route_optimization_v1.ts | 932 + .../tsconfig.json | 19 + .../webpack.config.js | 64 + release-please-config.json | 3 +- 40 files changed, 60427 insertions(+), 1 deletion(-) create mode 100644 packages/google-maps-routeoptimization/.OwlBot.yaml create mode 100644 packages/google-maps-routeoptimization/.eslintignore create mode 100644 packages/google-maps-routeoptimization/.eslintrc.json create mode 100644 packages/google-maps-routeoptimization/.gitattributes create mode 100644 packages/google-maps-routeoptimization/.gitignore create mode 100644 packages/google-maps-routeoptimization/.jsdoc.js create mode 100644 packages/google-maps-routeoptimization/.mocharc.js create mode 100644 packages/google-maps-routeoptimization/.nycrc create mode 100644 packages/google-maps-routeoptimization/.prettierignore create mode 100644 packages/google-maps-routeoptimization/.prettierrc.js create mode 100644 packages/google-maps-routeoptimization/.repo-metadata.json create mode 100644 packages/google-maps-routeoptimization/CODE_OF_CONDUCT.md create mode 100644 packages/google-maps-routeoptimization/CONTRIBUTING.md create mode 100644 packages/google-maps-routeoptimization/LICENSE create mode 100644 packages/google-maps-routeoptimization/README.md create mode 100644 packages/google-maps-routeoptimization/package.json create mode 100644 packages/google-maps-routeoptimization/protos/google/maps/routeoptimization/v1/route_optimization_service.proto create mode 100644 packages/google-maps-routeoptimization/protos/protos.d.ts create mode 100644 packages/google-maps-routeoptimization/protos/protos.js create mode 100644 packages/google-maps-routeoptimization/protos/protos.json create mode 100644 packages/google-maps-routeoptimization/samples/README.md create mode 100644 packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js create mode 100644 packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js create mode 100644 packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json create mode 100644 packages/google-maps-routeoptimization/samples/package.json create mode 100644 packages/google-maps-routeoptimization/samples/quickstart.js create mode 100644 packages/google-maps-routeoptimization/samples/test/quickstart.js create mode 100644 packages/google-maps-routeoptimization/src/index.ts create mode 100644 packages/google-maps-routeoptimization/src/v1/gapic_metadata.json create mode 100644 packages/google-maps-routeoptimization/src/v1/index.ts create mode 100644 packages/google-maps-routeoptimization/src/v1/route_optimization_client.ts create mode 100644 packages/google-maps-routeoptimization/src/v1/route_optimization_client_config.json create mode 100644 packages/google-maps-routeoptimization/src/v1/route_optimization_proto_list.json create mode 100644 packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-maps-routeoptimization/system-test/install.ts create mode 100644 packages/google-maps-routeoptimization/test/gapic_route_optimization_v1.ts create mode 100644 packages/google-maps-routeoptimization/tsconfig.json create mode 100644 packages/google-maps-routeoptimization/webpack.config.js diff --git a/packages/google-maps-routeoptimization/.OwlBot.yaml b/packages/google-maps-routeoptimization/.OwlBot.yaml new file mode 100644 index 00000000000..2f293d70804 --- /dev/null +++ b/packages/google-maps-routeoptimization/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/maps/routeoptimization/(.*)/.*-nodejs + dest: /owl-bot-staging/google-maps-routeoptimization/$1 + +api-name: routeoptimization \ No newline at end of file diff --git a/packages/google-maps-routeoptimization/.eslintignore b/packages/google-maps-routeoptimization/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-maps-routeoptimization/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-maps-routeoptimization/.eslintrc.json b/packages/google-maps-routeoptimization/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-maps-routeoptimization/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-maps-routeoptimization/.gitattributes b/packages/google-maps-routeoptimization/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-maps-routeoptimization/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-maps-routeoptimization/.gitignore b/packages/google-maps-routeoptimization/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-maps-routeoptimization/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-maps-routeoptimization/.jsdoc.js b/packages/google-maps-routeoptimization/.jsdoc.js new file mode 100644 index 00000000000..1237b1bad9d --- /dev/null +++ b/packages/google-maps-routeoptimization/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@googlemaps/routeoptimization', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-maps-routeoptimization/.mocharc.js b/packages/google-maps-routeoptimization/.mocharc.js new file mode 100644 index 00000000000..7e843ab5a75 --- /dev/null +++ b/packages/google-maps-routeoptimization/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-maps-routeoptimization/.nycrc b/packages/google-maps-routeoptimization/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-maps-routeoptimization/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-maps-routeoptimization/.prettierignore b/packages/google-maps-routeoptimization/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-maps-routeoptimization/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-maps-routeoptimization/.prettierrc.js b/packages/google-maps-routeoptimization/.prettierrc.js new file mode 100644 index 00000000000..120c6aa3e6e --- /dev/null +++ b/packages/google-maps-routeoptimization/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-maps-routeoptimization/.repo-metadata.json b/packages/google-maps-routeoptimization/.repo-metadata.json new file mode 100644 index 00000000000..25245bc61f4 --- /dev/null +++ b/packages/google-maps-routeoptimization/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "routeoptimization", + "name_pretty": "Route Optimization API", + "product_documentation": "https://developers.google.com/maps/documentation/route-optimization", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/routeoptimization/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@googlemaps/routeoptimization", + "api_id": "routeoptimization.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "routeoptimization" +} + diff --git a/packages/google-maps-routeoptimization/CODE_OF_CONDUCT.md b/packages/google-maps-routeoptimization/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-maps-routeoptimization/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-maps-routeoptimization/CONTRIBUTING.md b/packages/google-maps-routeoptimization/CONTRIBUTING.md new file mode 100644 index 00000000000..692666bd2e6 --- /dev/null +++ b/packages/google-maps-routeoptimization/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Route Optimization API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=routeoptimization.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-maps-routeoptimization/LICENSE b/packages/google-maps-routeoptimization/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-maps-routeoptimization/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-maps-routeoptimization/README.md b/packages/google-maps-routeoptimization/README.md new file mode 100644 index 00000000000..a0e7ba754d4 --- /dev/null +++ b/packages/google-maps-routeoptimization/README.md @@ -0,0 +1,365 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Route Optimization API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@googlemaps/routeoptimization.svg)](https://www.npmjs.org/package/@googlemaps/routeoptimization) + + + + +Route Optimization API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization/CHANGELOG.md). + +* [Route Optimization API Node.js Client API Reference][client-docs] +* [Route Optimization API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-maps-routeoptimization](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Route Optimization API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @googlemaps/routeoptimization +``` + + +### Using the client library + +```javascript +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + */ +// const parent = 'abc123' +/** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + */ +// const timeout = {} +/** + * Shipment model to solve. + */ +// const model = {} +/** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + */ +// const solvingMode = {} +/** + * Search mode used to solve the request. + */ +// const searchMode = {} +/** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits0.start_time <= visits1.start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * Shipment.allowed_vehicle_indices google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices + * is empty or its `vehicle_index` is included in + * Shipment.allowed_vehicle_indices google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + */ +// const injectedFirstSolutionRoutes = [1,2,3,4] +/** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + */ +// const injectedSolutionConstraint = {} +/** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + */ +// const refreshDetailsRoutes = [1,2,3,4] +/** + * If true: + * * uses + * ShipmentRoute.vehicle_label google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * ShipmentRoute.vehicle_index google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index + * to new + * ShipmentRoute.vehicle_index google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index + * to update + * ConstraintRelaxation.vehicle_indices google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * ShipmentRoute.Visit.shipment_label google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label + * instead of + * SkippedShipment.index google.maps.routeoptimization.v1.SkippedShipment.index + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * Vehicle.label google.maps.routeoptimization.v1.Vehicle.label in the + * request; + * * Shipment.label google.maps.routeoptimization.v1.Shipment.label in + * the request; + * * ShipmentRoute.vehicle_label google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label in the injected solution; + * * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label and ShipmentRoute.Visit.shipment_label google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * Vehicle.label google.maps.routeoptimization.v1.Vehicle.label (resp. + * Shipment.label google.maps.routeoptimization.v1.Shipment.label) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + */ +// const interpretInjectedSolutionsUsingLabels = true +/** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * Transition.travel_duration google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration, + * Visit.start_time google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time, + * and `vehicle_end_time`; in setting the + * ShipmentRoute.has_traffic_infeasibilities google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities + * field, and in calculating the + * OptimizeToursResponse.total_cost google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost + * field. + */ +// const considerRoadTraffic = true +/** + * If true, polylines will be populated in response `ShipmentRoute`s. + */ +// const populatePolylines = true +/** + * If true, polylines will be populated in response + * ShipmentRoute.transitions google.maps.routeoptimization.v1.ShipmentRoute.transitions. + */ +// const populateTransitionPolylines = true +/** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + */ +// const allowLargeDeadlineDespiteInterruptionRisk = true +/** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + */ +// const useGeodesicDistances = true +/** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + */ +// const geodesicMetersPerSecond = 1234 +/** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * OptimizeToursResponse.validation_errors google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors + * field. + * This defaults to 100 and is capped at 10,000. + */ +// const maxValidationErrors = 1234 +/** + * Label that may be used to identify this request, reported back in the + * OptimizeToursResponse.request_label google.maps.routeoptimization.v1.OptimizeToursResponse.request_label. + */ +// const label = 'abc123' + +// Imports the Routeoptimization library +const {RouteOptimizationClient} = require('@googlemaps/routeoptimization').v1; + +// Instantiates a client +const routeoptimizationClient = new RouteOptimizationClient(); + +async function callOptimizeTours() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const response = await routeoptimizationClient.optimizeTours(request); + console.log(response); +} + +callOptimizeTours(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Route_optimization.batch_optimize_tours | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js,packages/google-maps-routeoptimization/samples/README.md) | +| Route_optimization.optimize_tours | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js,packages/google-maps-routeoptimization/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routeoptimization/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routeoptimization/samples/quickstart.js,packages/google-maps-routeoptimization/samples/README.md) | + + + +The [Route Optimization API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @googlemaps/routeoptimization@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/routeoptimization/latest +[product-docs]: https://developers.google.com/maps/documentation/route-optimization +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=routeoptimization.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-maps-routeoptimization/package.json b/packages/google-maps-routeoptimization/package.json new file mode 100644 index 00000000000..e526ec89f85 --- /dev/null +++ b/packages/google-maps-routeoptimization/package.json @@ -0,0 +1,70 @@ +{ + "name": "@googlemaps/routeoptimization", + "version": "0.0.0", + "description": "Route Optimization API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-maps-routeoptimization" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google routeoptimization", + "routeoptimization", + "Route Optimization API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^17.0.0", + "c8": "^9.0.0", + "gapic-tools": "^0.4.0", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^2.0.0", + "sinon": "^17.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-maps-routeoptimization/protos/google/maps/routeoptimization/v1/route_optimization_service.proto b/packages/google-maps-routeoptimization/protos/google/maps/routeoptimization/v1/route_optimization_service.proto new file mode 100644 index 00000000000..26b51bd3cdb --- /dev/null +++ b/packages/google-maps-routeoptimization/protos/google/maps/routeoptimization/v1/route_optimization_service.proto @@ -0,0 +1,2537 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routeoptimization.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/latlng.proto"; + +option csharp_namespace = "Google.Maps.RouteOptimization.V1"; +option go_package = "cloud.google.com/go/maps/routeoptimization/apiv1/routeoptimizationpb;routeoptimizationpb"; +option java_multiple_files = true; +option java_outer_classname = "RouteOptimizationServiceProto"; +option java_package = "com.google.maps.routeoptimization.v1"; +option php_namespace = "Google\\Maps\\RouteOptimization\\V1"; +option ruby_package = "Google::Maps::RouteOptimization::V1"; + +// A service for optimizing vehicle tours. +// +// Validity of certain types of fields: +// +// * `google.protobuf.Timestamp` +// * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00. +// * seconds must be in [0, 253402300799], +// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. +// * nanos must be unset or set to 0. +// * `google.protobuf.Duration` +// * seconds must be in [0, 253402300799], +// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. +// * nanos must be unset or set to 0. +// * `google.type.LatLng` +// * latitude must be in [-90.0, 90.0]. +// * longitude must be in [-180.0, 180.0]. +// * at least one of latitude and longitude must be non-zero. +// +service RouteOptimization { + option (google.api.default_host) = "routeoptimization.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + // `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of + // routes to be performed by vehicles minimizing the overall cost. + // + // A `ShipmentModel` model consists mainly of `Shipment`s that need to be + // carried out and `Vehicle`s that can be used to transport the `Shipment`s. + // The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, + // they assign a series of `Visit`s to each vehicle, where a `Visit` + // corresponds to a `VisitRequest`, which is a pickup or delivery for a + // `Shipment`. + // + // The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that + // minimizes the total cost where cost has many components defined in the + // `ShipmentModel`. + rpc OptimizeTours(OptimizeToursRequest) returns (OptimizeToursResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:optimizeTours" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*}:optimizeTours" + body: "*" + } + }; + } + + // Optimizes vehicle tours for one or more `OptimizeToursRequest` + // messages as a batch. + // + // This method is a Long Running Operation (LRO). The inputs for optimization + // (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` + // messages) are read/written from/to Cloud Storage in user-specified + // format. Like the `OptimizeTours` method, each `OptimizeToursRequest` + // contains a `ShipmentModel` and returns an `OptimizeToursResponse` + // containing `ShipmentRoute`s, which are a set of routes to be performed by + // vehicles minimizing the overall cost. + rpc BatchOptimizeTours(BatchOptimizeToursRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:batchOptimizeTours" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*}:batchOptimizeTours" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "BatchOptimizeToursResponse" + metadata_type: "BatchOptimizeToursMetadata" + }; + } +} + +// Request to batch optimize tours as an asynchronous operation. +// Each input file should contain one `OptimizeToursRequest`, and each output +// file will contain one `OptimizeToursResponse`. The request contains +// information to read/write and parse the files. All the input and output files +// should be under the same project. +message BatchOptimizeToursRequest { + // Information for solving one optimization model asynchronously. + message AsyncModelConfig { + // Optional. User defined model name, can be used as alias by users to keep + // track of models. + string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Information about the input model. + InputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired output location information. + OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Target project and location to make a call. + // + // Format: + // * `projects/{project-id}` + // * `projects/{project-id}/locations/{location-id}` + // + // If no location is specified, a region will be chosen automatically. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input/Output information each purchase model, such as file paths + // and data formats. + repeated AsyncModelConfig model_configs = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response to a `BatchOptimizeToursRequest`. This is returned in +// the Long Running Operation after the operation is complete. +message BatchOptimizeToursResponse {} + +// Operation metadata for `BatchOptimizeToursRequest` calls. +message BatchOptimizeToursMetadata {} + +// Request to be given to a tour optimization solver which defines the +// shipment model to solve as well as optimization parameters. +message OptimizeToursRequest { + // Defines how the solver should handle the request. In all modes but + // `VALIDATE_ONLY`, if the request is invalid, you will receive an + // `INVALID_REQUEST` error. See + // [max_validation_errors][google.maps.routeoptimization.v1.OptimizeToursRequest.max_validation_errors] + // to cap the number of errors returned. + enum SolvingMode { + // Solve the model. + DEFAULT_SOLVE = 0; + + // Only validates the model without solving it: populates as many + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // as possible. + VALIDATE_ONLY = 1; + + // Only populates + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // or + // [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments], + // and doesn't actually solve the rest of the request (`status` and `routes` + // are unset in the response). + // If infeasibilities in `injected_solution_constraint` routes are detected + // they are populated in the + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // field and + // [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments] + // is left empty. + // + // *IMPORTANT*: not all infeasible shipments are returned here, but only the + // ones that are detected as infeasible during preprocessing. + DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + } + + // Mode defining the behavior of the search, trading off latency versus + // solution quality. In all modes, the global request deadline is enforced. + enum SearchMode { + // Unspecified search mode, equivalent to `RETURN_FAST`. + SEARCH_MODE_UNSPECIFIED = 0; + + // Stop the search after finding the first good solution. + RETURN_FAST = 1; + + // Spend all the available time to search for better solutions. + CONSUME_ALL_AVAILABLE_TIME = 2; + } + + // Required. Target project or location to make a call. + // + // Format: + // * `projects/{project-id}` + // * `projects/{project-id}/locations/{location-id}` + // + // If no location is specified, a region will be chosen automatically. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // If this timeout is set, the server returns a response before the timeout + // period has elapsed or the server deadline for synchronous requests is + // reached, whichever is sooner. + // + // For asynchronous requests, the server will generate a solution (if + // possible) before the timeout has elapsed. + google.protobuf.Duration timeout = 2; + + // Shipment model to solve. + ShipmentModel model = 3; + + // By default, the solving mode is `DEFAULT_SOLVE` (0). + SolvingMode solving_mode = 4; + + // Search mode used to solve the request. + SearchMode search_mode = 6; + + // Guide the optimization algorithm in finding a first solution that is + // similar to a previous solution. + // + // The model is constrained when the first solution is built. + // Any shipments not performed on a route are implicitly skipped in the first + // solution, but they may be performed in successive solutions. + // + // The solution must satisfy some basic validity assumptions: + // + // * for all routes, `vehicle_index` must be in range and not be duplicated. + // * for all visits, `shipment_index` and `visit_request_index` must be + // in range. + // * a shipment may only be referenced on one route. + // * the pickup of a pickup-delivery shipment must be performed before + // the delivery. + // * no more than one pickup alternative or delivery alternative of + // a shipment may be performed. + // * for all routes, times are increasing (i.e., `vehicle_start_time + // <= visits[0].start_time <= visits[1].start_time ... + // <= vehicle_end_time`). + // * a shipment may only be performed on a vehicle that is allowed. A + // vehicle is allowed if + // [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + // is empty or its `vehicle_index` is included in + // [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + // + // If the injected solution is not feasible, a validation error is not + // necessarily returned and an error indicating infeasibility may be returned + // instead. + repeated ShipmentRoute injected_first_solution_routes = 7; + + // Constrain the optimization algorithm to find a final solution that is + // similar to a previous solution. For example, this may be used to freeze + // portions of routes which have already been completed or which are to be + // completed but must not be modified. + // + // If the injected solution is not feasible, a validation error is not + // necessarily returned and an error indicating infeasibility may be returned + // instead. + InjectedSolutionConstraint injected_solution_constraint = 8; + + // If non-empty, the given routes will be refreshed, without modifying their + // underlying sequence of visits or travel times: only other details will be + // updated. This does not solve the model. + // + // As of 2020/11, this only populates the polylines of non-empty routes and + // requires that `populate_polylines` is true. + // + // The `route_polyline` fields of the passed-in routes may be inconsistent + // with route `transitions`. + // + // This field must not be used together with `injected_first_solution_routes` + // or `injected_solution_constraint`. + // + // `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + // Polylines are still populated between all visits in all non-empty routes + // regardless of whether the related shipments or vehicles are ignored. + repeated ShipmentRoute refresh_details_routes = 9; + + // If true: + // + // * uses + // [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + // instead of `vehicle_index` to + // match routes in an injected solution with vehicles in the request; + // reuses the mapping of original + // [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + // to new + // [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + // to update + // [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + // if non-empty, but the mapping must be unambiguous (i.e., multiple + // `ShipmentRoute`s must not share the same original `vehicle_index`). + // * uses + // [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + // instead of `shipment_index` + // to match visits in an injected solution with shipments in the request; + // * uses + // [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + // instead of + // [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + // to + // match skipped shipments in the injected solution with request + // shipments. + // + // This interpretation applies to the `injected_first_solution_routes`, + // `injected_solution_constraint`, and `refresh_details_routes` fields. + // It can be used when shipment or vehicle indices in the request have + // changed since the solution was created, perhaps because shipments or + // vehicles have been removed from or added to the request. + // + // If true, labels in the following categories must appear at most once in + // their category: + // + // * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + // request; + // * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + // the request; + // * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + // * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + // the injected solution (except pickup/delivery visit pairs, whose + // `shipment_label` must appear twice). + // + // If a `vehicle_label` in the injected solution does not correspond to a + // request vehicle, the corresponding route is removed from the solution + // along with its visits. If a `shipment_label` in the injected solution does + // not correspond to a request shipment, the corresponding visit is removed + // from the solution. If a + // [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + // in the injected solution does not correspond to a request shipment, the + // `SkippedShipment` is removed from the solution. + // + // Removing route visits or entire routes from an injected solution may + // have an effect on the implied constraints, which may lead to change in + // solution, validation errors, or infeasibility. + // + // NOTE: The caller must ensure that each + // [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + // [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + // identifies a vehicle (resp. shipment) entity used across the two relevant + // requests: the past request that produced the `OptimizeToursResponse` used + // in the injected solution and the current request that includes the injected + // solution. The uniqueness checks described above are not enough to guarantee + // this requirement. + bool interpret_injected_solutions_using_labels = 10; + + // Consider traffic estimation in calculating `ShipmentRoute` fields + // [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + // [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + // and `vehicle_end_time`; in setting the + // [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + // field, and in calculating the + // [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + // field. + bool consider_road_traffic = 11; + + // If true, polylines will be populated in response `ShipmentRoute`s. + bool populate_polylines = 12; + + // If true, polylines will be populated in response + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + bool populate_transition_polylines = 13; + + // If this is set, then the request can have a deadline + // (see https://grpc.io/blog/deadlines) of up to 60 minutes. + // Otherwise, the maximum deadline is only 30 minutes. + // Note that long-lived requests have a significantly larger (but still small) + // risk of interruption. + bool allow_large_deadline_despite_interruption_risk = 14; + + // If true, travel distances will be computed using geodesic distances instead + // of Google Maps distances, and travel times will be computed using geodesic + // distances with a speed defined by `geodesic_meters_per_second`. + bool use_geodesic_distances = 15; + + // When `use_geodesic_distances` is true, this field must be set and defines + // the speed applied to compute travel times. Its value must be at least 1.0 + // meters/seconds. + optional double geodesic_meters_per_second = 16; + + // Truncates the number of validation errors returned. These errors are + // typically attached to an INVALID_ARGUMENT error payload as a BadRequest + // error detail (https://cloud.google.com/apis/design/errors#error_details), + // unless solving_mode=VALIDATE_ONLY: see the + // [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + // field. + // This defaults to 100 and is capped at 10,000. + optional int32 max_validation_errors = 5; + + // Label that may be used to identify this request, reported back in the + // [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + string label = 17; +} + +// Response after solving a tour optimization problem containing the routes +// followed by each vehicle, the shipments which have been skipped and the +// overall cost of the solution. +message OptimizeToursResponse { + // Overall metrics, aggregated over all routes. + message Metrics { + // Aggregated over the routes. Each metric is the sum (or max, for loads) + // over all + // [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + // fields of the same name. + AggregatedMetrics aggregated_route_metrics = 1; + + // Number of mandatory shipments skipped. + int32 skipped_mandatory_shipment_count = 2; + + // Number of vehicles used. Note: if a vehicle route is empty and + // [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + // is true, the vehicle is considered used. + int32 used_vehicle_count = 3; + + // The earliest start time for a used vehicle, computed as the minimum over + // all used vehicles of + // [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + google.protobuf.Timestamp earliest_vehicle_start_time = 4; + + // The latest end time for a used vehicle, computed as the maximum over all + // used vehicles of + // [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + google.protobuf.Timestamp latest_vehicle_end_time = 5; + + // Cost of the solution, broken down by cost-related request fields. + // The keys are proto paths, relative to the input OptimizeToursRequest, + // e.g. "model.shipments.pickups.cost", and the values are the total cost + // generated by the corresponding cost field, aggregated over the whole + // solution. In other words, costs["model.shipments.pickups.cost"] is the + // sum of all pickup costs over the solution. All costs defined in the model + // are reported in detail here with the exception of costs related to + // TransitionAttributes that are only reported in an aggregated way as of + // 2022/01. + map costs = 10; + + // Total cost of the solution. The sum of all values in the costs map. + double total_cost = 6; + } + + // Routes computed for each vehicle; the i-th route corresponds to the i-th + // vehicle in the model. + repeated ShipmentRoute routes = 1; + + // Copy of the + // [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + // if a label was specified in the request. + string request_label = 3; + + // The list of all shipments skipped. + repeated SkippedShipment skipped_shipments = 4; + + // List of all the validation errors that we were able to detect + // independently. See the "MULTIPLE ERRORS" explanation for the + // [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + // message. + repeated OptimizeToursValidationError validation_errors = 5; + + // Duration, distance and usage metrics for this solution. + Metrics metrics = 6; +} + +// A shipment model contains a set of shipments which must be performed by a +// set of vehicles, while minimizing the overall cost, which is the sum of: +// +// * the cost of routing the vehicles (sum of cost per total time, cost per +// travel time, and fixed cost over all vehicles). +// * the unperformed shipment penalties. +// * the cost of the global duration of the shipments +message ShipmentModel { + // Specifies a duration and distance matrix from visit and vehicle start + // locations to visit and vehicle end locations. + message DurationDistanceMatrix { + // Specifies a row of the duration and distance matrix. + message Row { + // Duration values for a given row. It must have as many elements as + // [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + repeated google.protobuf.Duration durations = 1; + + // Distance values for a given row. If no costs or constraints refer to + // distances in the model, this can be left empty; otherwise it must have + // as many elements as `durations`. + repeated double meters = 2; + } + + // Specifies the rows of the duration and distance matrix. It must have as + // many elements as + // [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + repeated Row rows = 1; + + // Tag defining to which vehicles this duration and distance matrix applies. + // If empty, this applies to all vehicles, and there can only be a single + // matrix. + // + // Each vehicle start must match exactly one matrix, i.e. exactly one of + // their `start_tags` field must match the `vehicle_start_tag` of a matrix + // (and of that matrix only). + // + // All matrices must have a different `vehicle_start_tag`. + string vehicle_start_tag = 2; + } + + // A precedence rule between two events (each event is the pickup or the + // delivery of a shipment): the "second" event has to start at least + // `offset_duration` after "first" has started. + // + // Several precedences can refer to the same (or related) events, e.g., + // "pickup of B happens after delivery of A" and "pickup of C happens after + // pickup of B". + // + // Furthermore, precedences only apply when both shipments are performed and + // are otherwise ignored. + message PrecedenceRule { + // Shipment index of the "first" event. This field must be specified. + optional int32 first_index = 1; + + // Indicates if the "first" event is a delivery. + bool first_is_delivery = 3; + + // Shipment index of the "second" event. This field must be specified. + optional int32 second_index = 2; + + // Indicates if the "second" event is a delivery. + bool second_is_delivery = 4; + + // The offset between the "first" and "second" event. It can be negative. + google.protobuf.Duration offset_duration = 5; + } + + // Set of shipments which must be performed in the model. + repeated Shipment shipments = 1; + + // Set of vehicles which can be used to perform visits. + repeated Vehicle vehicles = 2; + + // Constrains the maximum number of active vehicles. A vehicle is active if + // its route performs at least one shipment. This can be used to limit the + // number of routes in the case where there are fewer drivers than + // vehicles and that the fleet of vehicles is heterogeneous. The optimization + // will then select the best subset of vehicles to use. + // Must be strictly positive. + optional int32 max_active_vehicles = 4; + + // Global start and end time of the model: no times outside of this range + // can be considered valid. + // + // The model's time span must be less than a year, i.e. the `global_end_time` + // and the `global_start_time` must be within 31536000 seconds of each other. + // + // When using `cost_per_*hour` fields, you might want to set this window to a + // smaller interval to increase performance (eg. if you model a single day, + // you should set the global time limits to that day). + // If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + // as default. + google.protobuf.Timestamp global_start_time = 5; + + // If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + // is used as default. + google.protobuf.Timestamp global_end_time = 6; + + // The "global duration" of the overall plan is the difference between the + // earliest effective start time and the latest effective end time of + // all vehicles. Users can assign a cost per hour to that quantity to try + // and optimize for earliest job completion, for example. This cost must be in + // the same unit as + // [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + double global_duration_cost_per_hour = 7; + + // Specifies duration and distance matrices used in the model. If this field + // is empty, Google Maps or geodesic distances will be used instead, depending + // on the value of the `use_geodesic_distances` field. If it is not empty, + // `use_geodesic_distances` cannot be true and neither + // `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + // can be empty. + // + // Usage examples: + // + // * There are two locations: locA and locB. + // * 1 vehicle starting its route at locA and ending it at locA. + // * 1 pickup visit request at locB. + // + // ``` + // model { + // vehicles { start_tags: "locA" end_tags: "locA" } + // shipments { pickups { tags: "locB" } } + // duration_distance_matrix_src_tags: "locA" + // duration_distance_matrix_src_tags: "locB" + // duration_distance_matrix_dst_tags: "locA" + // duration_distance_matrix_dst_tags: "locB" + // duration_distance_matrices { + // rows { # from: locA + // durations { seconds: 0 } meters: 0 # to: locA + // durations { seconds: 100 } meters: 1000 # to: locB + // } + // rows { # from: locB + // durations { seconds: 102 } meters: 990 # to: locA + // durations { seconds: 0 } meters: 0 # to: locB + // } + // } + // } + // ``` + // + // + // * There are three locations: locA, locB and locC. + // * 1 vehicle starting its route at locA and ending it at locB, using + // matrix "fast". + // * 1 vehicle starting its route at locB and ending it at locB, using + // matrix "slow". + // * 1 vehicle starting its route at locB and ending it at locB, using + // matrix "fast". + // * 1 pickup visit request at locC. + // + // ``` + // model { + // vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + // vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + // vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + // shipments { pickups { tags: "locC" } } + // duration_distance_matrix_src_tags: "locA" + // duration_distance_matrix_src_tags: "locB" + // duration_distance_matrix_src_tags: "locC" + // duration_distance_matrix_dst_tags: "locB" + // duration_distance_matrix_dst_tags: "locC" + // duration_distance_matrices { + // vehicle_start_tag: "fast" + // rows { # from: locA + // durations { seconds: 1000 } meters: 2000 # to: locB + // durations { seconds: 600 } meters: 1000 # to: locC + // } + // rows { # from: locB + // durations { seconds: 0 } meters: 0 # to: locB + // durations { seconds: 700 } meters: 1200 # to: locC + // } + // rows { # from: locC + // durations { seconds: 702 } meters: 1190 # to: locB + // durations { seconds: 0 } meters: 0 # to: locC + // } + // } + // duration_distance_matrices { + // vehicle_start_tag: "slow" + // rows { # from: locA + // durations { seconds: 1800 } meters: 2001 # to: locB + // durations { seconds: 900 } meters: 1002 # to: locC + // } + // rows { # from: locB + // durations { seconds: 0 } meters: 0 # to: locB + // durations { seconds: 1000 } meters: 1202 # to: locC + // } + // rows { # from: locC + // durations { seconds: 1001 } meters: 1195 # to: locB + // durations { seconds: 0 } meters: 0 # to: locC + // } + // } + // } + // ``` + repeated DurationDistanceMatrix duration_distance_matrices = 8; + + // Tags defining the sources of the duration and distance matrices; + // `duration_distance_matrices(i).rows(j)` defines durations and distances + // from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + // in matrix i. + // + // Tags correspond to + // [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + // or + // [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + // A given `VisitRequest` or `Vehicle` must match exactly one tag in this + // field. Note that a `Vehicle`'s source, destination and matrix tags may be + // the same; similarly a `VisitRequest`'s source and destination tags may be + // the same. All tags must be different and cannot be empty strings. If this + // field is not empty, then `duration_distance_matrices` must not be empty. + repeated string duration_distance_matrix_src_tags = 9; + + // Tags defining the destinations of the duration and distance matrices; + // `duration_distance_matrices(i).rows(j).durations(k)` (resp. + // `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + // (resp. the distance) of the travel from visits with tag + // `duration_distance_matrix_src_tags(j)` to visits with tag + // `duration_distance_matrix_dst_tags(k)` in matrix i. + // + // Tags correspond to + // [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + // or + // [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + // A given `VisitRequest` or `Vehicle` must match exactly one tag in this + // field. Note that a `Vehicle`'s source, destination and matrix tags may be + // the same; similarly a `VisitRequest`'s source and destination tags may be + // the same. All tags must be different and cannot be empty strings. If this + // field is not empty, then `duration_distance_matrices` must not be empty. + repeated string duration_distance_matrix_dst_tags = 10; + + // Transition attributes added to the model. + repeated TransitionAttributes transition_attributes = 11; + + // Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + repeated ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + + // Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + repeated ShipmentTypeRequirement shipment_type_requirements = 13; + + // Set of precedence rules which must be enforced in the model. + repeated PrecedenceRule precedence_rules = 14; +} + +// The shipment of a single item, from one of its pickups to one of its +// deliveries. For the shipment to be considered as performed, a unique vehicle +// must visit one of its pickup locations (and decrease its spare capacities +// accordingly), then visit one of its delivery locations later on (and +// therefore re-increase its spare capacities accordingly). +message Shipment { + // Request for a visit which can be done by a vehicle: it has a geo-location + // (or two, see below), opening and closing times represented by time windows, + // and a service duration time (time spent by the vehicle once it has arrived + // to pickup or drop off goods). + message VisitRequest { + // The geo-location where the vehicle arrives when performing this + // `VisitRequest`. If the shipment model has duration distance matrices, + // `arrival_location` must not be specified. + google.type.LatLng arrival_location = 1; + + // The waypoint where the vehicle arrives when performing this + // `VisitRequest`. If the shipment model has duration distance matrices, + // `arrival_waypoint` must not be specified. + Waypoint arrival_waypoint = 2; + + // The geo-location where the vehicle departs after completing this + // `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + // If the shipment model has duration distance matrices, + // `departure_location` must not be specified. + google.type.LatLng departure_location = 3; + + // The waypoint where the vehicle departs after completing this + // `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + // If the shipment model has duration distance matrices, + // `departure_waypoint` must not be specified. + Waypoint departure_waypoint = 4; + + // Specifies tags attached to the visit request. + // Empty or duplicate strings are not allowed. + repeated string tags = 5; + + // Time windows which constrain the arrival time at a visit. + // Note that a vehicle may depart outside of the arrival time window, i.e. + // arrival time + duration do not need to be inside a time window. This can + // result in waiting time if the vehicle arrives before + // [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + // + // The absence of `TimeWindow` means that the vehicle can perform this visit + // at any time. + // + // Time windows must be disjoint, i.e. no time window must overlap with or + // be adjacent to another, and they must be in increasing order. + // + // `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + // be set if there is a single time window. + repeated TimeWindow time_windows = 6; + + // Duration of the visit, i.e. time spent by the vehicle between arrival + // and departure (to be added to the possible waiting time; see + // `time_windows`). + google.protobuf.Duration duration = 7; + + // Cost to service this visit request on a vehicle route. This can be used + // to pay different costs for each alternative pickup or delivery of a + // shipment. This cost must be in the same unit as `Shipment.penalty_cost` + // and must not be negative. + double cost = 8; + + // Load demands of this visit request. This is just like + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + // field, except that it only applies to this + // [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + // instead of the whole + // [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + // here are added to the demands listed in + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + map load_demands = 12; + + // Specifies the types of the visit. This may be used to allocate additional + // time required for a vehicle to complete this visit (see + // [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + // + // A type can only appear once. + repeated string visit_types = 10; + + // Specifies a label for this `VisitRequest`. This label is reported in the + // response as `visit_label` in the corresponding + // [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + string label = 11; + } + + // When performing a visit, a predefined amount may be added to the vehicle + // load if it's a pickup, or subtracted if it's a delivery. This message + // defines such amount. See + // [load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + message Load { + // The amount by which the load of the vehicle performing the corresponding + // visit will vary. Since it is an integer, users are advised to choose an + // appropriate unit to avoid loss of precision. Must be ≥ 0. + int64 amount = 2; + } + + // The user-defined display name of the shipment. + // It can be up to 63 characters long and may use UTF-8 characters. + string display_name = 16; + + // Set of pickup alternatives associated to the shipment. If not specified, + // the vehicle only needs to visit a location corresponding to the deliveries. + repeated VisitRequest pickups = 1; + + // Set of delivery alternatives associated to the shipment. If not specified, + // the vehicle only needs to visit a location corresponding to the pickups. + repeated VisitRequest deliveries = 2; + + // Load demands of the shipment (for example weight, volume, number of + // pallets etc). The keys in the map should be identifiers describing the type + // of the corresponding load, ideally also including the units. + // For example: "weight_kg", "volume_gallons", "pallet_count", etc. + // If a given key does not appear in the map, the corresponding load is + // considered as null. + map load_demands = 14; + + // If the shipment is not completed, this penalty is added to the overall + // cost of the routes. A shipment is considered completed if one of its pickup + // and delivery alternatives is visited. The cost may be expressed in the + // same unit used for all other cost-related fields in the model and must be + // positive. + // + // *IMPORTANT*: If this penalty is not specified, it is considered infinite, + // i.e. the shipment must be completed. + optional double penalty_cost = 4; + + // The set of vehicles that may perform this shipment. If empty, all vehicles + // may perform it. Vehicles are given by their index in the `ShipmentModel`'s + // `vehicles` list. + repeated int32 allowed_vehicle_indices = 5; + + // Specifies the cost that is incurred when this shipment is delivered by each + // vehicle. If specified, it must have EITHER: + // + // * the same number of elements as `costs_per_vehicle_indices`. + // `costs_per_vehicle[i]` corresponds to vehicle + // `costs_per_vehicle_indices[i]` of the model. + // * the same number of elements as there are vehicles in the model. The + // i-th element corresponds to vehicle #i of the model. + // + // These costs must be in the same unit as `penalty_cost` and must not be + // negative. Leave this field empty, if there are no such costs. + repeated double costs_per_vehicle = 6; + + // Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + // it must have the same number of elements as `costs_per_vehicle`. A vehicle + // index may not be specified more than once. If a vehicle is excluded from + // `costs_per_vehicle_indices`, its cost is zero. + repeated int32 costs_per_vehicle_indices = 7; + + // Specifies the maximum relative detour time compared to the shortest path + // from pickup to delivery. If specified, it must be nonnegative, and the + // shipment must contain at least a pickup and a delivery. + // + // For example, let t be the shortest time taken to go from the selected + // pickup alternative directly to the selected delivery alternative. Then + // setting `pickup_to_delivery_relative_detour_limit` enforces: + // + // ``` + // start_time(delivery) - start_time(pickup) <= + // std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + // ``` + // + // If both relative and absolute limits are specified on the same shipment, + // the more constraining limit is used for each possible pickup/delivery pair. + // As of 2017/10, detours are only supported when travel durations do not + // depend on vehicles. + optional double pickup_to_delivery_relative_detour_limit = 8; + + // Specifies the maximum absolute detour time compared to the shortest path + // from pickup to delivery. If specified, it must be nonnegative, and the + // shipment must contain at least a pickup and a delivery. + // + // For example, let t be the shortest time taken to go from the selected + // pickup alternative directly to the selected delivery alternative. Then + // setting `pickup_to_delivery_absolute_detour_limit` enforces: + // + // ``` + // start_time(delivery) - start_time(pickup) <= + // t + pickup_to_delivery_absolute_detour_limit + // ``` + // + // If both relative and absolute limits are specified on the same shipment, + // the more constraining limit is used for each possible pickup/delivery pair. + // As of 2017/10, detours are only supported when travel durations do not + // depend on vehicles. + google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + + // Specifies the maximum duration from start of pickup to start of delivery of + // a shipment. If specified, it must be nonnegative, and the shipment must + // contain at least a pickup and a delivery. This does not depend on which + // alternatives are selected for pickup and delivery, nor on vehicle speed. + // This can be specified alongside maximum detour constraints: the solution + // will respect both specifications. + google.protobuf.Duration pickup_to_delivery_time_limit = 10; + + // Non-empty string specifying a "type" for this shipment. + // This feature can be used to define incompatibilities or requirements + // between `shipment_types` (see `shipment_type_incompatibilities` and + // `shipment_type_requirements` in `ShipmentModel`). + // + // Differs from `visit_types` which is specified for a single visit: All + // pickup/deliveries belonging to the same shipment share the same + // `shipment_type`. + string shipment_type = 11; + + // Specifies a label for this shipment. This label is reported in the response + // in the `shipment_label` of the corresponding + // [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + string label = 12; + + // If true, skip this shipment, but don't apply a `penalty_cost`. + // + // Ignoring a shipment results in a validation error when there are any + // `shipment_type_requirements` in the model. + // + // Ignoring a shipment that is performed in `injected_first_solution_routes` + // or `injected_solution_constraint` is permitted; the solver removes the + // related pickup/delivery visits from the performing route. + // `precedence_rules` that reference ignored shipments will also be ignored. + bool ignore = 13; +} + +// Specifies incompatibilties between shipments depending on their +// shipment_type. The appearance of incompatible shipments on the same route is +// restricted based on the incompatibility mode. +message ShipmentTypeIncompatibility { + // Modes defining how the appearance of incompatible shipments are restricted + // on the same route. + enum IncompatibilityMode { + // Unspecified incompatibility mode. This value should never be used. + INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + + // In this mode, two shipments with incompatible types can never share the + // same vehicle. + NOT_PERFORMED_BY_SAME_VEHICLE = 1; + + // For two shipments with incompatible types with the + // `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode: + // + // * If both are pickups only (no deliveries) or deliveries only (no + // pickups), they cannot share the same vehicle at all. + // * If one of the shipments has a delivery and the other a pickup, the two + // shipments can share the same vehicle iff the former shipment is + // delivered before the latter is picked up. + NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + } + + // List of incompatible types. Two shipments having different `shipment_types` + // among those listed are "incompatible". + repeated string types = 1; + + // Mode applied to the incompatibility. + IncompatibilityMode incompatibility_mode = 2; +} + +// Specifies requirements between shipments based on their shipment_type. +// The specifics of the requirement are defined by the requirement mode. +message ShipmentTypeRequirement { + // Modes defining the appearance of dependent shipments on a route. + enum RequirementMode { + // Unspecified requirement mode. This value should never be used. + REQUIREMENT_MODE_UNSPECIFIED = 0; + + // In this mode, all "dependent" shipments must share the same vehicle as at + // least one of their "required" shipments. + PERFORMED_BY_SAME_VEHICLE = 1; + + // With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent" + // shipments need to have at least one "required" shipment on their vehicle + // at the time of their pickup. + // + // A "dependent" shipment pickup must therefore have either: + // + // * A delivery-only "required" shipment delivered on the route after, or + // * A "required" shipment picked up on the route before it, and if the + // "required" shipment has a delivery, this delivery must be performed + // after the "dependent" shipment's pickup. + IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + + // Same as before, except the "dependent" shipments need to have a + // "required" shipment on their vehicle at the time of their *delivery*. + IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + } + + // List of alternative shipment types required by the + // `dependent_shipment_types`. + repeated string required_shipment_type_alternatives = 1; + + // All shipments with a type in the `dependent_shipment_types` field require + // at least one shipment of type `required_shipment_type_alternatives` to be + // visited on the same route. + // + // NOTE: Chains of requirements such that a `shipment_type` depends on itself + // are not allowed. + repeated string dependent_shipment_types = 2; + + // Mode applied to the requirement. + RequirementMode requirement_mode = 3; +} + +// Models a vehicle in a shipment problem. Solving a shipment problem will +// build a route starting from `start_location` and ending at `end_location` +// for this vehicle. A route is a sequence of visits (see `ShipmentRoute`). +message Vehicle { + // Travel modes which can be used by vehicles. + // + // These should be a subset of the Google Maps Platform Routes Preferred API + // travel modes, see: + // https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode. + enum TravelMode { + // Unspecified travel mode, equivalent to `DRIVING`. + TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel mode corresponding to driving directions (car, ...). + DRIVING = 1; + + // Travel mode corresponding to walking directions. + WALKING = 2; + } + + // Policy on how a vehicle can be unloaded. Applies only to shipments having + // both a pickup and a delivery. + // + // Other shipments are free to occur anywhere on the route independent of + // `unloading_policy`. + enum UnloadingPolicy { + // Unspecified unloading policy; deliveries must just occur after their + // corresponding pickups. + UNLOADING_POLICY_UNSPECIFIED = 0; + + // Deliveries must occur in reverse order of pickups + LAST_IN_FIRST_OUT = 1; + + // Deliveries must occur in the same order as pickups + FIRST_IN_FIRST_OUT = 2; + } + + // Defines a load limit applying to a vehicle, e.g. "this truck may only + // carry up to 3500 kg". See + // [load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits]. + message LoadLimit { + // Interval of acceptable load amounts. + message Interval { + // A minimum acceptable load. Must be ≥ 0. + // If they're both specified, + // [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + // must be ≤ + // [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + int64 min = 1; + + // A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + // load is unrestricted by this message. + // If they're both specified, + // [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + // must be ≤ + // [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + optional int64 max = 2; + } + + // The maximum acceptable amount of load. + optional int64 max_load = 1; + + // A soft limit of the load. See + // [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + int64 soft_max_load = 2; + + // If the load ever exceeds + // [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + // along this vehicle's route, the following cost penalty applies (only once + // per vehicle): (load - + // [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + // * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + // add up and must be in the same unit as + // [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + double cost_per_unit_above_soft_max = 3; + + // The acceptable load interval of the vehicle at the start of the route. + Interval start_load_interval = 4; + + // The acceptable load interval of the vehicle at the end of the route. + Interval end_load_interval = 5; + } + + // A limit defining a maximum duration of the route of a vehicle. It can be + // either hard or soft. + // + // When a soft limit field is defined, both the soft max threshold and its + // associated cost must be defined together. + message DurationLimit { + // A hard limit constraining the duration to be at most max_duration. + google.protobuf.Duration max_duration = 1; + + // A soft limit not enforcing a maximum duration limit, but when violated + // makes the route incur a cost. This cost adds up to other costs defined in + // the model, with the same unit. + // + // If defined, `soft_max_duration` must be nonnegative. If max_duration is + // also defined, `soft_max_duration` must be less than max_duration. + google.protobuf.Duration soft_max_duration = 2; + + // Cost per hour incurred if the `soft_max_duration` threshold is violated. + // The additional cost is 0 if the duration is under the threshold, + // otherwise the cost depends on the duration as follows: + // ``` + // cost_per_hour_after_soft_max * (duration - soft_max_duration) + // ``` + // The cost must be nonnegative. + optional double cost_per_hour_after_soft_max = 3; + + // A soft limit not enforcing a maximum duration limit, but when violated + // makes the route incur a cost, quadratic in the duration. This cost adds + // up to other costs defined in the model, with the same unit. + // + // If defined, `quadratic_soft_max_duration` must be nonnegative. If + // `max_duration` is also defined, `quadratic_soft_max_duration` must be + // less than `max_duration`, and the difference must be no larger than one + // day: + // + // `max_duration - quadratic_soft_max_duration <= 86400 seconds` + google.protobuf.Duration quadratic_soft_max_duration = 4; + + // Cost per square hour incurred if the + // `quadratic_soft_max_duration` threshold is violated. + // + // The additional cost is 0 if the duration is under the threshold, + // otherwise the cost depends on the duration as follows: + // + // ``` + // cost_per_square_hour_after_quadratic_soft_max * + // (duration - quadratic_soft_max_duration)^2 + // ``` + // + // The cost must be nonnegative. + optional double cost_per_square_hour_after_quadratic_soft_max = 5; + } + + // The user-defined display name of the vehicle. + // It can be up to 63 characters long and may use UTF-8 characters. + string display_name = 32; + + // The travel mode which affects the roads usable by the vehicle and its + // speed. See also `travel_duration_multiple`. + TravelMode travel_mode = 1; + + // Geographic location where the vehicle starts before picking up any + // shipments. If not specified, the vehicle starts at its first pickup. + // If the shipment model has duration and distance matrices, `start_location` + // must not be specified. + google.type.LatLng start_location = 3; + + // Waypoint representing a geographic location where the vehicle starts before + // picking up any shipments. If neither `start_waypoint` nor `start_location` + // is specified, the vehicle starts at its first pickup. + // If the shipment model has duration and distance matrices, `start_waypoint` + // must not be specified. + Waypoint start_waypoint = 4; + + // Geographic location where the vehicle ends after it has completed its last + // `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + // immediately when it completes its last `VisitRequest`. + // If the shipment model has duration and distance matrices, `end_location` + // must not be specified. + google.type.LatLng end_location = 5; + + // Waypoint representing a geographic location where the vehicle ends after + // it has completed its last `VisitRequest`. If neither `end_waypoint` nor + // `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + // when it completes its last `VisitRequest`. + // If the shipment model has duration and distance matrices, `end_waypoint` + // must not be specified. + Waypoint end_waypoint = 6; + + // Specifies tags attached to the start of the vehicle's route. + // + // Empty or duplicate strings are not allowed. + repeated string start_tags = 7; + + // Specifies tags attached to the end of the vehicle's route. + // + // Empty or duplicate strings are not allowed. + repeated string end_tags = 8; + + // Time windows during which the vehicle may depart its start location. + // They must be within the global time limits (see + // [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + // fields). If unspecified, there is no limitation besides those global time + // limits. + // + // Time windows belonging to the same repeated field must be disjoint, i.e. no + // time window can overlap with or be adjacent to another, and they must be in + // chronological order. + // + // `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + // there is a single time window. + repeated TimeWindow start_time_windows = 9; + + // Time windows during which the vehicle may arrive at its end location. + // They must be within the global time limits (see + // [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + // fields). If unspecified, there is no limitation besides those global time + // limits. + // + // Time windows belonging to the same repeated field must be disjoint, i.e. no + // time window can overlap with or be adjacent to another, and they must be in + // chronological order. + // + // `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + // there is a single time window. + repeated TimeWindow end_time_windows = 10; + + // Specifies a multiplicative factor that can be used to increase or decrease + // travel times of this vehicle. For example, setting this to 2.0 means + // that this vehicle is slower and has travel times that are twice what they + // are for standard vehicles. This multiple does not affect visit durations. + // It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + // specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + // is standard, and this multiple is considered 1.0. + // + // WARNING: Travel times will be rounded to the nearest second after this + // multiple is applied but before performing any numerical operations, thus, + // a small multiple may result in a loss of precision. + // + // See also `extra_visit_duration_for_visit_type` below. + optional double travel_duration_multiple = 11; + + // Unloading policy enforced on the vehicle. + UnloadingPolicy unloading_policy = 12; + + // Capacities of the vehicle (weight, volume, # of pallets for example). + // The keys in the map are the identifiers of the type of load, consistent + // with the keys of the + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + // field. If a given key is absent from this map, the corresponding capacity + // is considered to be limitless. + map load_limits = 30; + + // Vehicle costs: all costs add up and must be in the same unit as + // [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + // + // Cost per hour of the vehicle route. This cost is applied to the total time + // taken by the route, and includes travel time, waiting time, and visit time. + // Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + // in additional latency. + double cost_per_hour = 16; + + // Cost per traveled hour of the vehicle route. This cost is applied only to + // travel time taken by the route (i.e., that reported in + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + // and excludes waiting time and visit time. + double cost_per_traveled_hour = 17; + + // Cost per kilometer of the vehicle route. This cost is applied to the + // distance reported in the + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + // and does not apply to any distance implicitly traveled from the + // `arrival_location` to the `departure_location` of a single `VisitRequest`. + double cost_per_kilometer = 18; + + // Fixed cost applied if this vehicle is used to handle a shipment. + double fixed_cost = 19; + + // This field only applies to vehicles when their route does not serve any + // shipments. It indicates if the vehicle should be considered as used or not + // in this case. + // + // If true, the vehicle goes from its start to its end location even if it + // doesn't serve any shipments, and time and distance costs resulting from its + // start --> end travel are taken into account. + // + // Otherwise, it doesn't travel from its start to its end location, and no + // `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + // vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + // information except for the vehicle index and label. + bool used_if_route_is_empty = 20; + + // Limit applied to the total duration of the vehicle's route. In a given + // `OptimizeToursResponse`, the route duration of a vehicle is the + // difference between its `vehicle_end_time` and `vehicle_start_time`. + DurationLimit route_duration_limit = 21; + + // Limit applied to the travel duration of the vehicle's route. In a given + // `OptimizeToursResponse`, the route travel duration is the sum of all its + // [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + DurationLimit travel_duration_limit = 22; + + // Limit applied to the total distance of the vehicle's route. In a given + // `OptimizeToursResponse`, the route distance is the sum of all its + // [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + DistanceLimit route_distance_limit = 23; + + // Specifies a map from visit_types strings to durations. The duration is time + // in addition to + // [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + // to be taken at visits with the specified `visit_types`. This extra visit + // duration adds cost if `cost_per_hour` is specified. Keys (i.e. + // `visit_types`) cannot be empty strings. + // + // If a visit request has multiple types, a duration will be added for each + // type in the map. + map extra_visit_duration_for_visit_type = + 24; + + // Describes the break schedule to be enforced on this vehicle. + // If empty, no breaks will be scheduled for this vehicle. + BreakRule break_rule = 25; + + // Specifies a label for this vehicle. This label is reported in the response + // as the `vehicle_label` of the corresponding + // [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + string label = 27; + + // If true, `used_if_route_is_empty` must be false, and this vehicle will + // remain unused. + // + // If a shipment is performed by an ignored vehicle in + // `injected_first_solution_routes`, it is skipped in the first solution but + // is free to be performed in the response. + // + // If a shipment is performed by an ignored vehicle in + // `injected_solution_constraint` and any related pickup/delivery is + // constrained to remain on the vehicle (i.e., not relaxed to level + // `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + // If a shipment has a non-empty `allowed_vehicle_indices` field and all of + // the allowed vehicles are ignored, it is skipped in the response. + bool ignore = 28; +} + +// Time windows constrain the time of an event, such as the arrival time at a +// visit, or the start and end time of a vehicle. +// +// Hard time window bounds, `start_time` and `end_time`, enforce the earliest +// and latest time of the event, such that `start_time <= event_time <= +// end_time`. The soft time window lower bound, `soft_start_time`, expresses a +// preference for the event to happen at or after `soft_start_time` by incurring +// a cost proportional to how long before soft_start_time the event occurs. The +// soft time window upper bound, `soft_end_time`, expresses a preference for the +// event to happen at or before `soft_end_time` by incurring a cost proportional +// to how long after `soft_end_time` the event occurs. `start_time`, `end_time`, +// `soft_start_time` and `soft_end_time` should be within the global time limits +// (see +// [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] +// and +// [ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time]) +// and should respect: +// ``` +// 0 <= `start_time` <= `soft_start_time` <= `end_time` and +// 0 <= `start_time` <= `soft_end_time` <= `end_time`. +// ``` +message TimeWindow { + // The hard time window start time. If unspecified it will be set to + // `ShipmentModel.global_start_time`. + google.protobuf.Timestamp start_time = 1; + + // The hard time window end time. If unspecified it will be set to + // `ShipmentModel.global_end_time`. + google.protobuf.Timestamp end_time = 2; + + // The soft start time of the time window. + google.protobuf.Timestamp soft_start_time = 3; + + // The soft end time of the time window. + google.protobuf.Timestamp soft_end_time = 4; + + // A cost per hour added to other costs in the model if the event occurs + // before soft_start_time, computed as: + // + // ``` + // max(0, soft_start_time - t.seconds) + // * cost_per_hour_before_soft_start_time / 3600, + // t being the time of the event. + // ``` + // + // This cost must be positive, and the field can only be set if + // soft_start_time has been set. + optional double cost_per_hour_before_soft_start_time = 5; + + // A cost per hour added to other costs in the model if the event occurs after + // `soft_end_time`, computed as: + // + // ``` + // max(0, t.seconds - soft_end_time.seconds) + // * cost_per_hour_after_soft_end_time / 3600, + // t being the time of the event. + // ``` + // + // This cost must be positive, and the field can only be set if + // `soft_end_time` has been set. + optional double cost_per_hour_after_soft_end_time = 6; +} + +// A limit defining a maximum distance which can be traveled. It can be either +// hard or soft. +// +// If a soft limit is defined, both `soft_max_meters` and +// `cost_per_kilometer_above_soft_max` must be defined and be nonnegative. +message DistanceLimit { + // A hard limit constraining the distance to be at most max_meters. The limit + // must be nonnegative. + optional int64 max_meters = 1; + + // A soft limit not enforcing a maximum distance limit, but when violated + // results in a cost which adds up to other costs defined in the model, + // with the same unit. + // + // If defined soft_max_meters must be less than max_meters and must be + // nonnegative. + optional int64 soft_max_meters = 2; + + // Cost per kilometer incurred if distance is above `soft_max_meters` limit. + // The additional cost is 0 if the distance is under the limit, otherwise the + // formula used to compute the cost is the following: + // ``` + // (distance_meters - soft_max_meters) / 1000.0 * + // cost_per_kilometer_above_soft_max. + // ``` + // The cost must be nonnegative. + optional double cost_per_kilometer_above_soft_max = 3; +} + +// Specifies attributes of transitions between two consecutive visits on a +// route. Several `TransitionAttributes` may apply to the same transition: in +// that case, all extra costs add up and the strictest constraint or limit +// applies (following natural "AND" semantics). +message TransitionAttributes { + // Tags defining the set of (src->dst) transitions these attributes apply to. + // + // A source visit or vehicle start matches iff its + // [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + // or + // [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + // either contains `src_tag` or does not contain `excluded_src_tag` (depending + // on which of these two fields is non-empty). + string src_tag = 1; + + // See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + // non-empty. + string excluded_src_tag = 2; + + // A destination visit or vehicle end matches iff its + // [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + // or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + // either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + // on which of these two fields is non-empty). + string dst_tag = 3; + + // See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + // non-empty. + string excluded_dst_tag = 4; + + // Specifies a cost for performing this transition. This is in the same unit + // as all other costs in the model and must not be negative. It is applied on + // top of all other existing costs. + double cost = 5; + + // Specifies a cost per kilometer applied to the distance traveled while + // performing this transition. It adds up to any + // [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + // specified on vehicles. + double cost_per_kilometer = 6; + + // Specifies a limit on the distance traveled while performing this + // transition. + // + // As of 2021/06, only soft limits are supported. + DistanceLimit distance_limit = 7; + + // Specifies a delay incurred when performing this transition. + // + // This delay always occurs *after* finishing the source visit and *before* + // starting the destination visit. + google.protobuf.Duration delay = 8; +} + +// Encapsulates a waypoint. Waypoints mark arrival and departure locations of +// VisitRequests, and start and end locations of Vehicles. +message Waypoint { + // Different ways to represent a location. + oneof location_type { + // A point specified using geographic coordinates, including an optional + // heading. + Location location = 1; + + // The POI Place ID associated with the waypoint. + string place_id = 2; + } + + // Optional. Indicates that the location of this waypoint is meant to have a + // preference for the vehicle to stop at a particular side of road. When you + // set this value, the route will pass through the location so that the + // vehicle can stop at the side of road that the location is biased towards + // from the center of the road. This option doesn't work for the 'WALKING' + // travel mode. + bool side_of_road = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Encapsulates a location (a geographic point, and an optional heading). +message Location { + // The waypoint's geographic coordinates. + google.type.LatLng lat_lng = 1; + + // The compass heading associated with the direction of the flow of traffic. + // This value is used to specify the side of the road to use for pickup and + // drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + // of due North, 90 specifies a heading of due East, etc. + optional int32 heading = 2; +} + +// Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break +// is a contiguous period of time during which the vehicle remains idle at its +// current position and cannot perform any visit. A break may occur: +// +// * during the travel between two visits (which includes the time right +// before or right after a visit, but not in the middle of a visit), in +// which case it extends the corresponding transit time between the visits, +// * or before the vehicle start (the vehicle may not start in the middle of +// a break), in which case it does not affect the vehicle start time. +// * or after the vehicle end (ditto, with the vehicle end time). +message BreakRule { + // The sequence of breaks (i.e. their number and order) that apply to each + // vehicle must be known beforehand. The repeated `BreakRequest`s define + // that sequence, in the order in which they must occur. Their time windows + // (`earliest_start_time` / `latest_start_time`) may overlap, but they must + // be compatible with the order (this is checked). + message BreakRequest { + // Required. Lower bound (inclusive) on the start of the break. + google.protobuf.Timestamp earliest_start_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Upper bound (inclusive) on the start of the break. + google.protobuf.Timestamp latest_start_time = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Minimum duration of the break. Must be positive. + google.protobuf.Duration min_duration = 3 + [(google.api.field_behavior) = REQUIRED]; + } + + // One may further constrain the frequency and duration of the breaks + // specified above, by enforcing a minimum break frequency, such as + // "There must be a break of at least 1 hour every 12 hours". Assuming that + // this can be interpreted as "Within any sliding time window of 12h, there + // must be at least one break of at least one hour", that example would + // translate to the following `FrequencyConstraint`: + // ``` + // { + // min_break_duration { seconds: 3600 } # 1 hour. + // max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11). + // } + // ``` + // + // The timing and duration of the breaks in the solution will respect all + // such constraints, in addition to the time windows and minimum durations + // already specified in the `BreakRequest`. + // + // A `FrequencyConstraint` may in practice apply to non-consecutive breaks. + // For example, the following schedule honors the "1h every 12h" example: + // ``` + // 04:00 vehicle start + // .. performing travel and visits .. + // 09:00 1 hour break + // 10:00 end of the break + // .. performing travel and visits .. + // 12:00 20-min lunch break + // 12:20 end of the break + // .. performing travel and visits .. + // 21:00 1 hour break + // 22:00 end of the break + // .. performing travel and visits .. + // 23:59 vehicle end + // ``` + message FrequencyConstraint { + // Required. Minimum break duration for this constraint. Nonnegative. + // See description of `FrequencyConstraint`. + google.protobuf.Duration min_break_duration = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Maximum allowed span of any interval of time in the route that + // does not include at least partially a break of `duration >= + // min_break_duration`. Must be positive. + google.protobuf.Duration max_inter_break_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Sequence of breaks. See the `BreakRequest` message. + repeated BreakRequest break_requests = 1; + + // Several `FrequencyConstraint` may apply. They must all be satisfied by + // the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + repeated FrequencyConstraint frequency_constraints = 2; +} + +// A vehicle's route can be decomposed, along the time axis, like this (we +// assume there are n visits): +// ``` +// | | | | | T[2], | | | +// | Transition | Visit #0 | | | V[2], | | | +// | #0 | aka | T[1] | V[1] | ... | V[n-1] | T[n] | +// | aka T[0] | V[0] | | | V[n-2],| | | +// | | | | | T[n-1] | | | +// ^ ^ ^ ^ ^ ^ ^ ^ +// vehicle V[0].start V[0].end V[1]. V[1]. V[n]. V[n]. vehicle +// start (arrival) (departure) start end start end end +// ``` +// Note that we make a difference between: +// +// * "punctual events", such as the vehicle start and end and each visit's start +// and end (aka arrival and departure). They happen at a given second. +// * "time intervals", such as the visits themselves, and the transition between +// visits. Though time intervals can sometimes have zero duration, i.e. start +// and end at the same second, they often have a positive duration. +// +// Invariants: +// +// * If there are n visits, there are n+1 transitions. +// * A visit is always surrounded by a transition before it (same index) and a +// transition after it (index + 1). +// * The vehicle start is always followed by transition #0. +// * The vehicle end is always preceded by transition #n. +// +// Zooming in, here is what happens during a `Transition` and a `Visit`: +// ``` +// ---+-------------------------------------+-----------------------------+--> +// | TRANSITION[i] | VISIT[i] | +// | | | +// | * TRAVEL: the vehicle moves from | PERFORM the visit: | +// | VISIT[i-1].departure_location to | | +// | VISIT[i].arrival_location, which | * Spend some time: | +// | takes a given travel duration | the "visit duration". | +// | and distance | | +// | | * Load or unload | +// | * BREAKS: the driver may have | some quantities from the | +// | breaks (e.g. lunch break). | vehicle: the "demand". | +// | | | +// | * WAIT: the driver/vehicle does | | +// | nothing. This can happen for | | +// | many reasons, for example when | | +// | the vehicle reaches the next | | +// | event's destination before the | | +// | start of its time window | | +// | | | +// | * DELAY: *right before* the next | | +// | arrival. E.g. the vehicle and/or | | +// | driver spends time unloading. | | +// | | | +// ---+-------------------------------------+-----------------------------+--> +// ^ ^ ^ +// V[i-1].end V[i].start V[i].end +// ``` +// Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged +// during a transition. +// +// * They don't overlap. +// * The DELAY is unique and *must* be a contiguous period of time right +// before the next visit (or vehicle end). Thus, it suffice to know the +// delay duration to know its start and end time. +// * The BREAKS are contiguous, non-overlapping periods of time. The +// response specifies the start time and duration of each break. +// * TRAVEL and WAIT are "preemptable": they can be interrupted several times +// during this transition. Clients can assume that travel happens "as soon as +// possible" and that "wait" fills the remaining time. +// +// A (complex) example: +// ``` +// TRANSITION[i] +// --++-----+-----------------------------------------------------------++--> +// || | | | | | | || +// || T | B | T | | B | | D || +// || r | r | r | W | r | W | e || +// || a | e | a | a | e | a | l || +// || v | a | v | i | a | i | a || +// || e | k | e | t | k | t | y || +// || l | | l | | | | || +// || | | | | | | || +// --++-----------------------------------------------------------------++--> +// ``` +message ShipmentRoute { + // A visit performed during a route. This visit corresponds to a pickup or a + // delivery of a `Shipment`. + message Visit { + // Index of the `shipments` field in the source + // [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + int32 shipment_index = 1; + + // If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + // corresponds to a delivery. + bool is_pickup = 2; + + // Index of `VisitRequest` in either the pickup or delivery field of the + // `Shipment` (see `is_pickup`). + int32 visit_request_index = 3; + + // Time at which the visit starts. Note that the vehicle may arrive earlier + // than this at the visit location. Times are consistent with the + // `ShipmentModel`. + google.protobuf.Timestamp start_time = 4; + + // Total visit load demand as the sum of the shipment and the visit request + // `load_demands`. The values are negative if the visit is a delivery. + // Demands are reported for the same types as the + // [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + // (see this field). + map load_demands = 11; + + // Extra detour time due to the shipments visited on the route before the + // visit and to the potential waiting time induced by time windows. + // If the visit is a delivery, the detour is computed from the corresponding + // pickup visit and is equal to: + // ``` + // start_time(delivery) - start_time(pickup) + // - (duration(pickup) + travel duration from the pickup location + // to the delivery location). + // ``` + // Otherwise, it is computed from the vehicle `start_location` and is equal + // to: + // ``` + // start_time - vehicle_start_time - travel duration from + // the vehicle's `start_location` to the visit. + // ``` + google.protobuf.Duration detour = 6; + + // Copy of the corresponding `Shipment.label`, if specified in the + // `Shipment`. + string shipment_label = 7; + + // Copy of the corresponding + // [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + // if specified in the `VisitRequest`. + string visit_label = 8; + } + + // Transition between two events on the route. See the description of + // [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + // + // If the vehicle does not have a `start_location` and/or `end_location`, the + // corresponding travel metrics are 0. + message Transition { + // Travel duration during this transition. + google.protobuf.Duration travel_duration = 1; + + // Distance traveled during the transition. + double travel_distance_meters = 2; + + // When traffic is requested via + // [OptimizeToursRequest.consider_road_traffic] + // [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + // and the traffic info couldn't be retrieved for a `Transition`, this + // boolean is set to true. This may be temporary (rare hiccup in the + // realtime traffic servers) or permanent (no data for this location). + bool traffic_info_unavailable = 3; + + // Sum of the delay durations applied to this transition. If any, the delay + // starts exactly `delay_duration` seconds before the next event (visit or + // vehicle end). See + // [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + google.protobuf.Duration delay_duration = 4; + + // Sum of the duration of the breaks occurring during this transition, if + // any. Details about each break's start time and duration are stored in + // [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + google.protobuf.Duration break_duration = 5; + + // Time spent waiting during this transition. Wait duration corresponds to + // idle time and does not include break time. Also note that this wait time + // may be split into several non-contiguous intervals. + google.protobuf.Duration wait_duration = 6; + + // Total duration of the transition, provided for convenience. It is equal + // to: + // + // * next visit `start_time` (or `vehicle_end_time` if this is the last + // transition) - this transition's `start_time`; + // * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + // additionally holds: `total_duration = travel_duration + delay_duration + // + break_duration + wait_duration`. + google.protobuf.Duration total_duration = 7; + + // Start time of this transition. + google.protobuf.Timestamp start_time = 8; + + // The encoded polyline representation of the route followed during the + // transition. + // This field is only populated if [populate_transition_polylines] + // [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + // is set to true. + EncodedPolyline route_polyline = 9; + + // Vehicle loads during this transition, for each type that either appears + // in this vehicle's + // [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + // or that have non-zero + // [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + // on some shipment performed on this route. + // + // The loads during the first transition are the starting loads of the + // vehicle route. Then, after each visit, the visit's `load_demands` are + // either added or subtracted to get the next transition's loads, depending + // on whether the visit was a pickup or a delivery. + map vehicle_loads = 11; + } + + // Reports the actual load of the vehicle at some point along the route, + // for a given type (see + // [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]). + message VehicleLoad { + // The amount of load on the vehicle, for the given type. The unit of load + // is usually indicated by the type. See + // [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + int64 amount = 1; + } + + // The encoded representation of a polyline. More information on polyline + // encoding can be found here: + // https://developers.google.com/maps/documentation/utilities/polylinealgorithm + // https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding. + message EncodedPolyline { + // String representing encoded points of the polyline. + string points = 1; + } + + // Data representing the execution of a break. + message Break { + // Start time of a break. + google.protobuf.Timestamp start_time = 1; + + // Duration of a break. + google.protobuf.Duration duration = 2; + } + + // Vehicle performing the route, identified by its index in the source + // `ShipmentModel`. + int32 vehicle_index = 1; + + // Label of the vehicle performing this route, equal to + // `ShipmentModel.vehicles(vehicle_index).label`, if specified. + string vehicle_label = 2; + + // Time at which the vehicle starts its route. + google.protobuf.Timestamp vehicle_start_time = 5; + + // Time at which the vehicle finishes its route. + google.protobuf.Timestamp vehicle_end_time = 6; + + // Ordered sequence of visits representing a route. + // visits[i] is the i-th visit in the route. + // If this field is empty, the vehicle is considered as unused. + repeated Visit visits = 7; + + // Ordered list of transitions for the route. + repeated Transition transitions = 8; + + // When + // [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + // is set to true, this field indicates that inconsistencies in route timings + // are predicted using traffic-based travel duration estimates. There may be + // insufficient time to complete traffic-adjusted travel, delays, and breaks + // between visits, before the first visit, or after the last visit, while + // still satisfying the visit and vehicle time windows. For example, + // + // ``` + // start_time(previous_visit) + duration(previous_visit) + + // travel_duration(previous_visit, next_visit) > start_time(next_visit) + // ``` + // + // Arrival at next_visit will likely happen later than its current + // time window due the increased estimate of travel time + // `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + // may be forced to overlap with a visit due to an increase in travel time + // estimates and visit or break time window restrictions. + bool has_traffic_infeasibilities = 9; + + // The encoded polyline representation of the route. + // This field is only populated if + // [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + // is set to true. + EncodedPolyline route_polyline = 10; + + // Breaks scheduled for the vehicle performing this route. + // The `breaks` sequence represents time intervals, each starting at the + // corresponding `start_time` and lasting `duration` seconds. + repeated Break breaks = 11; + + // Duration, distance and load metrics for this route. The fields of + // [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + // summed over all + // [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + // or + // [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + // depending on the context. + AggregatedMetrics metrics = 12; + + // Cost of the route, broken down by cost-related request fields. + // The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + // "model.shipments.pickups.cost", and the values are the total cost + // generated by the corresponding cost field, aggregated over the whole route. + // In other words, costs["model.shipments.pickups.cost"] is the sum of all + // pickup costs over the route. All costs defined in the model are reported in + // detail here with the exception of costs related to TransitionAttributes + // that are only reported in an aggregated way as of 2022/01. + map route_costs = 17; + + // Total cost of the route. The sum of all costs in the cost map. + double route_total_cost = 18; +} + +// Specifies details of unperformed shipments in a solution. For trivial cases +// and/or if we are able to identify the cause for skipping, we report the +// reason here. +message SkippedShipment { + // If we can explain why the shipment was skipped, reasons will be listed + // here. If the reason is not the same for all vehicles, `reason` will have + // more than 1 element. A skipped shipment cannot have duplicate reasons, + // i.e. where all fields are the same except for `example_vehicle_index`. + // Example: + // ``` + // reasons { + // code: DEMAND_EXCEEDS_VEHICLE_CAPACITY + // example_vehicle_index: 1 + // example_exceeded_capacity_type: "Apples" + // } + // reasons { + // code: DEMAND_EXCEEDS_VEHICLE_CAPACITY + // example_vehicle_index: 3 + // example_exceeded_capacity_type: "Pears" + // } + // reasons { + // code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT + // example_vehicle_index: 1 + // } + // ``` + // The skipped shipment is incompatible with all vehicles. The reasons may + // be different for all vehicles but at least one vehicle's "Apples" + // capacity would be exceeded (including vehicle 1), at least one vehicle's + // "Pears" capacity would be exceeded (including vehicle 3) and at least one + // vehicle's distance limit would be exceeded (including vehicle 1). + message Reason { + // Code identifying the reason type. The order here is meaningless. In + // particular, it gives no indication of whether a given reason will + // appear before another in the solution, if both apply. + enum Code { + // This should never be used. If we are unable to understand why a + // shipment was skipped, we simply return an empty set of reasons. + CODE_UNSPECIFIED = 0; + + // There is no vehicle in the model making all shipments infeasible. + NO_VEHICLE = 1; + + // The demand of the shipment exceeds a vehicle's capacity for some + // capacity types, one of which is `example_exceeded_capacity_type`. + DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + + // The minimum distance necessary to perform this shipment, i.e. from + // the vehicle's `start_location` to the shipment's pickup and/or delivery + // locations and to the vehicle's end location exceeds the vehicle's + // `route_distance_limit`. + // + // Note that for this computation we use the geodesic distances. + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + + // The minimum time necessary to perform this shipment, including travel + // time, wait time and service time exceeds the vehicle's + // `route_duration_limit`. + // + // Note: travel time is computed in the best-case scenario, namely as + // geodesic distance x 36 m/s (roughly 130 km/hour). + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + + // Same as above but we only compare minimum travel time and the + // vehicle's `travel_duration_limit`. + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + + // The vehicle cannot perform this shipment in the best-case scenario + // (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time + // computation) if it starts at its earliest start time: the total time + // would make the vehicle end after its latest end time. + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + + // The `allowed_vehicle_indices` field of the shipment is not empty and + // this vehicle does not belong to it. + VEHICLE_NOT_ALLOWED = 7; + } + + // Refer to the comments of Code. + Code code = 1; + + // If the reason is related to a shipment-vehicle incompatibility, this + // field provides the index of one relevant vehicle. + optional int32 example_vehicle_index = 2; + + // If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + // capacity type that is exceeded. + string example_exceeded_capacity_type = 3; + } + + // The index corresponds to the index of the shipment in the source + // `ShipmentModel`. + int32 index = 1; + + // Copy of the corresponding + // [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + // specified in the `Shipment`. + string label = 2; + + // A list of reasons that explain why the shipment was skipped. See comment + // above `Reason`. + repeated Reason reasons = 3; +} + +// Aggregated metrics for +// [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute] (resp. for +// [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse] +// over all +// [Transition][google.maps.routeoptimization.v1.ShipmentRoute.Transition] +// and/or [Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit] (resp. +// over all [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]) +// elements. +message AggregatedMetrics { + // Number of shipments performed. Note that a pickup and delivery pair only + // counts once. + int32 performed_shipment_count = 1; + + // Total travel duration for a route or a solution. + google.protobuf.Duration travel_duration = 2; + + // Total wait duration for a route or a solution. + google.protobuf.Duration wait_duration = 3; + + // Total delay duration for a route or a solution. + google.protobuf.Duration delay_duration = 4; + + // Total break duration for a route or a solution. + google.protobuf.Duration break_duration = 5; + + // Total visit duration for a route or a solution. + google.protobuf.Duration visit_duration = 6; + + // The total duration should be equal to the sum of all durations above. + // For routes, it also corresponds to: + // ``` + // [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + // - + // [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + // ``` + google.protobuf.Duration total_duration = 7; + + // Total travel distance for a route or a solution. + double travel_distance_meters = 8; + + // Maximum load achieved over the entire route (resp. solution), for each of + // the quantities on this route (resp. solution), computed as the maximum over + // all + // [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + // (resp. + // [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + map max_loads = 9; +} + +// Solution injected in the request including information about which visits +// must be constrained and how they must be constrained. +message InjectedSolutionConstraint { + // For a group of vehicles, specifies at what threshold(s) constraints on + // visits will be relaxed and to which level. Shipments listed in + // the `skipped_shipment` field are constrained to be skipped; i.e., they + // cannot be performed. + message ConstraintRelaxation { + // If `relaxations` is empty, the start time and sequence of all visits + // on `routes` are fully constrained and no new visits may be inserted or + // added to those routes. Also, a vehicle's start and end time in + // `routes` is fully constrained, unless the vehicle is empty (i.e., has no + // visits and has `used_if_route_is_empty` set to false in the model). + // + // `relaxations(i).level` specifies the constraint relaxation level applied + // to a visit #j that satisfies: + // + // * `route.visits(j).start_time >= relaxations(i).threshold_time` AND + // * `j + 1 >= relaxations(i).threshold_visit_count` + // + // Similarly, the vehicle start is relaxed to `relaxations(i).level` if it + // satisfies: + // + // * `vehicle_start_time >= relaxations(i).threshold_time` AND + // * `relaxations(i).threshold_visit_count == 0` + // and the vehicle end is relaxed to `relaxations(i).level` if it satisfies: + // * `vehicle_end_time >= relaxations(i).threshold_time` AND + // * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count` + // + // To apply a relaxation level if a visit meets the `threshold_visit_count` + // OR the `threshold_time` add two `relaxations` with the same `level`: + // one with only `threshold_visit_count` set and the other with only + // `threshold_time` set. If a visit satisfies the conditions of multiple + // `relaxations`, the most relaxed level applies. As a result, from the + // vehicle start through the route visits in order to the vehicle end, the + // relaxation level becomes more relaxed: i.e., the relaxation level is + // non-decreasing as the route progresses. + // + // The timing and sequence of route visits that do not satisfy the + // threshold conditions of any `relaxations` are fully constrained + // and no visits may be inserted into these sequences. Also, if a + // vehicle start or end does not satisfy the conditions of any + // relaxation the time is fixed, unless the vehicle is empty. + message Relaxation { + // Expresses the different constraint relaxation levels, which are + // applied for a visit and those that follow when it satisfies the + // threshold conditions. + // + // The enumeration below is in order of increasing relaxation. + enum Level { + // Implicit default relaxation level: no constraints are relaxed, + // i.e., all visits are fully constrained. + // + // This value must not be explicitly used in `level`. + LEVEL_UNSPECIFIED = 0; + + // Visit start times and vehicle start/end times will be relaxed, but + // each visit remains bound to the same vehicle and the visit sequence + // must be observed: no visit can be inserted between them or before + // them. + RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + + // Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence + // is also relaxed: visits remain simply bound to their vehicle. + RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + + // Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the + // vehicle is also relaxed: visits are completely free at or after the + // threshold time and can potentially become unperformed. + RELAX_ALL_AFTER_THRESHOLD = 3; + } + + // The constraint relaxation level that applies when the conditions + // at or after `threshold_time` AND at least `threshold_visit_count` are + // satisfied. + Level level = 1; + + // The time at or after which the relaxation `level` may be applied. + google.protobuf.Timestamp threshold_time = 2; + + // The number of visits at or after which the relaxation `level` may be + // applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + // applied directly at the vehicle start. + // + // If it is `route.visits_size() + 1`, the `level` may only be applied to + // the vehicle end. If it is more than `route.visits_size() + 1`, + // `level` is not applied at all for that route. + int32 threshold_visit_count = 3; + } + + // All the visit constraint relaxations that will apply to visits on + // routes with vehicles in `vehicle_indices`. + repeated Relaxation relaxations = 1; + + // Specifies the vehicle indices to which the visit constraint + // `relaxations` apply. If empty, this is considered the default and the + // `relaxations` apply to all vehicles that are not specified in other + // `constraint_relaxations`. There can be at most one default, i.e., at + // most one constraint relaxation field is allowed empty + // `vehicle_indices`. A vehicle index can only be listed once, even within + // several `constraint_relaxations`. + // + // A vehicle index is mapped the same as + // [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + // if `interpret_injected_solutions_using_labels` is true (see `fields` + // comment). + repeated int32 vehicle_indices = 2; + } + + // Routes of the solution to inject. Some routes may be omitted from the + // original solution. The routes and skipped shipments must satisfy the basic + // validity assumptions listed for `injected_first_solution_routes`. + repeated ShipmentRoute routes = 1; + + // Skipped shipments of the solution to inject. Some may be omitted from the + // original solution. See the `routes` field. + repeated SkippedShipment skipped_shipments = 2; + + // For zero or more groups of vehicles, specifies when and how much to relax + // constraints. If this field is empty, all non-empty vehicle routes are + // fully constrained. + repeated ConstraintRelaxation constraint_relaxations = 3; +} + +// Describes an error encountered when validating an `OptimizeToursRequest`. +message OptimizeToursValidationError { + // Specifies a context for the validation error. A `FieldReference` always + // refers to a given field in this file and follows the same hierarchical + // structure. For example, we may specify element #2 of `start_time_windows` + // of vehicle #5 using: + // ``` + // name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 } + // ``` + // We however omit top-level entities such as `OptimizeToursRequest` or + // `ShipmentModel` to avoid crowding the message. + message FieldReference { + // Name of the field, e.g., "vehicles". + string name = 1; + + oneof index_or_key { + // Index of the field if repeated. + int32 index = 2; + + // Key if the field is a map. + string key = 4; + } + + // Recursively nested sub-field, if needed. + FieldReference sub_field = 3; + } + + // A validation error is defined by the pair (`code`, `display_name`) which + // are always present. + // + // Other fields (below) provide more context about the error. + // + // *MULTIPLE ERRORS*: + // When there are multiple errors, the validation process tries to output + // several of them. Much like a compiler, this is an imperfect process. Some + // validation errors will be "fatal", meaning that they stop the entire + // validation process. This is the case for `display_name="UNSPECIFIED"` + // errors, among others. Some may cause the validation process to skip other + // errors. + // + // *STABILITY*: + // `code` and `display_name` should be very stable. But new codes and + // display names may appear over time, which may cause a given (invalid) + // request to yield a different (`code`, `display_name`) pair because the new + // error hid the old one (see "MULTIPLE ERRORS"). + // + // *REFERENCE*: A list of all (code, name) pairs: + // + // * UNSPECIFIED = 0; + // * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + // the deadline. + // + // * REQUEST_OPTIONS_ERROR = 12; + // * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + // * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + // * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + // * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + // * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + // * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + // = 1207; + // * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + // * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + // * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + // * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + // * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + // * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + // * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + // * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + // * INJECTED_SOLUTION_ERROR = 20; + // * INJECTED_SOLUTION_MISSING_LABEL = 2000; + // * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + // * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + // * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + // * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + // * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + // * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + // * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + // * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + // * SHIPMENT_MODEL_ERROR = 22; + // * SHIPMENT_MODEL_TOO_LARGE = 2200; + // * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + // * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + // * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + // * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + // * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + // * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + // * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + // * INDEX_ERROR = 24; + // * TAG_ERROR = 26; + // * TIME_WINDOW_ERROR = 28; + // * TIME_WINDOW_INVALID_START_TIME = 2800; + // * TIME_WINDOW_INVALID_END_TIME = 2801; + // * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + // * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + // * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + // * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + // * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + // * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + // * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + // = 2808; + // * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + // * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + // = 2810; + // * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + // * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + // * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + // * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + // * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + // * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + // * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + // = 2817; + // * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + // * TRANSITION_ATTRIBUTES_ERROR = 30; + // * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + // * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + // * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + // * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + // * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + // * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + // * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + // * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + // * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + // * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + // * AMOUNT_ERROR = 31; + // * AMOUNT_NEGATIVE_VALUE = 3100; + // * LOAD_LIMIT_ERROR = 33; + // * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + // * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + // * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + // * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + // * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + // * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + // * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + // * INTERVAL_ERROR = 34; + // * INTERVAL_MIN_EXCEEDS_MAX = 3401; + // * INTERVAL_NEGATIVE_MIN = 3402; + // * INTERVAL_NEGATIVE_MAX = 3403; + // * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + // * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + // * DISTANCE_LIMIT_ERROR = 36; + // * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + // * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + // * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + // * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + // * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + // * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + // * DURATION_LIMIT_ERROR = 38; + // * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + // * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + // * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + // * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + // * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + // * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + // = 3807; + // * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + // = 3808; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + // * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + // * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + // = 3812; + // * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + // * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + // * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + // = 3815; + // * SHIPMENT_ERROR = 40; + // * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + // * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + // * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + // = 4001; + // * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + // * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + // * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + // * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + // * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + // * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + // * SHIPMENT_INVALID_PENALTY_COST = 4006; + // * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + // * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + // * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + // * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + // * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + // * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + // * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + // * VEHICLE_ERROR = 42; + // * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + // * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + // * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + // * VEHICLE_EMPTY_START_TAG = 4203; + // * VEHICLE_DUPLICATE_START_TAG = 4204; + // * VEHICLE_EMPTY_END_TAG = 4205; + // * VEHICLE_DUPLICATE_END_TAG = 4206; + // * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + // * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + // * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + // * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + // * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + // * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + // * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + // * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + // * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + // * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + // * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + // * VEHICLE_INVALID_COST_PER_HOUR = 4218; + // * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + // * VEHICLE_INVALID_FIXED_COST = 4220; + // * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + // * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + // = 4223; + // * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + // * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + // * VISIT_REQUEST_ERROR = 44; + // * VISIT_REQUEST_EMPTY_TAG = 4400; + // * VISIT_REQUEST_DUPLICATE_TAG = 4401; + // * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + // * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + // * PRECEDENCE_ERROR = 46; + // * BREAK_ERROR = 48; + // * BREAK_RULE_EMPTY = 4800; + // * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + // * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + // * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + // * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + // * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + // * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + // * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + // * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + // * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + // * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + // * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + // * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + // = 4812; + // * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + // * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + // * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + // * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + // * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + // * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + // * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + // * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + // * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + // * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + // * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + // * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + // * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + // * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + // * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + // * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + // * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + // * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + // * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + // * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + // * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + // * VEHICLE_OPERATOR_ERROR = 54; + // * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + // * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + // * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + // * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + // * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + // * DURATION_SECONDS_MATRIX_ERROR = 56; + // * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + // * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + int32 code = 1; + + // The error display name. + string display_name = 2; + + // An error context may involve 0, 1 (most of the time) or more fields. For + // example, referring to vehicle #4 and shipment #2's first pickup can be + // done as follows: + // ``` + // fields { name: "vehicles" index: 4} + // fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + // ``` + // Note, however, that the cardinality of `fields` should not change for a + // given error code. + repeated FieldReference fields = 3; + + // Human-readable string describing the error. There is a 1:1 mapping + // between `code` and `error_message` (when code != "UNSPECIFIED"). + // + // *STABILITY*: Not stable: the error message associated to a given `code` may + // change (hopefully to clarify it) over time. Please rely on the + // `display_name` and `code` instead. + string error_message = 4; + + // May contain the value(s) of the field(s). This is not always available. You + // should absolutely not rely on it and use it only for manual model + // debugging. + string offending_values = 5; +} + +// Specify an input for +// [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours]. +message InputConfig { + // Required. + oneof source { + // A Google Cloud Storage location. This must be a single object (file). + GcsSource gcs_source = 1; + } + + // Required. The input data format. + DataFormat data_format = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Specify a destination for +// [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours] +// results. +message OutputConfig { + // Required. + oneof destination { + // The Google Cloud Storage location to write the output to. + GcsDestination gcs_destination = 1; + } + + // Required. The output data format. + DataFormat data_format = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the input file will be read from. +message GcsSource { + // Required. URI of a Google Cloud Storage object with the format + // `gs://bucket/path/to/object`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output file(s) will be written +// to. +message GcsDestination { + // Required. Google Cloud Storage URI. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Data formats for input and output files. +enum DataFormat { + // Invalid value, format must not be UNSPECIFIED. + DATA_FORMAT_UNSPECIFIED = 0; + + // JavaScript Object Notation. + JSON = 1; + + // Protocol Buffers text format. See + // https://protobuf.dev/reference/protobuf/textformat-spec/ + PROTO_TEXT = 2; +} diff --git a/packages/google-maps-routeoptimization/protos/protos.d.ts b/packages/google-maps-routeoptimization/protos/protos.d.ts new file mode 100644 index 00000000000..01d4860bb1f --- /dev/null +++ b/packages/google-maps-routeoptimization/protos/protos.d.ts @@ -0,0 +1,13382 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace maps. */ + namespace maps { + + /** Namespace routeoptimization. */ + namespace routeoptimization { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a RouteOptimization */ + class RouteOptimization extends $protobuf.rpc.Service { + + /** + * Constructs a new RouteOptimization service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new RouteOptimization service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): RouteOptimization; + + /** + * Calls OptimizeTours. + * @param request OptimizeToursRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OptimizeToursResponse + */ + public optimizeTours(request: google.maps.routeoptimization.v1.IOptimizeToursRequest, callback: google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursCallback): void; + + /** + * Calls OptimizeTours. + * @param request OptimizeToursRequest message or plain object + * @returns Promise + */ + public optimizeTours(request: google.maps.routeoptimization.v1.IOptimizeToursRequest): Promise; + + /** + * Calls BatchOptimizeTours. + * @param request BatchOptimizeToursRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchOptimizeTours(request: google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, callback: google.maps.routeoptimization.v1.RouteOptimization.BatchOptimizeToursCallback): void; + + /** + * Calls BatchOptimizeTours. + * @param request BatchOptimizeToursRequest message or plain object + * @returns Promise + */ + public batchOptimizeTours(request: google.maps.routeoptimization.v1.IBatchOptimizeToursRequest): Promise; + } + + namespace RouteOptimization { + + /** + * Callback as used by {@link google.maps.routeoptimization.v1.RouteOptimization|optimizeTours}. + * @param error Error, if any + * @param [response] OptimizeToursResponse + */ + type OptimizeToursCallback = (error: (Error|null), response?: google.maps.routeoptimization.v1.OptimizeToursResponse) => void; + + /** + * Callback as used by {@link google.maps.routeoptimization.v1.RouteOptimization|batchOptimizeTours}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchOptimizeToursCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a BatchOptimizeToursRequest. */ + interface IBatchOptimizeToursRequest { + + /** BatchOptimizeToursRequest parent */ + parent?: (string|null); + + /** BatchOptimizeToursRequest modelConfigs */ + modelConfigs?: (google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig[]|null); + } + + /** Represents a BatchOptimizeToursRequest. */ + class BatchOptimizeToursRequest implements IBatchOptimizeToursRequest { + + /** + * Constructs a new BatchOptimizeToursRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IBatchOptimizeToursRequest); + + /** BatchOptimizeToursRequest parent. */ + public parent: string; + + /** BatchOptimizeToursRequest modelConfigs. */ + public modelConfigs: google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig[]; + + /** + * Creates a new BatchOptimizeToursRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOptimizeToursRequest instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IBatchOptimizeToursRequest): google.maps.routeoptimization.v1.BatchOptimizeToursRequest; + + /** + * Encodes the specified BatchOptimizeToursRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.verify|verify} messages. + * @param message BatchOptimizeToursRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOptimizeToursRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.verify|verify} messages. + * @param message BatchOptimizeToursRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOptimizeToursRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BatchOptimizeToursRequest; + + /** + * Decodes a BatchOptimizeToursRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BatchOptimizeToursRequest; + + /** + * Verifies a BatchOptimizeToursRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOptimizeToursRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOptimizeToursRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BatchOptimizeToursRequest; + + /** + * Creates a plain object from a BatchOptimizeToursRequest message. Also converts values to other types if specified. + * @param message BatchOptimizeToursRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BatchOptimizeToursRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOptimizeToursRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOptimizeToursRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchOptimizeToursRequest { + + /** Properties of an AsyncModelConfig. */ + interface IAsyncModelConfig { + + /** AsyncModelConfig displayName */ + displayName?: (string|null); + + /** AsyncModelConfig inputConfig */ + inputConfig?: (google.maps.routeoptimization.v1.IInputConfig|null); + + /** AsyncModelConfig outputConfig */ + outputConfig?: (google.maps.routeoptimization.v1.IOutputConfig|null); + } + + /** Represents an AsyncModelConfig. */ + class AsyncModelConfig implements IAsyncModelConfig { + + /** + * Constructs a new AsyncModelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig); + + /** AsyncModelConfig displayName. */ + public displayName: string; + + /** AsyncModelConfig inputConfig. */ + public inputConfig?: (google.maps.routeoptimization.v1.IInputConfig|null); + + /** AsyncModelConfig outputConfig. */ + public outputConfig?: (google.maps.routeoptimization.v1.IOutputConfig|null); + + /** + * Creates a new AsyncModelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncModelConfig instance + */ + public static create(properties?: google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig): google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig; + + /** + * Encodes the specified AsyncModelConfig message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.verify|verify} messages. + * @param message AsyncModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncModelConfig message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.verify|verify} messages. + * @param message AsyncModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncModelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig; + + /** + * Decodes an AsyncModelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig; + + /** + * Verifies an AsyncModelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AsyncModelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncModelConfig + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig; + + /** + * Creates a plain object from an AsyncModelConfig message. Also converts values to other types if specified. + * @param message AsyncModelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncModelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AsyncModelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchOptimizeToursResponse. */ + interface IBatchOptimizeToursResponse { + } + + /** Represents a BatchOptimizeToursResponse. */ + class BatchOptimizeToursResponse implements IBatchOptimizeToursResponse { + + /** + * Constructs a new BatchOptimizeToursResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IBatchOptimizeToursResponse); + + /** + * Creates a new BatchOptimizeToursResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOptimizeToursResponse instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IBatchOptimizeToursResponse): google.maps.routeoptimization.v1.BatchOptimizeToursResponse; + + /** + * Encodes the specified BatchOptimizeToursResponse message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursResponse.verify|verify} messages. + * @param message BatchOptimizeToursResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOptimizeToursResponse message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursResponse.verify|verify} messages. + * @param message BatchOptimizeToursResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOptimizeToursResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BatchOptimizeToursResponse; + + /** + * Decodes a BatchOptimizeToursResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BatchOptimizeToursResponse; + + /** + * Verifies a BatchOptimizeToursResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOptimizeToursResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOptimizeToursResponse + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BatchOptimizeToursResponse; + + /** + * Creates a plain object from a BatchOptimizeToursResponse message. Also converts values to other types if specified. + * @param message BatchOptimizeToursResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BatchOptimizeToursResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOptimizeToursResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOptimizeToursResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchOptimizeToursMetadata. */ + interface IBatchOptimizeToursMetadata { + } + + /** Represents a BatchOptimizeToursMetadata. */ + class BatchOptimizeToursMetadata implements IBatchOptimizeToursMetadata { + + /** + * Constructs a new BatchOptimizeToursMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata); + + /** + * Creates a new BatchOptimizeToursMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOptimizeToursMetadata instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata): google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; + + /** + * Encodes the specified BatchOptimizeToursMetadata message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.verify|verify} messages. + * @param message BatchOptimizeToursMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOptimizeToursMetadata message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.verify|verify} messages. + * @param message BatchOptimizeToursMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOptimizeToursMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOptimizeToursMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; + + /** + * Decodes a BatchOptimizeToursMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOptimizeToursMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; + + /** + * Verifies a BatchOptimizeToursMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOptimizeToursMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOptimizeToursMetadata + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BatchOptimizeToursMetadata; + + /** + * Creates a plain object from a BatchOptimizeToursMetadata message. Also converts values to other types if specified. + * @param message BatchOptimizeToursMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BatchOptimizeToursMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOptimizeToursMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOptimizeToursMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizeToursRequest. */ + interface IOptimizeToursRequest { + + /** OptimizeToursRequest parent */ + parent?: (string|null); + + /** OptimizeToursRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** OptimizeToursRequest model */ + model?: (google.maps.routeoptimization.v1.IShipmentModel|null); + + /** OptimizeToursRequest solvingMode */ + solvingMode?: (google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode|keyof typeof google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode|null); + + /** OptimizeToursRequest searchMode */ + searchMode?: (google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode|keyof typeof google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode|null); + + /** OptimizeToursRequest injectedFirstSolutionRoutes */ + injectedFirstSolutionRoutes?: (google.maps.routeoptimization.v1.IShipmentRoute[]|null); + + /** OptimizeToursRequest injectedSolutionConstraint */ + injectedSolutionConstraint?: (google.maps.routeoptimization.v1.IInjectedSolutionConstraint|null); + + /** OptimizeToursRequest refreshDetailsRoutes */ + refreshDetailsRoutes?: (google.maps.routeoptimization.v1.IShipmentRoute[]|null); + + /** OptimizeToursRequest interpretInjectedSolutionsUsingLabels */ + interpretInjectedSolutionsUsingLabels?: (boolean|null); + + /** OptimizeToursRequest considerRoadTraffic */ + considerRoadTraffic?: (boolean|null); + + /** OptimizeToursRequest populatePolylines */ + populatePolylines?: (boolean|null); + + /** OptimizeToursRequest populateTransitionPolylines */ + populateTransitionPolylines?: (boolean|null); + + /** OptimizeToursRequest allowLargeDeadlineDespiteInterruptionRisk */ + allowLargeDeadlineDespiteInterruptionRisk?: (boolean|null); + + /** OptimizeToursRequest useGeodesicDistances */ + useGeodesicDistances?: (boolean|null); + + /** OptimizeToursRequest geodesicMetersPerSecond */ + geodesicMetersPerSecond?: (number|null); + + /** OptimizeToursRequest maxValidationErrors */ + maxValidationErrors?: (number|null); + + /** OptimizeToursRequest label */ + label?: (string|null); + } + + /** Represents an OptimizeToursRequest. */ + class OptimizeToursRequest implements IOptimizeToursRequest { + + /** + * Constructs a new OptimizeToursRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IOptimizeToursRequest); + + /** OptimizeToursRequest parent. */ + public parent: string; + + /** OptimizeToursRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** OptimizeToursRequest model. */ + public model?: (google.maps.routeoptimization.v1.IShipmentModel|null); + + /** OptimizeToursRequest solvingMode. */ + public solvingMode: (google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode|keyof typeof google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode); + + /** OptimizeToursRequest searchMode. */ + public searchMode: (google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode|keyof typeof google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode); + + /** OptimizeToursRequest injectedFirstSolutionRoutes. */ + public injectedFirstSolutionRoutes: google.maps.routeoptimization.v1.IShipmentRoute[]; + + /** OptimizeToursRequest injectedSolutionConstraint. */ + public injectedSolutionConstraint?: (google.maps.routeoptimization.v1.IInjectedSolutionConstraint|null); + + /** OptimizeToursRequest refreshDetailsRoutes. */ + public refreshDetailsRoutes: google.maps.routeoptimization.v1.IShipmentRoute[]; + + /** OptimizeToursRequest interpretInjectedSolutionsUsingLabels. */ + public interpretInjectedSolutionsUsingLabels: boolean; + + /** OptimizeToursRequest considerRoadTraffic. */ + public considerRoadTraffic: boolean; + + /** OptimizeToursRequest populatePolylines. */ + public populatePolylines: boolean; + + /** OptimizeToursRequest populateTransitionPolylines. */ + public populateTransitionPolylines: boolean; + + /** OptimizeToursRequest allowLargeDeadlineDespiteInterruptionRisk. */ + public allowLargeDeadlineDespiteInterruptionRisk: boolean; + + /** OptimizeToursRequest useGeodesicDistances. */ + public useGeodesicDistances: boolean; + + /** OptimizeToursRequest geodesicMetersPerSecond. */ + public geodesicMetersPerSecond?: (number|null); + + /** OptimizeToursRequest maxValidationErrors. */ + public maxValidationErrors?: (number|null); + + /** OptimizeToursRequest label. */ + public label: string; + + /** OptimizeToursRequest _geodesicMetersPerSecond. */ + public _geodesicMetersPerSecond?: "geodesicMetersPerSecond"; + + /** OptimizeToursRequest _maxValidationErrors. */ + public _maxValidationErrors?: "maxValidationErrors"; + + /** + * Creates a new OptimizeToursRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeToursRequest instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IOptimizeToursRequest): google.maps.routeoptimization.v1.OptimizeToursRequest; + + /** + * Encodes the specified OptimizeToursRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursRequest.verify|verify} messages. + * @param message OptimizeToursRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IOptimizeToursRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeToursRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursRequest.verify|verify} messages. + * @param message OptimizeToursRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IOptimizeToursRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeToursRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.OptimizeToursRequest; + + /** + * Decodes an OptimizeToursRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.OptimizeToursRequest; + + /** + * Verifies an OptimizeToursRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeToursRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeToursRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.OptimizeToursRequest; + + /** + * Creates a plain object from an OptimizeToursRequest message. Also converts values to other types if specified. + * @param message OptimizeToursRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.OptimizeToursRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeToursRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeToursRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OptimizeToursRequest { + + /** SolvingMode enum. */ + enum SolvingMode { + DEFAULT_SOLVE = 0, + VALIDATE_ONLY = 1, + DETECT_SOME_INFEASIBLE_SHIPMENTS = 2 + } + + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + RETURN_FAST = 1, + CONSUME_ALL_AVAILABLE_TIME = 2 + } + } + + /** Properties of an OptimizeToursResponse. */ + interface IOptimizeToursResponse { + + /** OptimizeToursResponse routes */ + routes?: (google.maps.routeoptimization.v1.IShipmentRoute[]|null); + + /** OptimizeToursResponse requestLabel */ + requestLabel?: (string|null); + + /** OptimizeToursResponse skippedShipments */ + skippedShipments?: (google.maps.routeoptimization.v1.ISkippedShipment[]|null); + + /** OptimizeToursResponse validationErrors */ + validationErrors?: (google.maps.routeoptimization.v1.IOptimizeToursValidationError[]|null); + + /** OptimizeToursResponse metrics */ + metrics?: (google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics|null); + } + + /** Represents an OptimizeToursResponse. */ + class OptimizeToursResponse implements IOptimizeToursResponse { + + /** + * Constructs a new OptimizeToursResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IOptimizeToursResponse); + + /** OptimizeToursResponse routes. */ + public routes: google.maps.routeoptimization.v1.IShipmentRoute[]; + + /** OptimizeToursResponse requestLabel. */ + public requestLabel: string; + + /** OptimizeToursResponse skippedShipments. */ + public skippedShipments: google.maps.routeoptimization.v1.ISkippedShipment[]; + + /** OptimizeToursResponse validationErrors. */ + public validationErrors: google.maps.routeoptimization.v1.IOptimizeToursValidationError[]; + + /** OptimizeToursResponse metrics. */ + public metrics?: (google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics|null); + + /** + * Creates a new OptimizeToursResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeToursResponse instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IOptimizeToursResponse): google.maps.routeoptimization.v1.OptimizeToursResponse; + + /** + * Encodes the specified OptimizeToursResponse message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.verify|verify} messages. + * @param message OptimizeToursResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IOptimizeToursResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeToursResponse message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.verify|verify} messages. + * @param message OptimizeToursResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IOptimizeToursResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeToursResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.OptimizeToursResponse; + + /** + * Decodes an OptimizeToursResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.OptimizeToursResponse; + + /** + * Verifies an OptimizeToursResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeToursResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeToursResponse + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.OptimizeToursResponse; + + /** + * Creates a plain object from an OptimizeToursResponse message. Also converts values to other types if specified. + * @param message OptimizeToursResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.OptimizeToursResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeToursResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeToursResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OptimizeToursResponse { + + /** Properties of a Metrics. */ + interface IMetrics { + + /** Metrics aggregatedRouteMetrics */ + aggregatedRouteMetrics?: (google.maps.routeoptimization.v1.IAggregatedMetrics|null); + + /** Metrics skippedMandatoryShipmentCount */ + skippedMandatoryShipmentCount?: (number|null); + + /** Metrics usedVehicleCount */ + usedVehicleCount?: (number|null); + + /** Metrics earliestVehicleStartTime */ + earliestVehicleStartTime?: (google.protobuf.ITimestamp|null); + + /** Metrics latestVehicleEndTime */ + latestVehicleEndTime?: (google.protobuf.ITimestamp|null); + + /** Metrics costs */ + costs?: ({ [k: string]: number }|null); + + /** Metrics totalCost */ + totalCost?: (number|null); + } + + /** Represents a Metrics. */ + class Metrics implements IMetrics { + + /** + * Constructs a new Metrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics); + + /** Metrics aggregatedRouteMetrics. */ + public aggregatedRouteMetrics?: (google.maps.routeoptimization.v1.IAggregatedMetrics|null); + + /** Metrics skippedMandatoryShipmentCount. */ + public skippedMandatoryShipmentCount: number; + + /** Metrics usedVehicleCount. */ + public usedVehicleCount: number; + + /** Metrics earliestVehicleStartTime. */ + public earliestVehicleStartTime?: (google.protobuf.ITimestamp|null); + + /** Metrics latestVehicleEndTime. */ + public latestVehicleEndTime?: (google.protobuf.ITimestamp|null); + + /** Metrics costs. */ + public costs: { [k: string]: number }; + + /** Metrics totalCost. */ + public totalCost: number; + + /** + * Creates a new Metrics instance using the specified properties. + * @param [properties] Properties to set + * @returns Metrics instance + */ + public static create(properties?: google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics): google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics; + + /** + * Verifies a Metrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metrics + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @param message Metrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ShipmentModel. */ + interface IShipmentModel { + + /** ShipmentModel shipments */ + shipments?: (google.maps.routeoptimization.v1.IShipment[]|null); + + /** ShipmentModel vehicles */ + vehicles?: (google.maps.routeoptimization.v1.IVehicle[]|null); + + /** ShipmentModel maxActiveVehicles */ + maxActiveVehicles?: (number|null); + + /** ShipmentModel globalStartTime */ + globalStartTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentModel globalEndTime */ + globalEndTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentModel globalDurationCostPerHour */ + globalDurationCostPerHour?: (number|null); + + /** ShipmentModel durationDistanceMatrices */ + durationDistanceMatrices?: (google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix[]|null); + + /** ShipmentModel durationDistanceMatrixSrcTags */ + durationDistanceMatrixSrcTags?: (string[]|null); + + /** ShipmentModel durationDistanceMatrixDstTags */ + durationDistanceMatrixDstTags?: (string[]|null); + + /** ShipmentModel transitionAttributes */ + transitionAttributes?: (google.maps.routeoptimization.v1.ITransitionAttributes[]|null); + + /** ShipmentModel shipmentTypeIncompatibilities */ + shipmentTypeIncompatibilities?: (google.maps.routeoptimization.v1.IShipmentTypeIncompatibility[]|null); + + /** ShipmentModel shipmentTypeRequirements */ + shipmentTypeRequirements?: (google.maps.routeoptimization.v1.IShipmentTypeRequirement[]|null); + + /** ShipmentModel precedenceRules */ + precedenceRules?: (google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule[]|null); + } + + /** Represents a ShipmentModel. */ + class ShipmentModel implements IShipmentModel { + + /** + * Constructs a new ShipmentModel. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IShipmentModel); + + /** ShipmentModel shipments. */ + public shipments: google.maps.routeoptimization.v1.IShipment[]; + + /** ShipmentModel vehicles. */ + public vehicles: google.maps.routeoptimization.v1.IVehicle[]; + + /** ShipmentModel maxActiveVehicles. */ + public maxActiveVehicles?: (number|null); + + /** ShipmentModel globalStartTime. */ + public globalStartTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentModel globalEndTime. */ + public globalEndTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentModel globalDurationCostPerHour. */ + public globalDurationCostPerHour: number; + + /** ShipmentModel durationDistanceMatrices. */ + public durationDistanceMatrices: google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix[]; + + /** ShipmentModel durationDistanceMatrixSrcTags. */ + public durationDistanceMatrixSrcTags: string[]; + + /** ShipmentModel durationDistanceMatrixDstTags. */ + public durationDistanceMatrixDstTags: string[]; + + /** ShipmentModel transitionAttributes. */ + public transitionAttributes: google.maps.routeoptimization.v1.ITransitionAttributes[]; + + /** ShipmentModel shipmentTypeIncompatibilities. */ + public shipmentTypeIncompatibilities: google.maps.routeoptimization.v1.IShipmentTypeIncompatibility[]; + + /** ShipmentModel shipmentTypeRequirements. */ + public shipmentTypeRequirements: google.maps.routeoptimization.v1.IShipmentTypeRequirement[]; + + /** ShipmentModel precedenceRules. */ + public precedenceRules: google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule[]; + + /** ShipmentModel _maxActiveVehicles. */ + public _maxActiveVehicles?: "maxActiveVehicles"; + + /** + * Creates a new ShipmentModel instance using the specified properties. + * @param [properties] Properties to set + * @returns ShipmentModel instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IShipmentModel): google.maps.routeoptimization.v1.ShipmentModel; + + /** + * Encodes the specified ShipmentModel message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.verify|verify} messages. + * @param message ShipmentModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IShipmentModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShipmentModel message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.verify|verify} messages. + * @param message ShipmentModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IShipmentModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShipmentModel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShipmentModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentModel; + + /** + * Decodes a ShipmentModel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShipmentModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentModel; + + /** + * Verifies a ShipmentModel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShipmentModel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShipmentModel + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentModel; + + /** + * Creates a plain object from a ShipmentModel message. Also converts values to other types if specified. + * @param message ShipmentModel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShipmentModel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShipmentModel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ShipmentModel { + + /** Properties of a DurationDistanceMatrix. */ + interface IDurationDistanceMatrix { + + /** DurationDistanceMatrix rows */ + rows?: (google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow[]|null); + + /** DurationDistanceMatrix vehicleStartTag */ + vehicleStartTag?: (string|null); + } + + /** Represents a DurationDistanceMatrix. */ + class DurationDistanceMatrix implements IDurationDistanceMatrix { + + /** + * Constructs a new DurationDistanceMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix); + + /** DurationDistanceMatrix rows. */ + public rows: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow[]; + + /** DurationDistanceMatrix vehicleStartTag. */ + public vehicleStartTag: string; + + /** + * Creates a new DurationDistanceMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns DurationDistanceMatrix instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix; + + /** + * Encodes the specified DurationDistanceMatrix message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.verify|verify} messages. + * @param message DurationDistanceMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DurationDistanceMatrix message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.verify|verify} messages. + * @param message DurationDistanceMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DurationDistanceMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DurationDistanceMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix; + + /** + * Decodes a DurationDistanceMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DurationDistanceMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix; + + /** + * Verifies a DurationDistanceMatrix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DurationDistanceMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DurationDistanceMatrix + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix; + + /** + * Creates a plain object from a DurationDistanceMatrix message. Also converts values to other types if specified. + * @param message DurationDistanceMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DurationDistanceMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DurationDistanceMatrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DurationDistanceMatrix { + + /** Properties of a Row. */ + interface IRow { + + /** Row durations */ + durations?: (google.protobuf.IDuration[]|null); + + /** Row meters */ + meters?: (number[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow); + + /** Row durations. */ + public durations: google.protobuf.IDuration[]; + + /** Row meters. */ + public meters: number[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PrecedenceRule. */ + interface IPrecedenceRule { + + /** PrecedenceRule firstIndex */ + firstIndex?: (number|null); + + /** PrecedenceRule firstIsDelivery */ + firstIsDelivery?: (boolean|null); + + /** PrecedenceRule secondIndex */ + secondIndex?: (number|null); + + /** PrecedenceRule secondIsDelivery */ + secondIsDelivery?: (boolean|null); + + /** PrecedenceRule offsetDuration */ + offsetDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a PrecedenceRule. */ + class PrecedenceRule implements IPrecedenceRule { + + /** + * Constructs a new PrecedenceRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule); + + /** PrecedenceRule firstIndex. */ + public firstIndex?: (number|null); + + /** PrecedenceRule firstIsDelivery. */ + public firstIsDelivery: boolean; + + /** PrecedenceRule secondIndex. */ + public secondIndex?: (number|null); + + /** PrecedenceRule secondIsDelivery. */ + public secondIsDelivery: boolean; + + /** PrecedenceRule offsetDuration. */ + public offsetDuration?: (google.protobuf.IDuration|null); + + /** PrecedenceRule _firstIndex. */ + public _firstIndex?: "firstIndex"; + + /** PrecedenceRule _secondIndex. */ + public _secondIndex?: "secondIndex"; + + /** + * Creates a new PrecedenceRule instance using the specified properties. + * @param [properties] Properties to set + * @returns PrecedenceRule instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule): google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule; + + /** + * Encodes the specified PrecedenceRule message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.verify|verify} messages. + * @param message PrecedenceRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrecedenceRule message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.verify|verify} messages. + * @param message PrecedenceRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrecedenceRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrecedenceRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule; + + /** + * Decodes a PrecedenceRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrecedenceRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule; + + /** + * Verifies a PrecedenceRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrecedenceRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrecedenceRule + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule; + + /** + * Creates a plain object from a PrecedenceRule message. Also converts values to other types if specified. + * @param message PrecedenceRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrecedenceRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrecedenceRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Shipment. */ + interface IShipment { + + /** Shipment displayName */ + displayName?: (string|null); + + /** Shipment pickups */ + pickups?: (google.maps.routeoptimization.v1.Shipment.IVisitRequest[]|null); + + /** Shipment deliveries */ + deliveries?: (google.maps.routeoptimization.v1.Shipment.IVisitRequest[]|null); + + /** Shipment loadDemands */ + loadDemands?: ({ [k: string]: google.maps.routeoptimization.v1.Shipment.ILoad }|null); + + /** Shipment penaltyCost */ + penaltyCost?: (number|null); + + /** Shipment allowedVehicleIndices */ + allowedVehicleIndices?: (number[]|null); + + /** Shipment costsPerVehicle */ + costsPerVehicle?: (number[]|null); + + /** Shipment costsPerVehicleIndices */ + costsPerVehicleIndices?: (number[]|null); + + /** Shipment pickupToDeliveryRelativeDetourLimit */ + pickupToDeliveryRelativeDetourLimit?: (number|null); + + /** Shipment pickupToDeliveryAbsoluteDetourLimit */ + pickupToDeliveryAbsoluteDetourLimit?: (google.protobuf.IDuration|null); + + /** Shipment pickupToDeliveryTimeLimit */ + pickupToDeliveryTimeLimit?: (google.protobuf.IDuration|null); + + /** Shipment shipmentType */ + shipmentType?: (string|null); + + /** Shipment label */ + label?: (string|null); + + /** Shipment ignore */ + ignore?: (boolean|null); + } + + /** Represents a Shipment. */ + class Shipment implements IShipment { + + /** + * Constructs a new Shipment. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IShipment); + + /** Shipment displayName. */ + public displayName: string; + + /** Shipment pickups. */ + public pickups: google.maps.routeoptimization.v1.Shipment.IVisitRequest[]; + + /** Shipment deliveries. */ + public deliveries: google.maps.routeoptimization.v1.Shipment.IVisitRequest[]; + + /** Shipment loadDemands. */ + public loadDemands: { [k: string]: google.maps.routeoptimization.v1.Shipment.ILoad }; + + /** Shipment penaltyCost. */ + public penaltyCost?: (number|null); + + /** Shipment allowedVehicleIndices. */ + public allowedVehicleIndices: number[]; + + /** Shipment costsPerVehicle. */ + public costsPerVehicle: number[]; + + /** Shipment costsPerVehicleIndices. */ + public costsPerVehicleIndices: number[]; + + /** Shipment pickupToDeliveryRelativeDetourLimit. */ + public pickupToDeliveryRelativeDetourLimit?: (number|null); + + /** Shipment pickupToDeliveryAbsoluteDetourLimit. */ + public pickupToDeliveryAbsoluteDetourLimit?: (google.protobuf.IDuration|null); + + /** Shipment pickupToDeliveryTimeLimit. */ + public pickupToDeliveryTimeLimit?: (google.protobuf.IDuration|null); + + /** Shipment shipmentType. */ + public shipmentType: string; + + /** Shipment label. */ + public label: string; + + /** Shipment ignore. */ + public ignore: boolean; + + /** Shipment _penaltyCost. */ + public _penaltyCost?: "penaltyCost"; + + /** Shipment _pickupToDeliveryRelativeDetourLimit. */ + public _pickupToDeliveryRelativeDetourLimit?: "pickupToDeliveryRelativeDetourLimit"; + + /** + * Creates a new Shipment instance using the specified properties. + * @param [properties] Properties to set + * @returns Shipment instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IShipment): google.maps.routeoptimization.v1.Shipment; + + /** + * Encodes the specified Shipment message. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.verify|verify} messages. + * @param message Shipment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IShipment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Shipment message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.verify|verify} messages. + * @param message Shipment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IShipment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Shipment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Shipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Shipment; + + /** + * Decodes a Shipment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Shipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Shipment; + + /** + * Verifies a Shipment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Shipment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Shipment + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Shipment; + + /** + * Creates a plain object from a Shipment message. Also converts values to other types if specified. + * @param message Shipment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Shipment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Shipment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Shipment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Shipment { + + /** Properties of a VisitRequest. */ + interface IVisitRequest { + + /** VisitRequest arrivalLocation */ + arrivalLocation?: (google.type.ILatLng|null); + + /** VisitRequest arrivalWaypoint */ + arrivalWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** VisitRequest departureLocation */ + departureLocation?: (google.type.ILatLng|null); + + /** VisitRequest departureWaypoint */ + departureWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** VisitRequest tags */ + tags?: (string[]|null); + + /** VisitRequest timeWindows */ + timeWindows?: (google.maps.routeoptimization.v1.ITimeWindow[]|null); + + /** VisitRequest duration */ + duration?: (google.protobuf.IDuration|null); + + /** VisitRequest cost */ + cost?: (number|null); + + /** VisitRequest loadDemands */ + loadDemands?: ({ [k: string]: google.maps.routeoptimization.v1.Shipment.ILoad }|null); + + /** VisitRequest visitTypes */ + visitTypes?: (string[]|null); + + /** VisitRequest label */ + label?: (string|null); + } + + /** Represents a VisitRequest. */ + class VisitRequest implements IVisitRequest { + + /** + * Constructs a new VisitRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.Shipment.IVisitRequest); + + /** VisitRequest arrivalLocation. */ + public arrivalLocation?: (google.type.ILatLng|null); + + /** VisitRequest arrivalWaypoint. */ + public arrivalWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** VisitRequest departureLocation. */ + public departureLocation?: (google.type.ILatLng|null); + + /** VisitRequest departureWaypoint. */ + public departureWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** VisitRequest tags. */ + public tags: string[]; + + /** VisitRequest timeWindows. */ + public timeWindows: google.maps.routeoptimization.v1.ITimeWindow[]; + + /** VisitRequest duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** VisitRequest cost. */ + public cost: number; + + /** VisitRequest loadDemands. */ + public loadDemands: { [k: string]: google.maps.routeoptimization.v1.Shipment.ILoad }; + + /** VisitRequest visitTypes. */ + public visitTypes: string[]; + + /** VisitRequest label. */ + public label: string; + + /** + * Creates a new VisitRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns VisitRequest instance + */ + public static create(properties?: google.maps.routeoptimization.v1.Shipment.IVisitRequest): google.maps.routeoptimization.v1.Shipment.VisitRequest; + + /** + * Encodes the specified VisitRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.VisitRequest.verify|verify} messages. + * @param message VisitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.Shipment.IVisitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisitRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.VisitRequest.verify|verify} messages. + * @param message VisitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.Shipment.IVisitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisitRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Shipment.VisitRequest; + + /** + * Decodes a VisitRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Shipment.VisitRequest; + + /** + * Verifies a VisitRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisitRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisitRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Shipment.VisitRequest; + + /** + * Creates a plain object from a VisitRequest message. Also converts values to other types if specified. + * @param message VisitRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Shipment.VisitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisitRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisitRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Load. */ + interface ILoad { + + /** Load amount */ + amount?: (number|Long|string|null); + } + + /** Represents a Load. */ + class Load implements ILoad { + + /** + * Constructs a new Load. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.Shipment.ILoad); + + /** Load amount. */ + public amount: (number|Long|string); + + /** + * Creates a new Load instance using the specified properties. + * @param [properties] Properties to set + * @returns Load instance + */ + public static create(properties?: google.maps.routeoptimization.v1.Shipment.ILoad): google.maps.routeoptimization.v1.Shipment.Load; + + /** + * Encodes the specified Load message. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.Load.verify|verify} messages. + * @param message Load message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.Shipment.ILoad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Load message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.Load.verify|verify} messages. + * @param message Load message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.Shipment.ILoad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Load message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Load + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Shipment.Load; + + /** + * Decodes a Load message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Load + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Shipment.Load; + + /** + * Verifies a Load message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Load message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Load + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Shipment.Load; + + /** + * Creates a plain object from a Load message. Also converts values to other types if specified. + * @param message Load + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Shipment.Load, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Load to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Load + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ShipmentTypeIncompatibility. */ + interface IShipmentTypeIncompatibility { + + /** ShipmentTypeIncompatibility types */ + types?: (string[]|null); + + /** ShipmentTypeIncompatibility incompatibilityMode */ + incompatibilityMode?: (google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode|keyof typeof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode|null); + } + + /** Represents a ShipmentTypeIncompatibility. */ + class ShipmentTypeIncompatibility implements IShipmentTypeIncompatibility { + + /** + * Constructs a new ShipmentTypeIncompatibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IShipmentTypeIncompatibility); + + /** ShipmentTypeIncompatibility types. */ + public types: string[]; + + /** ShipmentTypeIncompatibility incompatibilityMode. */ + public incompatibilityMode: (google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode|keyof typeof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode); + + /** + * Creates a new ShipmentTypeIncompatibility instance using the specified properties. + * @param [properties] Properties to set + * @returns ShipmentTypeIncompatibility instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IShipmentTypeIncompatibility): google.maps.routeoptimization.v1.ShipmentTypeIncompatibility; + + /** + * Encodes the specified ShipmentTypeIncompatibility message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.verify|verify} messages. + * @param message ShipmentTypeIncompatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IShipmentTypeIncompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShipmentTypeIncompatibility message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.verify|verify} messages. + * @param message ShipmentTypeIncompatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IShipmentTypeIncompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShipmentTypeIncompatibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShipmentTypeIncompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentTypeIncompatibility; + + /** + * Decodes a ShipmentTypeIncompatibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShipmentTypeIncompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentTypeIncompatibility; + + /** + * Verifies a ShipmentTypeIncompatibility message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShipmentTypeIncompatibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShipmentTypeIncompatibility + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentTypeIncompatibility; + + /** + * Creates a plain object from a ShipmentTypeIncompatibility message. Also converts values to other types if specified. + * @param message ShipmentTypeIncompatibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentTypeIncompatibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShipmentTypeIncompatibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShipmentTypeIncompatibility + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ShipmentTypeIncompatibility { + + /** IncompatibilityMode enum. */ + enum IncompatibilityMode { + INCOMPATIBILITY_MODE_UNSPECIFIED = 0, + NOT_PERFORMED_BY_SAME_VEHICLE = 1, + NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2 + } + } + + /** Properties of a ShipmentTypeRequirement. */ + interface IShipmentTypeRequirement { + + /** ShipmentTypeRequirement requiredShipmentTypeAlternatives */ + requiredShipmentTypeAlternatives?: (string[]|null); + + /** ShipmentTypeRequirement dependentShipmentTypes */ + dependentShipmentTypes?: (string[]|null); + + /** ShipmentTypeRequirement requirementMode */ + requirementMode?: (google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode|keyof typeof google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode|null); + } + + /** Represents a ShipmentTypeRequirement. */ + class ShipmentTypeRequirement implements IShipmentTypeRequirement { + + /** + * Constructs a new ShipmentTypeRequirement. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IShipmentTypeRequirement); + + /** ShipmentTypeRequirement requiredShipmentTypeAlternatives. */ + public requiredShipmentTypeAlternatives: string[]; + + /** ShipmentTypeRequirement dependentShipmentTypes. */ + public dependentShipmentTypes: string[]; + + /** ShipmentTypeRequirement requirementMode. */ + public requirementMode: (google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode|keyof typeof google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode); + + /** + * Creates a new ShipmentTypeRequirement instance using the specified properties. + * @param [properties] Properties to set + * @returns ShipmentTypeRequirement instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IShipmentTypeRequirement): google.maps.routeoptimization.v1.ShipmentTypeRequirement; + + /** + * Encodes the specified ShipmentTypeRequirement message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeRequirement.verify|verify} messages. + * @param message ShipmentTypeRequirement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IShipmentTypeRequirement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShipmentTypeRequirement message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeRequirement.verify|verify} messages. + * @param message ShipmentTypeRequirement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IShipmentTypeRequirement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShipmentTypeRequirement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShipmentTypeRequirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentTypeRequirement; + + /** + * Decodes a ShipmentTypeRequirement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShipmentTypeRequirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentTypeRequirement; + + /** + * Verifies a ShipmentTypeRequirement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShipmentTypeRequirement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShipmentTypeRequirement + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentTypeRequirement; + + /** + * Creates a plain object from a ShipmentTypeRequirement message. Also converts values to other types if specified. + * @param message ShipmentTypeRequirement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentTypeRequirement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShipmentTypeRequirement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShipmentTypeRequirement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ShipmentTypeRequirement { + + /** RequirementMode enum. */ + enum RequirementMode { + REQUIREMENT_MODE_UNSPECIFIED = 0, + PERFORMED_BY_SAME_VEHICLE = 1, + IN_SAME_VEHICLE_AT_PICKUP_TIME = 2, + IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3 + } + } + + /** Properties of a Vehicle. */ + interface IVehicle { + + /** Vehicle displayName */ + displayName?: (string|null); + + /** Vehicle travelMode */ + travelMode?: (google.maps.routeoptimization.v1.Vehicle.TravelMode|keyof typeof google.maps.routeoptimization.v1.Vehicle.TravelMode|null); + + /** Vehicle startLocation */ + startLocation?: (google.type.ILatLng|null); + + /** Vehicle startWaypoint */ + startWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** Vehicle endLocation */ + endLocation?: (google.type.ILatLng|null); + + /** Vehicle endWaypoint */ + endWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** Vehicle startTags */ + startTags?: (string[]|null); + + /** Vehicle endTags */ + endTags?: (string[]|null); + + /** Vehicle startTimeWindows */ + startTimeWindows?: (google.maps.routeoptimization.v1.ITimeWindow[]|null); + + /** Vehicle endTimeWindows */ + endTimeWindows?: (google.maps.routeoptimization.v1.ITimeWindow[]|null); + + /** Vehicle travelDurationMultiple */ + travelDurationMultiple?: (number|null); + + /** Vehicle unloadingPolicy */ + unloadingPolicy?: (google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy|keyof typeof google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy|null); + + /** Vehicle loadLimits */ + loadLimits?: ({ [k: string]: google.maps.routeoptimization.v1.Vehicle.ILoadLimit }|null); + + /** Vehicle costPerHour */ + costPerHour?: (number|null); + + /** Vehicle costPerTraveledHour */ + costPerTraveledHour?: (number|null); + + /** Vehicle costPerKilometer */ + costPerKilometer?: (number|null); + + /** Vehicle fixedCost */ + fixedCost?: (number|null); + + /** Vehicle usedIfRouteIsEmpty */ + usedIfRouteIsEmpty?: (boolean|null); + + /** Vehicle routeDurationLimit */ + routeDurationLimit?: (google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null); + + /** Vehicle travelDurationLimit */ + travelDurationLimit?: (google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null); + + /** Vehicle routeDistanceLimit */ + routeDistanceLimit?: (google.maps.routeoptimization.v1.IDistanceLimit|null); + + /** Vehicle extraVisitDurationForVisitType */ + extraVisitDurationForVisitType?: ({ [k: string]: google.protobuf.IDuration }|null); + + /** Vehicle breakRule */ + breakRule?: (google.maps.routeoptimization.v1.IBreakRule|null); + + /** Vehicle label */ + label?: (string|null); + + /** Vehicle ignore */ + ignore?: (boolean|null); + } + + /** Represents a Vehicle. */ + class Vehicle implements IVehicle { + + /** + * Constructs a new Vehicle. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IVehicle); + + /** Vehicle displayName. */ + public displayName: string; + + /** Vehicle travelMode. */ + public travelMode: (google.maps.routeoptimization.v1.Vehicle.TravelMode|keyof typeof google.maps.routeoptimization.v1.Vehicle.TravelMode); + + /** Vehicle startLocation. */ + public startLocation?: (google.type.ILatLng|null); + + /** Vehicle startWaypoint. */ + public startWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** Vehicle endLocation. */ + public endLocation?: (google.type.ILatLng|null); + + /** Vehicle endWaypoint. */ + public endWaypoint?: (google.maps.routeoptimization.v1.IWaypoint|null); + + /** Vehicle startTags. */ + public startTags: string[]; + + /** Vehicle endTags. */ + public endTags: string[]; + + /** Vehicle startTimeWindows. */ + public startTimeWindows: google.maps.routeoptimization.v1.ITimeWindow[]; + + /** Vehicle endTimeWindows. */ + public endTimeWindows: google.maps.routeoptimization.v1.ITimeWindow[]; + + /** Vehicle travelDurationMultiple. */ + public travelDurationMultiple?: (number|null); + + /** Vehicle unloadingPolicy. */ + public unloadingPolicy: (google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy|keyof typeof google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy); + + /** Vehicle loadLimits. */ + public loadLimits: { [k: string]: google.maps.routeoptimization.v1.Vehicle.ILoadLimit }; + + /** Vehicle costPerHour. */ + public costPerHour: number; + + /** Vehicle costPerTraveledHour. */ + public costPerTraveledHour: number; + + /** Vehicle costPerKilometer. */ + public costPerKilometer: number; + + /** Vehicle fixedCost. */ + public fixedCost: number; + + /** Vehicle usedIfRouteIsEmpty. */ + public usedIfRouteIsEmpty: boolean; + + /** Vehicle routeDurationLimit. */ + public routeDurationLimit?: (google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null); + + /** Vehicle travelDurationLimit. */ + public travelDurationLimit?: (google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null); + + /** Vehicle routeDistanceLimit. */ + public routeDistanceLimit?: (google.maps.routeoptimization.v1.IDistanceLimit|null); + + /** Vehicle extraVisitDurationForVisitType. */ + public extraVisitDurationForVisitType: { [k: string]: google.protobuf.IDuration }; + + /** Vehicle breakRule. */ + public breakRule?: (google.maps.routeoptimization.v1.IBreakRule|null); + + /** Vehicle label. */ + public label: string; + + /** Vehicle ignore. */ + public ignore: boolean; + + /** Vehicle _travelDurationMultiple. */ + public _travelDurationMultiple?: "travelDurationMultiple"; + + /** + * Creates a new Vehicle instance using the specified properties. + * @param [properties] Properties to set + * @returns Vehicle instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IVehicle): google.maps.routeoptimization.v1.Vehicle; + + /** + * Encodes the specified Vehicle message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.verify|verify} messages. + * @param message Vehicle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IVehicle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vehicle message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.verify|verify} messages. + * @param message Vehicle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IVehicle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vehicle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vehicle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Vehicle; + + /** + * Decodes a Vehicle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vehicle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Vehicle; + + /** + * Verifies a Vehicle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vehicle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vehicle + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Vehicle; + + /** + * Creates a plain object from a Vehicle message. Also converts values to other types if specified. + * @param message Vehicle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Vehicle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vehicle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vehicle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Vehicle { + + /** TravelMode enum. */ + enum TravelMode { + TRAVEL_MODE_UNSPECIFIED = 0, + DRIVING = 1, + WALKING = 2 + } + + /** UnloadingPolicy enum. */ + enum UnloadingPolicy { + UNLOADING_POLICY_UNSPECIFIED = 0, + LAST_IN_FIRST_OUT = 1, + FIRST_IN_FIRST_OUT = 2 + } + + /** Properties of a LoadLimit. */ + interface ILoadLimit { + + /** LoadLimit maxLoad */ + maxLoad?: (number|Long|string|null); + + /** LoadLimit softMaxLoad */ + softMaxLoad?: (number|Long|string|null); + + /** LoadLimit costPerUnitAboveSoftMax */ + costPerUnitAboveSoftMax?: (number|null); + + /** LoadLimit startLoadInterval */ + startLoadInterval?: (google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null); + + /** LoadLimit endLoadInterval */ + endLoadInterval?: (google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null); + } + + /** Represents a LoadLimit. */ + class LoadLimit implements ILoadLimit { + + /** + * Constructs a new LoadLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.Vehicle.ILoadLimit); + + /** LoadLimit maxLoad. */ + public maxLoad?: (number|Long|string|null); + + /** LoadLimit softMaxLoad. */ + public softMaxLoad: (number|Long|string); + + /** LoadLimit costPerUnitAboveSoftMax. */ + public costPerUnitAboveSoftMax: number; + + /** LoadLimit startLoadInterval. */ + public startLoadInterval?: (google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null); + + /** LoadLimit endLoadInterval. */ + public endLoadInterval?: (google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null); + + /** LoadLimit _maxLoad. */ + public _maxLoad?: "maxLoad"; + + /** + * Creates a new LoadLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadLimit instance + */ + public static create(properties?: google.maps.routeoptimization.v1.Vehicle.ILoadLimit): google.maps.routeoptimization.v1.Vehicle.LoadLimit; + + /** + * Encodes the specified LoadLimit message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.verify|verify} messages. + * @param message LoadLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.Vehicle.ILoadLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadLimit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.verify|verify} messages. + * @param message LoadLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.Vehicle.ILoadLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Vehicle.LoadLimit; + + /** + * Decodes a LoadLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Vehicle.LoadLimit; + + /** + * Verifies a LoadLimit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoadLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadLimit + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Vehicle.LoadLimit; + + /** + * Creates a plain object from a LoadLimit message. Also converts values to other types if specified. + * @param message LoadLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Vehicle.LoadLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LoadLimit { + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval min */ + min?: (number|Long|string|null); + + /** Interval max */ + max?: (number|Long|string|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval); + + /** Interval min. */ + public min: (number|Long|string); + + /** Interval max. */ + public max?: (number|Long|string|null); + + /** Interval _max. */ + public _max?: "max"; + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval): google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval; + + /** + * Verifies an Interval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DurationLimit. */ + interface IDurationLimit { + + /** DurationLimit maxDuration */ + maxDuration?: (google.protobuf.IDuration|null); + + /** DurationLimit softMaxDuration */ + softMaxDuration?: (google.protobuf.IDuration|null); + + /** DurationLimit costPerHourAfterSoftMax */ + costPerHourAfterSoftMax?: (number|null); + + /** DurationLimit quadraticSoftMaxDuration */ + quadraticSoftMaxDuration?: (google.protobuf.IDuration|null); + + /** DurationLimit costPerSquareHourAfterQuadraticSoftMax */ + costPerSquareHourAfterQuadraticSoftMax?: (number|null); + } + + /** Represents a DurationLimit. */ + class DurationLimit implements IDurationLimit { + + /** + * Constructs a new DurationLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.Vehicle.IDurationLimit); + + /** DurationLimit maxDuration. */ + public maxDuration?: (google.protobuf.IDuration|null); + + /** DurationLimit softMaxDuration. */ + public softMaxDuration?: (google.protobuf.IDuration|null); + + /** DurationLimit costPerHourAfterSoftMax. */ + public costPerHourAfterSoftMax?: (number|null); + + /** DurationLimit quadraticSoftMaxDuration. */ + public quadraticSoftMaxDuration?: (google.protobuf.IDuration|null); + + /** DurationLimit costPerSquareHourAfterQuadraticSoftMax. */ + public costPerSquareHourAfterQuadraticSoftMax?: (number|null); + + /** DurationLimit _costPerHourAfterSoftMax. */ + public _costPerHourAfterSoftMax?: "costPerHourAfterSoftMax"; + + /** DurationLimit _costPerSquareHourAfterQuadraticSoftMax. */ + public _costPerSquareHourAfterQuadraticSoftMax?: "costPerSquareHourAfterQuadraticSoftMax"; + + /** + * Creates a new DurationLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns DurationLimit instance + */ + public static create(properties?: google.maps.routeoptimization.v1.Vehicle.IDurationLimit): google.maps.routeoptimization.v1.Vehicle.DurationLimit; + + /** + * Encodes the specified DurationLimit message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.DurationLimit.verify|verify} messages. + * @param message DurationLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.Vehicle.IDurationLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DurationLimit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.DurationLimit.verify|verify} messages. + * @param message DurationLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.Vehicle.IDurationLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DurationLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DurationLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Vehicle.DurationLimit; + + /** + * Decodes a DurationLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DurationLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Vehicle.DurationLimit; + + /** + * Verifies a DurationLimit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DurationLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DurationLimit + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Vehicle.DurationLimit; + + /** + * Creates a plain object from a DurationLimit message. Also converts values to other types if specified. + * @param message DurationLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Vehicle.DurationLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DurationLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DurationLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow softStartTime */ + softStartTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow softEndTime */ + softEndTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow costPerHourBeforeSoftStartTime */ + costPerHourBeforeSoftStartTime?: (number|null); + + /** TimeWindow costPerHourAfterSoftEndTime */ + costPerHourAfterSoftEndTime?: (number|null); + } + + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { + + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow softStartTime. */ + public softStartTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow softEndTime. */ + public softEndTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow costPerHourBeforeSoftStartTime. */ + public costPerHourBeforeSoftStartTime?: (number|null); + + /** TimeWindow costPerHourAfterSoftEndTime. */ + public costPerHourAfterSoftEndTime?: (number|null); + + /** TimeWindow _costPerHourBeforeSoftStartTime. */ + public _costPerHourBeforeSoftStartTime?: "costPerHourBeforeSoftStartTime"; + + /** TimeWindow _costPerHourAfterSoftEndTime. */ + public _costPerHourAfterSoftEndTime?: "costPerHourAfterSoftEndTime"; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ITimeWindow): google.maps.routeoptimization.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.maps.routeoptimization.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.TimeWindow; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.TimeWindow; + + /** + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.TimeWindow; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DistanceLimit. */ + interface IDistanceLimit { + + /** DistanceLimit maxMeters */ + maxMeters?: (number|Long|string|null); + + /** DistanceLimit softMaxMeters */ + softMaxMeters?: (number|Long|string|null); + + /** DistanceLimit costPerKilometerAboveSoftMax */ + costPerKilometerAboveSoftMax?: (number|null); + } + + /** Represents a DistanceLimit. */ + class DistanceLimit implements IDistanceLimit { + + /** + * Constructs a new DistanceLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IDistanceLimit); + + /** DistanceLimit maxMeters. */ + public maxMeters?: (number|Long|string|null); + + /** DistanceLimit softMaxMeters. */ + public softMaxMeters?: (number|Long|string|null); + + /** DistanceLimit costPerKilometerAboveSoftMax. */ + public costPerKilometerAboveSoftMax?: (number|null); + + /** DistanceLimit _maxMeters. */ + public _maxMeters?: "maxMeters"; + + /** DistanceLimit _softMaxMeters. */ + public _softMaxMeters?: "softMaxMeters"; + + /** DistanceLimit _costPerKilometerAboveSoftMax. */ + public _costPerKilometerAboveSoftMax?: "costPerKilometerAboveSoftMax"; + + /** + * Creates a new DistanceLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns DistanceLimit instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IDistanceLimit): google.maps.routeoptimization.v1.DistanceLimit; + + /** + * Encodes the specified DistanceLimit message. Does not implicitly {@link google.maps.routeoptimization.v1.DistanceLimit.verify|verify} messages. + * @param message DistanceLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IDistanceLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DistanceLimit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.DistanceLimit.verify|verify} messages. + * @param message DistanceLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IDistanceLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DistanceLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DistanceLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.DistanceLimit; + + /** + * Decodes a DistanceLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DistanceLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.DistanceLimit; + + /** + * Verifies a DistanceLimit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DistanceLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DistanceLimit + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.DistanceLimit; + + /** + * Creates a plain object from a DistanceLimit message. Also converts values to other types if specified. + * @param message DistanceLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.DistanceLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DistanceLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DistanceLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitionAttributes. */ + interface ITransitionAttributes { + + /** TransitionAttributes srcTag */ + srcTag?: (string|null); + + /** TransitionAttributes excludedSrcTag */ + excludedSrcTag?: (string|null); + + /** TransitionAttributes dstTag */ + dstTag?: (string|null); + + /** TransitionAttributes excludedDstTag */ + excludedDstTag?: (string|null); + + /** TransitionAttributes cost */ + cost?: (number|null); + + /** TransitionAttributes costPerKilometer */ + costPerKilometer?: (number|null); + + /** TransitionAttributes distanceLimit */ + distanceLimit?: (google.maps.routeoptimization.v1.IDistanceLimit|null); + + /** TransitionAttributes delay */ + delay?: (google.protobuf.IDuration|null); + } + + /** Represents a TransitionAttributes. */ + class TransitionAttributes implements ITransitionAttributes { + + /** + * Constructs a new TransitionAttributes. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ITransitionAttributes); + + /** TransitionAttributes srcTag. */ + public srcTag: string; + + /** TransitionAttributes excludedSrcTag. */ + public excludedSrcTag: string; + + /** TransitionAttributes dstTag. */ + public dstTag: string; + + /** TransitionAttributes excludedDstTag. */ + public excludedDstTag: string; + + /** TransitionAttributes cost. */ + public cost: number; + + /** TransitionAttributes costPerKilometer. */ + public costPerKilometer: number; + + /** TransitionAttributes distanceLimit. */ + public distanceLimit?: (google.maps.routeoptimization.v1.IDistanceLimit|null); + + /** TransitionAttributes delay. */ + public delay?: (google.protobuf.IDuration|null); + + /** + * Creates a new TransitionAttributes instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitionAttributes instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ITransitionAttributes): google.maps.routeoptimization.v1.TransitionAttributes; + + /** + * Encodes the specified TransitionAttributes message. Does not implicitly {@link google.maps.routeoptimization.v1.TransitionAttributes.verify|verify} messages. + * @param message TransitionAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ITransitionAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitionAttributes message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.TransitionAttributes.verify|verify} messages. + * @param message TransitionAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ITransitionAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitionAttributes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitionAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.TransitionAttributes; + + /** + * Decodes a TransitionAttributes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitionAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.TransitionAttributes; + + /** + * Verifies a TransitionAttributes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitionAttributes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitionAttributes + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.TransitionAttributes; + + /** + * Creates a plain object from a TransitionAttributes message. Also converts values to other types if specified. + * @param message TransitionAttributes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.TransitionAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitionAttributes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitionAttributes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Waypoint. */ + interface IWaypoint { + + /** Waypoint location */ + location?: (google.maps.routeoptimization.v1.ILocation|null); + + /** Waypoint placeId */ + placeId?: (string|null); + + /** Waypoint sideOfRoad */ + sideOfRoad?: (boolean|null); + } + + /** Represents a Waypoint. */ + class Waypoint implements IWaypoint { + + /** + * Constructs a new Waypoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IWaypoint); + + /** Waypoint location. */ + public location?: (google.maps.routeoptimization.v1.ILocation|null); + + /** Waypoint placeId. */ + public placeId?: (string|null); + + /** Waypoint sideOfRoad. */ + public sideOfRoad: boolean; + + /** Waypoint locationType. */ + public locationType?: ("location"|"placeId"); + + /** + * Creates a new Waypoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Waypoint instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IWaypoint): google.maps.routeoptimization.v1.Waypoint; + + /** + * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routeoptimization.v1.Waypoint.verify|verify} messages. + * @param message Waypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Waypoint.verify|verify} messages. + * @param message Waypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Waypoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Waypoint; + + /** + * Decodes a Waypoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Waypoint; + + /** + * Verifies a Waypoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Waypoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Waypoint + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Waypoint; + + /** + * Creates a plain object from a Waypoint message. Also converts values to other types if specified. + * @param message Waypoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Waypoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Waypoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Waypoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location latLng */ + latLng?: (google.type.ILatLng|null); + + /** Location heading */ + heading?: (number|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ILocation); + + /** Location latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** Location heading. */ + public heading?: (number|null); + + /** Location _heading. */ + public _heading?: "heading"; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ILocation): google.maps.routeoptimization.v1.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.maps.routeoptimization.v1.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BreakRule. */ + interface IBreakRule { + + /** BreakRule breakRequests */ + breakRequests?: (google.maps.routeoptimization.v1.BreakRule.IBreakRequest[]|null); + + /** BreakRule frequencyConstraints */ + frequencyConstraints?: (google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint[]|null); + } + + /** Represents a BreakRule. */ + class BreakRule implements IBreakRule { + + /** + * Constructs a new BreakRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IBreakRule); + + /** BreakRule breakRequests. */ + public breakRequests: google.maps.routeoptimization.v1.BreakRule.IBreakRequest[]; + + /** BreakRule frequencyConstraints. */ + public frequencyConstraints: google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint[]; + + /** + * Creates a new BreakRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BreakRule instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IBreakRule): google.maps.routeoptimization.v1.BreakRule; + + /** + * Encodes the specified BreakRule message. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.verify|verify} messages. + * @param message BreakRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IBreakRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BreakRule message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.verify|verify} messages. + * @param message BreakRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IBreakRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BreakRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BreakRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BreakRule; + + /** + * Decodes a BreakRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BreakRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BreakRule; + + /** + * Verifies a BreakRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BreakRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BreakRule + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BreakRule; + + /** + * Creates a plain object from a BreakRule message. Also converts values to other types if specified. + * @param message BreakRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BreakRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BreakRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BreakRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BreakRule { + + /** Properties of a BreakRequest. */ + interface IBreakRequest { + + /** BreakRequest earliestStartTime */ + earliestStartTime?: (google.protobuf.ITimestamp|null); + + /** BreakRequest latestStartTime */ + latestStartTime?: (google.protobuf.ITimestamp|null); + + /** BreakRequest minDuration */ + minDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a BreakRequest. */ + class BreakRequest implements IBreakRequest { + + /** + * Constructs a new BreakRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.BreakRule.IBreakRequest); + + /** BreakRequest earliestStartTime. */ + public earliestStartTime?: (google.protobuf.ITimestamp|null); + + /** BreakRequest latestStartTime. */ + public latestStartTime?: (google.protobuf.ITimestamp|null); + + /** BreakRequest minDuration. */ + public minDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new BreakRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BreakRequest instance + */ + public static create(properties?: google.maps.routeoptimization.v1.BreakRule.IBreakRequest): google.maps.routeoptimization.v1.BreakRule.BreakRequest; + + /** + * Encodes the specified BreakRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.BreakRequest.verify|verify} messages. + * @param message BreakRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.BreakRule.IBreakRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BreakRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.BreakRequest.verify|verify} messages. + * @param message BreakRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.BreakRule.IBreakRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BreakRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BreakRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BreakRule.BreakRequest; + + /** + * Decodes a BreakRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BreakRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BreakRule.BreakRequest; + + /** + * Verifies a BreakRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BreakRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BreakRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BreakRule.BreakRequest; + + /** + * Creates a plain object from a BreakRequest message. Also converts values to other types if specified. + * @param message BreakRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BreakRule.BreakRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BreakRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BreakRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FrequencyConstraint. */ + interface IFrequencyConstraint { + + /** FrequencyConstraint minBreakDuration */ + minBreakDuration?: (google.protobuf.IDuration|null); + + /** FrequencyConstraint maxInterBreakDuration */ + maxInterBreakDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a FrequencyConstraint. */ + class FrequencyConstraint implements IFrequencyConstraint { + + /** + * Constructs a new FrequencyConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint); + + /** FrequencyConstraint minBreakDuration. */ + public minBreakDuration?: (google.protobuf.IDuration|null); + + /** FrequencyConstraint maxInterBreakDuration. */ + public maxInterBreakDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new FrequencyConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns FrequencyConstraint instance + */ + public static create(properties?: google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint): google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint; + + /** + * Encodes the specified FrequencyConstraint message. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.verify|verify} messages. + * @param message FrequencyConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FrequencyConstraint message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.verify|verify} messages. + * @param message FrequencyConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FrequencyConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FrequencyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint; + + /** + * Decodes a FrequencyConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FrequencyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint; + + /** + * Verifies a FrequencyConstraint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FrequencyConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FrequencyConstraint + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint; + + /** + * Creates a plain object from a FrequencyConstraint message. Also converts values to other types if specified. + * @param message FrequencyConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FrequencyConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FrequencyConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ShipmentRoute. */ + interface IShipmentRoute { + + /** ShipmentRoute vehicleIndex */ + vehicleIndex?: (number|null); + + /** ShipmentRoute vehicleLabel */ + vehicleLabel?: (string|null); + + /** ShipmentRoute vehicleStartTime */ + vehicleStartTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentRoute vehicleEndTime */ + vehicleEndTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentRoute visits */ + visits?: (google.maps.routeoptimization.v1.ShipmentRoute.IVisit[]|null); + + /** ShipmentRoute transitions */ + transitions?: (google.maps.routeoptimization.v1.ShipmentRoute.ITransition[]|null); + + /** ShipmentRoute hasTrafficInfeasibilities */ + hasTrafficInfeasibilities?: (boolean|null); + + /** ShipmentRoute routePolyline */ + routePolyline?: (google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null); + + /** ShipmentRoute breaks */ + breaks?: (google.maps.routeoptimization.v1.ShipmentRoute.IBreak[]|null); + + /** ShipmentRoute metrics */ + metrics?: (google.maps.routeoptimization.v1.IAggregatedMetrics|null); + + /** ShipmentRoute routeCosts */ + routeCosts?: ({ [k: string]: number }|null); + + /** ShipmentRoute routeTotalCost */ + routeTotalCost?: (number|null); + } + + /** Represents a ShipmentRoute. */ + class ShipmentRoute implements IShipmentRoute { + + /** + * Constructs a new ShipmentRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IShipmentRoute); + + /** ShipmentRoute vehicleIndex. */ + public vehicleIndex: number; + + /** ShipmentRoute vehicleLabel. */ + public vehicleLabel: string; + + /** ShipmentRoute vehicleStartTime. */ + public vehicleStartTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentRoute vehicleEndTime. */ + public vehicleEndTime?: (google.protobuf.ITimestamp|null); + + /** ShipmentRoute visits. */ + public visits: google.maps.routeoptimization.v1.ShipmentRoute.IVisit[]; + + /** ShipmentRoute transitions. */ + public transitions: google.maps.routeoptimization.v1.ShipmentRoute.ITransition[]; + + /** ShipmentRoute hasTrafficInfeasibilities. */ + public hasTrafficInfeasibilities: boolean; + + /** ShipmentRoute routePolyline. */ + public routePolyline?: (google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null); + + /** ShipmentRoute breaks. */ + public breaks: google.maps.routeoptimization.v1.ShipmentRoute.IBreak[]; + + /** ShipmentRoute metrics. */ + public metrics?: (google.maps.routeoptimization.v1.IAggregatedMetrics|null); + + /** ShipmentRoute routeCosts. */ + public routeCosts: { [k: string]: number }; + + /** ShipmentRoute routeTotalCost. */ + public routeTotalCost: number; + + /** + * Creates a new ShipmentRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns ShipmentRoute instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IShipmentRoute): google.maps.routeoptimization.v1.ShipmentRoute; + + /** + * Encodes the specified ShipmentRoute message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.verify|verify} messages. + * @param message ShipmentRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IShipmentRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShipmentRoute message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.verify|verify} messages. + * @param message ShipmentRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IShipmentRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShipmentRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShipmentRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentRoute; + + /** + * Decodes a ShipmentRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShipmentRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentRoute; + + /** + * Verifies a ShipmentRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShipmentRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShipmentRoute + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentRoute; + + /** + * Creates a plain object from a ShipmentRoute message. Also converts values to other types if specified. + * @param message ShipmentRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShipmentRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShipmentRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ShipmentRoute { + + /** Properties of a Visit. */ + interface IVisit { + + /** Visit shipmentIndex */ + shipmentIndex?: (number|null); + + /** Visit isPickup */ + isPickup?: (boolean|null); + + /** Visit visitRequestIndex */ + visitRequestIndex?: (number|null); + + /** Visit startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Visit loadDemands */ + loadDemands?: ({ [k: string]: google.maps.routeoptimization.v1.Shipment.ILoad }|null); + + /** Visit detour */ + detour?: (google.protobuf.IDuration|null); + + /** Visit shipmentLabel */ + shipmentLabel?: (string|null); + + /** Visit visitLabel */ + visitLabel?: (string|null); + } + + /** Represents a Visit. */ + class Visit implements IVisit { + + /** + * Constructs a new Visit. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IVisit); + + /** Visit shipmentIndex. */ + public shipmentIndex: number; + + /** Visit isPickup. */ + public isPickup: boolean; + + /** Visit visitRequestIndex. */ + public visitRequestIndex: number; + + /** Visit startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Visit loadDemands. */ + public loadDemands: { [k: string]: google.maps.routeoptimization.v1.Shipment.ILoad }; + + /** Visit detour. */ + public detour?: (google.protobuf.IDuration|null); + + /** Visit shipmentLabel. */ + public shipmentLabel: string; + + /** Visit visitLabel. */ + public visitLabel: string; + + /** + * Creates a new Visit instance using the specified properties. + * @param [properties] Properties to set + * @returns Visit instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IVisit): google.maps.routeoptimization.v1.ShipmentRoute.Visit; + + /** + * Encodes the specified Visit message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Visit.verify|verify} messages. + * @param message Visit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentRoute.IVisit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Visit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Visit.verify|verify} messages. + * @param message Visit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentRoute.IVisit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Visit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Visit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentRoute.Visit; + + /** + * Decodes a Visit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Visit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentRoute.Visit; + + /** + * Verifies a Visit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Visit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Visit + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentRoute.Visit; + + /** + * Creates a plain object from a Visit message. Also converts values to other types if specified. + * @param message Visit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentRoute.Visit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Visit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Visit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Transition. */ + interface ITransition { + + /** Transition travelDuration */ + travelDuration?: (google.protobuf.IDuration|null); + + /** Transition travelDistanceMeters */ + travelDistanceMeters?: (number|null); + + /** Transition trafficInfoUnavailable */ + trafficInfoUnavailable?: (boolean|null); + + /** Transition delayDuration */ + delayDuration?: (google.protobuf.IDuration|null); + + /** Transition breakDuration */ + breakDuration?: (google.protobuf.IDuration|null); + + /** Transition waitDuration */ + waitDuration?: (google.protobuf.IDuration|null); + + /** Transition totalDuration */ + totalDuration?: (google.protobuf.IDuration|null); + + /** Transition startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Transition routePolyline */ + routePolyline?: (google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null); + + /** Transition vehicleLoads */ + vehicleLoads?: ({ [k: string]: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad }|null); + } + + /** Represents a Transition. */ + class Transition implements ITransition { + + /** + * Constructs a new Transition. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentRoute.ITransition); + + /** Transition travelDuration. */ + public travelDuration?: (google.protobuf.IDuration|null); + + /** Transition travelDistanceMeters. */ + public travelDistanceMeters: number; + + /** Transition trafficInfoUnavailable. */ + public trafficInfoUnavailable: boolean; + + /** Transition delayDuration. */ + public delayDuration?: (google.protobuf.IDuration|null); + + /** Transition breakDuration. */ + public breakDuration?: (google.protobuf.IDuration|null); + + /** Transition waitDuration. */ + public waitDuration?: (google.protobuf.IDuration|null); + + /** Transition totalDuration. */ + public totalDuration?: (google.protobuf.IDuration|null); + + /** Transition startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Transition routePolyline. */ + public routePolyline?: (google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null); + + /** Transition vehicleLoads. */ + public vehicleLoads: { [k: string]: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad }; + + /** + * Creates a new Transition instance using the specified properties. + * @param [properties] Properties to set + * @returns Transition instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentRoute.ITransition): google.maps.routeoptimization.v1.ShipmentRoute.Transition; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentRoute.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Transition.verify|verify} messages. + * @param message Transition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentRoute.ITransition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentRoute.Transition; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentRoute.Transition; + + /** + * Verifies a Transition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Transition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transition + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentRoute.Transition; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @param message Transition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentRoute.Transition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Transition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Transition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VehicleLoad. */ + interface IVehicleLoad { + + /** VehicleLoad amount */ + amount?: (number|Long|string|null); + } + + /** Represents a VehicleLoad. */ + class VehicleLoad implements IVehicleLoad { + + /** + * Constructs a new VehicleLoad. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad); + + /** VehicleLoad amount. */ + public amount: (number|Long|string); + + /** + * Creates a new VehicleLoad instance using the specified properties. + * @param [properties] Properties to set + * @returns VehicleLoad instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad): google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad; + + /** + * Encodes the specified VehicleLoad message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.verify|verify} messages. + * @param message VehicleLoad message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VehicleLoad message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.verify|verify} messages. + * @param message VehicleLoad message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VehicleLoad message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VehicleLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad; + + /** + * Decodes a VehicleLoad message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VehicleLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad; + + /** + * Verifies a VehicleLoad message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VehicleLoad message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VehicleLoad + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad; + + /** + * Creates a plain object from a VehicleLoad message. Also converts values to other types if specified. + * @param message VehicleLoad + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VehicleLoad to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VehicleLoad + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncodedPolyline. */ + interface IEncodedPolyline { + + /** EncodedPolyline points */ + points?: (string|null); + } + + /** Represents an EncodedPolyline. */ + class EncodedPolyline implements IEncodedPolyline { + + /** + * Constructs a new EncodedPolyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline); + + /** EncodedPolyline points. */ + public points: string; + + /** + * Creates a new EncodedPolyline instance using the specified properties. + * @param [properties] Properties to set + * @returns EncodedPolyline instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline): google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline; + + /** + * Encodes the specified EncodedPolyline message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.verify|verify} messages. + * @param message EncodedPolyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncodedPolyline message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.verify|verify} messages. + * @param message EncodedPolyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncodedPolyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncodedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline; + + /** + * Decodes an EncodedPolyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncodedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline; + + /** + * Verifies an EncodedPolyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncodedPolyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncodedPolyline + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline; + + /** + * Creates a plain object from an EncodedPolyline message. Also converts values to other types if specified. + * @param message EncodedPolyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncodedPolyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncodedPolyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Break. */ + interface IBreak { + + /** Break startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Break duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a Break. */ + class Break implements IBreak { + + /** + * Constructs a new Break. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IBreak); + + /** Break startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Break duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new Break instance using the specified properties. + * @param [properties] Properties to set + * @returns Break instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ShipmentRoute.IBreak): google.maps.routeoptimization.v1.ShipmentRoute.Break; + + /** + * Encodes the specified Break message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Break.verify|verify} messages. + * @param message Break message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ShipmentRoute.IBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Break message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Break.verify|verify} messages. + * @param message Break message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ShipmentRoute.IBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Break message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Break + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.ShipmentRoute.Break; + + /** + * Decodes a Break message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Break + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.ShipmentRoute.Break; + + /** + * Verifies a Break message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Break message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Break + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.ShipmentRoute.Break; + + /** + * Creates a plain object from a Break message. Also converts values to other types if specified. + * @param message Break + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.ShipmentRoute.Break, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Break to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Break + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SkippedShipment. */ + interface ISkippedShipment { + + /** SkippedShipment index */ + index?: (number|null); + + /** SkippedShipment label */ + label?: (string|null); + + /** SkippedShipment reasons */ + reasons?: (google.maps.routeoptimization.v1.SkippedShipment.IReason[]|null); + } + + /** Represents a SkippedShipment. */ + class SkippedShipment implements ISkippedShipment { + + /** + * Constructs a new SkippedShipment. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.ISkippedShipment); + + /** SkippedShipment index. */ + public index: number; + + /** SkippedShipment label. */ + public label: string; + + /** SkippedShipment reasons. */ + public reasons: google.maps.routeoptimization.v1.SkippedShipment.IReason[]; + + /** + * Creates a new SkippedShipment instance using the specified properties. + * @param [properties] Properties to set + * @returns SkippedShipment instance + */ + public static create(properties?: google.maps.routeoptimization.v1.ISkippedShipment): google.maps.routeoptimization.v1.SkippedShipment; + + /** + * Encodes the specified SkippedShipment message. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.verify|verify} messages. + * @param message SkippedShipment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.ISkippedShipment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkippedShipment message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.verify|verify} messages. + * @param message SkippedShipment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.ISkippedShipment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkippedShipment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkippedShipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.SkippedShipment; + + /** + * Decodes a SkippedShipment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkippedShipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.SkippedShipment; + + /** + * Verifies a SkippedShipment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkippedShipment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkippedShipment + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.SkippedShipment; + + /** + * Creates a plain object from a SkippedShipment message. Also converts values to other types if specified. + * @param message SkippedShipment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.SkippedShipment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkippedShipment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkippedShipment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SkippedShipment { + + /** Properties of a Reason. */ + interface IReason { + + /** Reason code */ + code?: (google.maps.routeoptimization.v1.SkippedShipment.Reason.Code|keyof typeof google.maps.routeoptimization.v1.SkippedShipment.Reason.Code|null); + + /** Reason exampleVehicleIndex */ + exampleVehicleIndex?: (number|null); + + /** Reason exampleExceededCapacityType */ + exampleExceededCapacityType?: (string|null); + } + + /** Represents a Reason. */ + class Reason implements IReason { + + /** + * Constructs a new Reason. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.SkippedShipment.IReason); + + /** Reason code. */ + public code: (google.maps.routeoptimization.v1.SkippedShipment.Reason.Code|keyof typeof google.maps.routeoptimization.v1.SkippedShipment.Reason.Code); + + /** Reason exampleVehicleIndex. */ + public exampleVehicleIndex?: (number|null); + + /** Reason exampleExceededCapacityType. */ + public exampleExceededCapacityType: string; + + /** Reason _exampleVehicleIndex. */ + public _exampleVehicleIndex?: "exampleVehicleIndex"; + + /** + * Creates a new Reason instance using the specified properties. + * @param [properties] Properties to set + * @returns Reason instance + */ + public static create(properties?: google.maps.routeoptimization.v1.SkippedShipment.IReason): google.maps.routeoptimization.v1.SkippedShipment.Reason; + + /** + * Encodes the specified Reason message. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.Reason.verify|verify} messages. + * @param message Reason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.SkippedShipment.IReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reason message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.Reason.verify|verify} messages. + * @param message Reason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.SkippedShipment.IReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.SkippedShipment.Reason; + + /** + * Decodes a Reason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.SkippedShipment.Reason; + + /** + * Verifies a Reason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reason + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.SkippedShipment.Reason; + + /** + * Creates a plain object from a Reason message. Also converts values to other types if specified. + * @param message Reason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.SkippedShipment.Reason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Reason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Reason { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + NO_VEHICLE = 1, + DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2, + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3, + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4, + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5, + CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6, + VEHICLE_NOT_ALLOWED = 7 + } + } + } + + /** Properties of an AggregatedMetrics. */ + interface IAggregatedMetrics { + + /** AggregatedMetrics performedShipmentCount */ + performedShipmentCount?: (number|null); + + /** AggregatedMetrics travelDuration */ + travelDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics waitDuration */ + waitDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics delayDuration */ + delayDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics breakDuration */ + breakDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics visitDuration */ + visitDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics totalDuration */ + totalDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics travelDistanceMeters */ + travelDistanceMeters?: (number|null); + + /** AggregatedMetrics maxLoads */ + maxLoads?: ({ [k: string]: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad }|null); + } + + /** Represents an AggregatedMetrics. */ + class AggregatedMetrics implements IAggregatedMetrics { + + /** + * Constructs a new AggregatedMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IAggregatedMetrics); + + /** AggregatedMetrics performedShipmentCount. */ + public performedShipmentCount: number; + + /** AggregatedMetrics travelDuration. */ + public travelDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics waitDuration. */ + public waitDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics delayDuration. */ + public delayDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics breakDuration. */ + public breakDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics visitDuration. */ + public visitDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics totalDuration. */ + public totalDuration?: (google.protobuf.IDuration|null); + + /** AggregatedMetrics travelDistanceMeters. */ + public travelDistanceMeters: number; + + /** AggregatedMetrics maxLoads. */ + public maxLoads: { [k: string]: google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad }; + + /** + * Creates a new AggregatedMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedMetrics instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IAggregatedMetrics): google.maps.routeoptimization.v1.AggregatedMetrics; + + /** + * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.maps.routeoptimization.v1.AggregatedMetrics.verify|verify} messages. + * @param message AggregatedMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.AggregatedMetrics.verify|verify} messages. + * @param message AggregatedMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.AggregatedMetrics; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.AggregatedMetrics; + + /** + * Verifies an AggregatedMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedMetrics + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.AggregatedMetrics; + + /** + * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. + * @param message AggregatedMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.AggregatedMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AggregatedMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InjectedSolutionConstraint. */ + interface IInjectedSolutionConstraint { + + /** InjectedSolutionConstraint routes */ + routes?: (google.maps.routeoptimization.v1.IShipmentRoute[]|null); + + /** InjectedSolutionConstraint skippedShipments */ + skippedShipments?: (google.maps.routeoptimization.v1.ISkippedShipment[]|null); + + /** InjectedSolutionConstraint constraintRelaxations */ + constraintRelaxations?: (google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation[]|null); + } + + /** Represents an InjectedSolutionConstraint. */ + class InjectedSolutionConstraint implements IInjectedSolutionConstraint { + + /** + * Constructs a new InjectedSolutionConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IInjectedSolutionConstraint); + + /** InjectedSolutionConstraint routes. */ + public routes: google.maps.routeoptimization.v1.IShipmentRoute[]; + + /** InjectedSolutionConstraint skippedShipments. */ + public skippedShipments: google.maps.routeoptimization.v1.ISkippedShipment[]; + + /** InjectedSolutionConstraint constraintRelaxations. */ + public constraintRelaxations: google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation[]; + + /** + * Creates a new InjectedSolutionConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns InjectedSolutionConstraint instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IInjectedSolutionConstraint): google.maps.routeoptimization.v1.InjectedSolutionConstraint; + + /** + * Encodes the specified InjectedSolutionConstraint message. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.verify|verify} messages. + * @param message InjectedSolutionConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IInjectedSolutionConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InjectedSolutionConstraint message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.verify|verify} messages. + * @param message InjectedSolutionConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IInjectedSolutionConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InjectedSolutionConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InjectedSolutionConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.InjectedSolutionConstraint; + + /** + * Decodes an InjectedSolutionConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InjectedSolutionConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.InjectedSolutionConstraint; + + /** + * Verifies an InjectedSolutionConstraint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InjectedSolutionConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InjectedSolutionConstraint + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.InjectedSolutionConstraint; + + /** + * Creates a plain object from an InjectedSolutionConstraint message. Also converts values to other types if specified. + * @param message InjectedSolutionConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InjectedSolutionConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InjectedSolutionConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InjectedSolutionConstraint { + + /** Properties of a ConstraintRelaxation. */ + interface IConstraintRelaxation { + + /** ConstraintRelaxation relaxations */ + relaxations?: (google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation[]|null); + + /** ConstraintRelaxation vehicleIndices */ + vehicleIndices?: (number[]|null); + } + + /** Represents a ConstraintRelaxation. */ + class ConstraintRelaxation implements IConstraintRelaxation { + + /** + * Constructs a new ConstraintRelaxation. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation); + + /** ConstraintRelaxation relaxations. */ + public relaxations: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation[]; + + /** ConstraintRelaxation vehicleIndices. */ + public vehicleIndices: number[]; + + /** + * Creates a new ConstraintRelaxation instance using the specified properties. + * @param [properties] Properties to set + * @returns ConstraintRelaxation instance + */ + public static create(properties?: google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation; + + /** + * Encodes the specified ConstraintRelaxation message. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.verify|verify} messages. + * @param message ConstraintRelaxation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConstraintRelaxation message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.verify|verify} messages. + * @param message ConstraintRelaxation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConstraintRelaxation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConstraintRelaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation; + + /** + * Decodes a ConstraintRelaxation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConstraintRelaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation; + + /** + * Verifies a ConstraintRelaxation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConstraintRelaxation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConstraintRelaxation + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation; + + /** + * Creates a plain object from a ConstraintRelaxation message. Also converts values to other types if specified. + * @param message ConstraintRelaxation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConstraintRelaxation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConstraintRelaxation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConstraintRelaxation { + + /** Properties of a Relaxation. */ + interface IRelaxation { + + /** Relaxation level */ + level?: (google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level|keyof typeof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level|null); + + /** Relaxation thresholdTime */ + thresholdTime?: (google.protobuf.ITimestamp|null); + + /** Relaxation thresholdVisitCount */ + thresholdVisitCount?: (number|null); + } + + /** Represents a Relaxation. */ + class Relaxation implements IRelaxation { + + /** + * Constructs a new Relaxation. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation); + + /** Relaxation level. */ + public level: (google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level|keyof typeof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level); + + /** Relaxation thresholdTime. */ + public thresholdTime?: (google.protobuf.ITimestamp|null); + + /** Relaxation thresholdVisitCount. */ + public thresholdVisitCount: number; + + /** + * Creates a new Relaxation instance using the specified properties. + * @param [properties] Properties to set + * @returns Relaxation instance + */ + public static create(properties?: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation; + + /** + * Encodes the specified Relaxation message. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.verify|verify} messages. + * @param message Relaxation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Relaxation message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.verify|verify} messages. + * @param message Relaxation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Relaxation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Relaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation; + + /** + * Decodes a Relaxation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Relaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation; + + /** + * Verifies a Relaxation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Relaxation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Relaxation + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation; + + /** + * Creates a plain object from a Relaxation message. Also converts values to other types if specified. + * @param message Relaxation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Relaxation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Relaxation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Relaxation { + + /** Level enum. */ + enum Level { + LEVEL_UNSPECIFIED = 0, + RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1, + RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2, + RELAX_ALL_AFTER_THRESHOLD = 3 + } + } + } + } + + /** Properties of an OptimizeToursValidationError. */ + interface IOptimizeToursValidationError { + + /** OptimizeToursValidationError code */ + code?: (number|null); + + /** OptimizeToursValidationError displayName */ + displayName?: (string|null); + + /** OptimizeToursValidationError fields */ + fields?: (google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference[]|null); + + /** OptimizeToursValidationError errorMessage */ + errorMessage?: (string|null); + + /** OptimizeToursValidationError offendingValues */ + offendingValues?: (string|null); + } + + /** Represents an OptimizeToursValidationError. */ + class OptimizeToursValidationError implements IOptimizeToursValidationError { + + /** + * Constructs a new OptimizeToursValidationError. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IOptimizeToursValidationError); + + /** OptimizeToursValidationError code. */ + public code: number; + + /** OptimizeToursValidationError displayName. */ + public displayName: string; + + /** OptimizeToursValidationError fields. */ + public fields: google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference[]; + + /** OptimizeToursValidationError errorMessage. */ + public errorMessage: string; + + /** OptimizeToursValidationError offendingValues. */ + public offendingValues: string; + + /** + * Creates a new OptimizeToursValidationError instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizeToursValidationError instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IOptimizeToursValidationError): google.maps.routeoptimization.v1.OptimizeToursValidationError; + + /** + * Encodes the specified OptimizeToursValidationError message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.verify|verify} messages. + * @param message OptimizeToursValidationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IOptimizeToursValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizeToursValidationError message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.verify|verify} messages. + * @param message OptimizeToursValidationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IOptimizeToursValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizeToursValidationError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizeToursValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.OptimizeToursValidationError; + + /** + * Decodes an OptimizeToursValidationError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizeToursValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.OptimizeToursValidationError; + + /** + * Verifies an OptimizeToursValidationError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizeToursValidationError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizeToursValidationError + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.OptimizeToursValidationError; + + /** + * Creates a plain object from an OptimizeToursValidationError message. Also converts values to other types if specified. + * @param message OptimizeToursValidationError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.OptimizeToursValidationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizeToursValidationError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizeToursValidationError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OptimizeToursValidationError { + + /** Properties of a FieldReference. */ + interface IFieldReference { + + /** FieldReference name */ + name?: (string|null); + + /** FieldReference index */ + index?: (number|null); + + /** FieldReference key */ + key?: (string|null); + + /** FieldReference subField */ + subField?: (google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference|null); + } + + /** Represents a FieldReference. */ + class FieldReference implements IFieldReference { + + /** + * Constructs a new FieldReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference); + + /** FieldReference name. */ + public name: string; + + /** FieldReference index. */ + public index?: (number|null); + + /** FieldReference key. */ + public key?: (string|null); + + /** FieldReference subField. */ + public subField?: (google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference|null); + + /** FieldReference indexOrKey. */ + public indexOrKey?: ("index"|"key"); + + /** + * Creates a new FieldReference instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldReference instance + */ + public static create(properties?: google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference): google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference; + + /** + * Encodes the specified FieldReference message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.verify|verify} messages. + * @param message FieldReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldReference message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.verify|verify} messages. + * @param message FieldReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference; + + /** + * Decodes a FieldReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference; + + /** + * Verifies a FieldReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldReference + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference; + + /** + * Creates a plain object from a FieldReference message. Also converts values to other types if specified. + * @param message FieldReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.maps.routeoptimization.v1.IGcsSource|null); + + /** InputConfig dataFormat */ + dataFormat?: (google.maps.routeoptimization.v1.DataFormat|keyof typeof google.maps.routeoptimization.v1.DataFormat|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.maps.routeoptimization.v1.IGcsSource|null); + + /** InputConfig dataFormat. */ + public dataFormat: (google.maps.routeoptimization.v1.DataFormat|keyof typeof google.maps.routeoptimization.v1.DataFormat); + + /** InputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IInputConfig): google.maps.routeoptimization.v1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.maps.routeoptimization.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.maps.routeoptimization.v1.IGcsDestination|null); + + /** OutputConfig dataFormat */ + dataFormat?: (google.maps.routeoptimization.v1.DataFormat|keyof typeof google.maps.routeoptimization.v1.DataFormat|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.maps.routeoptimization.v1.IGcsDestination|null); + + /** OutputConfig dataFormat. */ + public dataFormat: (google.maps.routeoptimization.v1.DataFormat|keyof typeof google.maps.routeoptimization.v1.DataFormat); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IOutputConfig): google.maps.routeoptimization.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.maps.routeoptimization.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uri */ + uri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IGcsSource); + + /** GcsSource uri. */ + public uri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IGcsSource): google.maps.routeoptimization.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.maps.routeoptimization.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routeoptimization.v1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.maps.routeoptimization.v1.IGcsDestination): google.maps.routeoptimization.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.maps.routeoptimization.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routeoptimization.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routeoptimization.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routeoptimization.v1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routeoptimization.v1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.maps.routeoptimization.v1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routeoptimization.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + JSON = 1, + PROTO_TEXT = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-maps-routeoptimization/protos/protos.js b/packages/google-maps-routeoptimization/protos/protos.js new file mode 100644 index 00000000000..65d5e172dcf --- /dev/null +++ b/packages/google-maps-routeoptimization/protos/protos.js @@ -0,0 +1,36681 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._googlemaps_routeoptimization_protos || ($protobuf.roots._googlemaps_routeoptimization_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.maps = (function() { + + /** + * Namespace maps. + * @memberof google + * @namespace + */ + var maps = {}; + + maps.routeoptimization = (function() { + + /** + * Namespace routeoptimization. + * @memberof google.maps + * @namespace + */ + var routeoptimization = {}; + + routeoptimization.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.maps.routeoptimization + * @namespace + */ + var v1 = {}; + + v1.RouteOptimization = (function() { + + /** + * Constructs a new RouteOptimization service. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a RouteOptimization + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function RouteOptimization(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RouteOptimization.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RouteOptimization; + + /** + * Creates new RouteOptimization service using the specified rpc implementation. + * @function create + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {RouteOptimization} RPC service. Useful where requests and/or responses are streamed. + */ + RouteOptimization.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.maps.routeoptimization.v1.RouteOptimization|optimizeTours}. + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @typedef OptimizeToursCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse} [response] OptimizeToursResponse + */ + + /** + * Calls OptimizeTours. + * @function optimizeTours + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @instance + * @param {google.maps.routeoptimization.v1.IOptimizeToursRequest} request OptimizeToursRequest message or plain object + * @param {google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursCallback} callback Node-style callback called with the error, if any, and OptimizeToursResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RouteOptimization.prototype.optimizeTours = function optimizeTours(request, callback) { + return this.rpcCall(optimizeTours, $root.google.maps.routeoptimization.v1.OptimizeToursRequest, $root.google.maps.routeoptimization.v1.OptimizeToursResponse, request, callback); + }, "name", { value: "OptimizeTours" }); + + /** + * Calls OptimizeTours. + * @function optimizeTours + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @instance + * @param {google.maps.routeoptimization.v1.IOptimizeToursRequest} request OptimizeToursRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.routeoptimization.v1.RouteOptimization|batchOptimizeTours}. + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @typedef BatchOptimizeToursCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchOptimizeTours. + * @function batchOptimizeTours + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @instance + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursRequest} request BatchOptimizeToursRequest message or plain object + * @param {google.maps.routeoptimization.v1.RouteOptimization.BatchOptimizeToursCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RouteOptimization.prototype.batchOptimizeTours = function batchOptimizeTours(request, callback) { + return this.rpcCall(batchOptimizeTours, $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchOptimizeTours" }); + + /** + * Calls BatchOptimizeTours. + * @function batchOptimizeTours + * @memberof google.maps.routeoptimization.v1.RouteOptimization + * @instance + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursRequest} request BatchOptimizeToursRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RouteOptimization; + })(); + + v1.BatchOptimizeToursRequest = (function() { + + /** + * Properties of a BatchOptimizeToursRequest. + * @memberof google.maps.routeoptimization.v1 + * @interface IBatchOptimizeToursRequest + * @property {string|null} [parent] BatchOptimizeToursRequest parent + * @property {Array.|null} [modelConfigs] BatchOptimizeToursRequest modelConfigs + */ + + /** + * Constructs a new BatchOptimizeToursRequest. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a BatchOptimizeToursRequest. + * @implements IBatchOptimizeToursRequest + * @constructor + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursRequest=} [properties] Properties to set + */ + function BatchOptimizeToursRequest(properties) { + this.modelConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchOptimizeToursRequest parent. + * @member {string} parent + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @instance + */ + BatchOptimizeToursRequest.prototype.parent = ""; + + /** + * BatchOptimizeToursRequest modelConfigs. + * @member {Array.} modelConfigs + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @instance + */ + BatchOptimizeToursRequest.prototype.modelConfigs = $util.emptyArray; + + /** + * Creates a new BatchOptimizeToursRequest instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursRequest=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest} BatchOptimizeToursRequest instance + */ + BatchOptimizeToursRequest.create = function create(properties) { + return new BatchOptimizeToursRequest(properties); + }; + + /** + * Encodes the specified BatchOptimizeToursRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursRequest} message BatchOptimizeToursRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOptimizeToursRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.modelConfigs != null && message.modelConfigs.length) + for (var i = 0; i < message.modelConfigs.length; ++i) + $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.encode(message.modelConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchOptimizeToursRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursRequest} message BatchOptimizeToursRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOptimizeToursRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOptimizeToursRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest} BatchOptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOptimizeToursRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.modelConfigs && message.modelConfigs.length)) + message.modelConfigs = []; + message.modelConfigs.push($root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOptimizeToursRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest} BatchOptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOptimizeToursRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOptimizeToursRequest message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOptimizeToursRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.modelConfigs != null && message.hasOwnProperty("modelConfigs")) { + if (!Array.isArray(message.modelConfigs)) + return "modelConfigs: array expected"; + for (var i = 0; i < message.modelConfigs.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.verify(message.modelConfigs[i]); + if (error) + return "modelConfigs." + error; + } + } + return null; + }; + + /** + * Creates a BatchOptimizeToursRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest} BatchOptimizeToursRequest + */ + BatchOptimizeToursRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest) + return object; + var message = new $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.modelConfigs) { + if (!Array.isArray(object.modelConfigs)) + throw TypeError(".google.maps.routeoptimization.v1.BatchOptimizeToursRequest.modelConfigs: array expected"); + message.modelConfigs = []; + for (var i = 0; i < object.modelConfigs.length; ++i) { + if (typeof object.modelConfigs[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BatchOptimizeToursRequest.modelConfigs: object expected"); + message.modelConfigs[i] = $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.fromObject(object.modelConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchOptimizeToursRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursRequest} message BatchOptimizeToursRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOptimizeToursRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelConfigs = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.modelConfigs && message.modelConfigs.length) { + object.modelConfigs = []; + for (var j = 0; j < message.modelConfigs.length; ++j) + object.modelConfigs[j] = $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.toObject(message.modelConfigs[j], options); + } + return object; + }; + + /** + * Converts this BatchOptimizeToursRequest to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @instance + * @returns {Object.} JSON object + */ + BatchOptimizeToursRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOptimizeToursRequest + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOptimizeToursRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BatchOptimizeToursRequest"; + }; + + BatchOptimizeToursRequest.AsyncModelConfig = (function() { + + /** + * Properties of an AsyncModelConfig. + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @interface IAsyncModelConfig + * @property {string|null} [displayName] AsyncModelConfig displayName + * @property {google.maps.routeoptimization.v1.IInputConfig|null} [inputConfig] AsyncModelConfig inputConfig + * @property {google.maps.routeoptimization.v1.IOutputConfig|null} [outputConfig] AsyncModelConfig outputConfig + */ + + /** + * Constructs a new AsyncModelConfig. + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest + * @classdesc Represents an AsyncModelConfig. + * @implements IAsyncModelConfig + * @constructor + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig=} [properties] Properties to set + */ + function AsyncModelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AsyncModelConfig displayName. + * @member {string} displayName + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @instance + */ + AsyncModelConfig.prototype.displayName = ""; + + /** + * AsyncModelConfig inputConfig. + * @member {google.maps.routeoptimization.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @instance + */ + AsyncModelConfig.prototype.inputConfig = null; + + /** + * AsyncModelConfig outputConfig. + * @member {google.maps.routeoptimization.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @instance + */ + AsyncModelConfig.prototype.outputConfig = null; + + /** + * Creates a new AsyncModelConfig instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} AsyncModelConfig instance + */ + AsyncModelConfig.create = function create(properties) { + return new AsyncModelConfig(properties); + }; + + /** + * Encodes the specified AsyncModelConfig message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig} message AsyncModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncModelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.maps.routeoptimization.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.maps.routeoptimization.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncModelConfig message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.IAsyncModelConfig} message AsyncModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncModelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncModelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} AsyncModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncModelConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.inputConfig = $root.google.maps.routeoptimization.v1.InputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputConfig = $root.google.maps.routeoptimization.v1.OutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncModelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} AsyncModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncModelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncModelConfig message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncModelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.maps.routeoptimization.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.maps.routeoptimization.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncModelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} AsyncModelConfig + */ + AsyncModelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig) + return object; + var message = new $root.google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.inputConfig: object expected"); + message.inputConfig = $root.google.maps.routeoptimization.v1.InputConfig.fromObject(object.inputConfig); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig.outputConfig: object expected"); + message.outputConfig = $root.google.maps.routeoptimization.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncModelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig} message AsyncModelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncModelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.inputConfig = null; + object.outputConfig = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.maps.routeoptimization.v1.InputConfig.toObject(message.inputConfig, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.maps.routeoptimization.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncModelConfig to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @instance + * @returns {Object.} JSON object + */ + AsyncModelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AsyncModelConfig + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AsyncModelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig"; + }; + + return AsyncModelConfig; + })(); + + return BatchOptimizeToursRequest; + })(); + + v1.BatchOptimizeToursResponse = (function() { + + /** + * Properties of a BatchOptimizeToursResponse. + * @memberof google.maps.routeoptimization.v1 + * @interface IBatchOptimizeToursResponse + */ + + /** + * Constructs a new BatchOptimizeToursResponse. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a BatchOptimizeToursResponse. + * @implements IBatchOptimizeToursResponse + * @constructor + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursResponse=} [properties] Properties to set + */ + function BatchOptimizeToursResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new BatchOptimizeToursResponse instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursResponse=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursResponse} BatchOptimizeToursResponse instance + */ + BatchOptimizeToursResponse.create = function create(properties) { + return new BatchOptimizeToursResponse(properties); + }; + + /** + * Encodes the specified BatchOptimizeToursResponse message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursResponse.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursResponse} message BatchOptimizeToursResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOptimizeToursResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BatchOptimizeToursResponse message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursResponse} message BatchOptimizeToursResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOptimizeToursResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOptimizeToursResponse message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursResponse} BatchOptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOptimizeToursResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BatchOptimizeToursResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOptimizeToursResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursResponse} BatchOptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOptimizeToursResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOptimizeToursResponse message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOptimizeToursResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BatchOptimizeToursResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursResponse} BatchOptimizeToursResponse + */ + BatchOptimizeToursResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BatchOptimizeToursResponse) + return object; + return new $root.google.maps.routeoptimization.v1.BatchOptimizeToursResponse(); + }; + + /** + * Creates a plain object from a BatchOptimizeToursResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursResponse} message BatchOptimizeToursResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOptimizeToursResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BatchOptimizeToursResponse to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @instance + * @returns {Object.} JSON object + */ + BatchOptimizeToursResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOptimizeToursResponse + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOptimizeToursResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BatchOptimizeToursResponse"; + }; + + return BatchOptimizeToursResponse; + })(); + + v1.BatchOptimizeToursMetadata = (function() { + + /** + * Properties of a BatchOptimizeToursMetadata. + * @memberof google.maps.routeoptimization.v1 + * @interface IBatchOptimizeToursMetadata + */ + + /** + * Constructs a new BatchOptimizeToursMetadata. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a BatchOptimizeToursMetadata. + * @implements IBatchOptimizeToursMetadata + * @constructor + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata=} [properties] Properties to set + */ + function BatchOptimizeToursMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new BatchOptimizeToursMetadata instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} BatchOptimizeToursMetadata instance + */ + BatchOptimizeToursMetadata.create = function create(properties) { + return new BatchOptimizeToursMetadata(properties); + }; + + /** + * Encodes the specified BatchOptimizeToursMetadata message. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata} message BatchOptimizeToursMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOptimizeToursMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BatchOptimizeToursMetadata message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BatchOptimizeToursMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata} message BatchOptimizeToursMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOptimizeToursMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOptimizeToursMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} BatchOptimizeToursMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOptimizeToursMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOptimizeToursMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} BatchOptimizeToursMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOptimizeToursMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOptimizeToursMetadata message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOptimizeToursMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BatchOptimizeToursMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} BatchOptimizeToursMetadata + */ + BatchOptimizeToursMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata) + return object; + return new $root.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata(); + }; + + /** + * Creates a plain object from a BatchOptimizeToursMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {google.maps.routeoptimization.v1.BatchOptimizeToursMetadata} message BatchOptimizeToursMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOptimizeToursMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BatchOptimizeToursMetadata to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOptimizeToursMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOptimizeToursMetadata + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOptimizeToursMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BatchOptimizeToursMetadata"; + }; + + return BatchOptimizeToursMetadata; + })(); + + v1.OptimizeToursRequest = (function() { + + /** + * Properties of an OptimizeToursRequest. + * @memberof google.maps.routeoptimization.v1 + * @interface IOptimizeToursRequest + * @property {string|null} [parent] OptimizeToursRequest parent + * @property {google.protobuf.IDuration|null} [timeout] OptimizeToursRequest timeout + * @property {google.maps.routeoptimization.v1.IShipmentModel|null} [model] OptimizeToursRequest model + * @property {google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode|null} [solvingMode] OptimizeToursRequest solvingMode + * @property {google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode|null} [searchMode] OptimizeToursRequest searchMode + * @property {Array.|null} [injectedFirstSolutionRoutes] OptimizeToursRequest injectedFirstSolutionRoutes + * @property {google.maps.routeoptimization.v1.IInjectedSolutionConstraint|null} [injectedSolutionConstraint] OptimizeToursRequest injectedSolutionConstraint + * @property {Array.|null} [refreshDetailsRoutes] OptimizeToursRequest refreshDetailsRoutes + * @property {boolean|null} [interpretInjectedSolutionsUsingLabels] OptimizeToursRequest interpretInjectedSolutionsUsingLabels + * @property {boolean|null} [considerRoadTraffic] OptimizeToursRequest considerRoadTraffic + * @property {boolean|null} [populatePolylines] OptimizeToursRequest populatePolylines + * @property {boolean|null} [populateTransitionPolylines] OptimizeToursRequest populateTransitionPolylines + * @property {boolean|null} [allowLargeDeadlineDespiteInterruptionRisk] OptimizeToursRequest allowLargeDeadlineDespiteInterruptionRisk + * @property {boolean|null} [useGeodesicDistances] OptimizeToursRequest useGeodesicDistances + * @property {number|null} [geodesicMetersPerSecond] OptimizeToursRequest geodesicMetersPerSecond + * @property {number|null} [maxValidationErrors] OptimizeToursRequest maxValidationErrors + * @property {string|null} [label] OptimizeToursRequest label + */ + + /** + * Constructs a new OptimizeToursRequest. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an OptimizeToursRequest. + * @implements IOptimizeToursRequest + * @constructor + * @param {google.maps.routeoptimization.v1.IOptimizeToursRequest=} [properties] Properties to set + */ + function OptimizeToursRequest(properties) { + this.injectedFirstSolutionRoutes = []; + this.refreshDetailsRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeToursRequest parent. + * @member {string} parent + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.parent = ""; + + /** + * OptimizeToursRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.timeout = null; + + /** + * OptimizeToursRequest model. + * @member {google.maps.routeoptimization.v1.IShipmentModel|null|undefined} model + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.model = null; + + /** + * OptimizeToursRequest solvingMode. + * @member {google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode} solvingMode + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.solvingMode = 0; + + /** + * OptimizeToursRequest searchMode. + * @member {google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode} searchMode + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.searchMode = 0; + + /** + * OptimizeToursRequest injectedFirstSolutionRoutes. + * @member {Array.} injectedFirstSolutionRoutes + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.injectedFirstSolutionRoutes = $util.emptyArray; + + /** + * OptimizeToursRequest injectedSolutionConstraint. + * @member {google.maps.routeoptimization.v1.IInjectedSolutionConstraint|null|undefined} injectedSolutionConstraint + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.injectedSolutionConstraint = null; + + /** + * OptimizeToursRequest refreshDetailsRoutes. + * @member {Array.} refreshDetailsRoutes + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.refreshDetailsRoutes = $util.emptyArray; + + /** + * OptimizeToursRequest interpretInjectedSolutionsUsingLabels. + * @member {boolean} interpretInjectedSolutionsUsingLabels + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.interpretInjectedSolutionsUsingLabels = false; + + /** + * OptimizeToursRequest considerRoadTraffic. + * @member {boolean} considerRoadTraffic + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.considerRoadTraffic = false; + + /** + * OptimizeToursRequest populatePolylines. + * @member {boolean} populatePolylines + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.populatePolylines = false; + + /** + * OptimizeToursRequest populateTransitionPolylines. + * @member {boolean} populateTransitionPolylines + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.populateTransitionPolylines = false; + + /** + * OptimizeToursRequest allowLargeDeadlineDespiteInterruptionRisk. + * @member {boolean} allowLargeDeadlineDespiteInterruptionRisk + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.allowLargeDeadlineDespiteInterruptionRisk = false; + + /** + * OptimizeToursRequest useGeodesicDistances. + * @member {boolean} useGeodesicDistances + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.useGeodesicDistances = false; + + /** + * OptimizeToursRequest geodesicMetersPerSecond. + * @member {number|null|undefined} geodesicMetersPerSecond + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.geodesicMetersPerSecond = null; + + /** + * OptimizeToursRequest maxValidationErrors. + * @member {number|null|undefined} maxValidationErrors + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.maxValidationErrors = null; + + /** + * OptimizeToursRequest label. + * @member {string} label + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.label = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OptimizeToursRequest _geodesicMetersPerSecond. + * @member {"geodesicMetersPerSecond"|undefined} _geodesicMetersPerSecond + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + Object.defineProperty(OptimizeToursRequest.prototype, "_geodesicMetersPerSecond", { + get: $util.oneOfGetter($oneOfFields = ["geodesicMetersPerSecond"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OptimizeToursRequest _maxValidationErrors. + * @member {"maxValidationErrors"|undefined} _maxValidationErrors + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + */ + Object.defineProperty(OptimizeToursRequest.prototype, "_maxValidationErrors", { + get: $util.oneOfGetter($oneOfFields = ["maxValidationErrors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OptimizeToursRequest instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursRequest=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.OptimizeToursRequest} OptimizeToursRequest instance + */ + OptimizeToursRequest.create = function create(properties) { + return new OptimizeToursRequest(properties); + }; + + /** + * Encodes the specified OptimizeToursRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursRequest} message OptimizeToursRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeToursRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.maps.routeoptimization.v1.ShipmentModel.encode(message.model, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.solvingMode != null && Object.hasOwnProperty.call(message, "solvingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.solvingMode); + if (message.maxValidationErrors != null && Object.hasOwnProperty.call(message, "maxValidationErrors")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxValidationErrors); + if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.searchMode); + if (message.injectedFirstSolutionRoutes != null && message.injectedFirstSolutionRoutes.length) + for (var i = 0; i < message.injectedFirstSolutionRoutes.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.encode(message.injectedFirstSolutionRoutes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.injectedSolutionConstraint != null && Object.hasOwnProperty.call(message, "injectedSolutionConstraint")) + $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.encode(message.injectedSolutionConstraint, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.refreshDetailsRoutes != null && message.refreshDetailsRoutes.length) + for (var i = 0; i < message.refreshDetailsRoutes.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.encode(message.refreshDetailsRoutes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.interpretInjectedSolutionsUsingLabels != null && Object.hasOwnProperty.call(message, "interpretInjectedSolutionsUsingLabels")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.interpretInjectedSolutionsUsingLabels); + if (message.considerRoadTraffic != null && Object.hasOwnProperty.call(message, "considerRoadTraffic")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.considerRoadTraffic); + if (message.populatePolylines != null && Object.hasOwnProperty.call(message, "populatePolylines")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.populatePolylines); + if (message.populateTransitionPolylines != null && Object.hasOwnProperty.call(message, "populateTransitionPolylines")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.populateTransitionPolylines); + if (message.allowLargeDeadlineDespiteInterruptionRisk != null && Object.hasOwnProperty.call(message, "allowLargeDeadlineDespiteInterruptionRisk")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.allowLargeDeadlineDespiteInterruptionRisk); + if (message.useGeodesicDistances != null && Object.hasOwnProperty.call(message, "useGeodesicDistances")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.useGeodesicDistances); + if (message.geodesicMetersPerSecond != null && Object.hasOwnProperty.call(message, "geodesicMetersPerSecond")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.geodesicMetersPerSecond); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.label); + return writer; + }; + + /** + * Encodes the specified OptimizeToursRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursRequest} message OptimizeToursRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeToursRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeToursRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.OptimizeToursRequest} OptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeToursRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.OptimizeToursRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.model = $root.google.maps.routeoptimization.v1.ShipmentModel.decode(reader, reader.uint32()); + break; + } + case 4: { + message.solvingMode = reader.int32(); + break; + } + case 6: { + message.searchMode = reader.int32(); + break; + } + case 7: { + if (!(message.injectedFirstSolutionRoutes && message.injectedFirstSolutionRoutes.length)) + message.injectedFirstSolutionRoutes = []; + message.injectedFirstSolutionRoutes.push($root.google.maps.routeoptimization.v1.ShipmentRoute.decode(reader, reader.uint32())); + break; + } + case 8: { + message.injectedSolutionConstraint = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.refreshDetailsRoutes && message.refreshDetailsRoutes.length)) + message.refreshDetailsRoutes = []; + message.refreshDetailsRoutes.push($root.google.maps.routeoptimization.v1.ShipmentRoute.decode(reader, reader.uint32())); + break; + } + case 10: { + message.interpretInjectedSolutionsUsingLabels = reader.bool(); + break; + } + case 11: { + message.considerRoadTraffic = reader.bool(); + break; + } + case 12: { + message.populatePolylines = reader.bool(); + break; + } + case 13: { + message.populateTransitionPolylines = reader.bool(); + break; + } + case 14: { + message.allowLargeDeadlineDespiteInterruptionRisk = reader.bool(); + break; + } + case 15: { + message.useGeodesicDistances = reader.bool(); + break; + } + case 16: { + message.geodesicMetersPerSecond = reader.double(); + break; + } + case 5: { + message.maxValidationErrors = reader.int32(); + break; + } + case 17: { + message.label = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeToursRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.OptimizeToursRequest} OptimizeToursRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeToursRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeToursRequest message. + * @function verify + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeToursRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.maps.routeoptimization.v1.ShipmentModel.verify(message.model); + if (error) + return "model." + error; + } + if (message.solvingMode != null && message.hasOwnProperty("solvingMode")) + switch (message.solvingMode) { + default: + return "solvingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.injectedFirstSolutionRoutes != null && message.hasOwnProperty("injectedFirstSolutionRoutes")) { + if (!Array.isArray(message.injectedFirstSolutionRoutes)) + return "injectedFirstSolutionRoutes: array expected"; + for (var i = 0; i < message.injectedFirstSolutionRoutes.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.verify(message.injectedFirstSolutionRoutes[i]); + if (error) + return "injectedFirstSolutionRoutes." + error; + } + } + if (message.injectedSolutionConstraint != null && message.hasOwnProperty("injectedSolutionConstraint")) { + var error = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.verify(message.injectedSolutionConstraint); + if (error) + return "injectedSolutionConstraint." + error; + } + if (message.refreshDetailsRoutes != null && message.hasOwnProperty("refreshDetailsRoutes")) { + if (!Array.isArray(message.refreshDetailsRoutes)) + return "refreshDetailsRoutes: array expected"; + for (var i = 0; i < message.refreshDetailsRoutes.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.verify(message.refreshDetailsRoutes[i]); + if (error) + return "refreshDetailsRoutes." + error; + } + } + if (message.interpretInjectedSolutionsUsingLabels != null && message.hasOwnProperty("interpretInjectedSolutionsUsingLabels")) + if (typeof message.interpretInjectedSolutionsUsingLabels !== "boolean") + return "interpretInjectedSolutionsUsingLabels: boolean expected"; + if (message.considerRoadTraffic != null && message.hasOwnProperty("considerRoadTraffic")) + if (typeof message.considerRoadTraffic !== "boolean") + return "considerRoadTraffic: boolean expected"; + if (message.populatePolylines != null && message.hasOwnProperty("populatePolylines")) + if (typeof message.populatePolylines !== "boolean") + return "populatePolylines: boolean expected"; + if (message.populateTransitionPolylines != null && message.hasOwnProperty("populateTransitionPolylines")) + if (typeof message.populateTransitionPolylines !== "boolean") + return "populateTransitionPolylines: boolean expected"; + if (message.allowLargeDeadlineDespiteInterruptionRisk != null && message.hasOwnProperty("allowLargeDeadlineDespiteInterruptionRisk")) + if (typeof message.allowLargeDeadlineDespiteInterruptionRisk !== "boolean") + return "allowLargeDeadlineDespiteInterruptionRisk: boolean expected"; + if (message.useGeodesicDistances != null && message.hasOwnProperty("useGeodesicDistances")) + if (typeof message.useGeodesicDistances !== "boolean") + return "useGeodesicDistances: boolean expected"; + if (message.geodesicMetersPerSecond != null && message.hasOwnProperty("geodesicMetersPerSecond")) { + properties._geodesicMetersPerSecond = 1; + if (typeof message.geodesicMetersPerSecond !== "number") + return "geodesicMetersPerSecond: number expected"; + } + if (message.maxValidationErrors != null && message.hasOwnProperty("maxValidationErrors")) { + properties._maxValidationErrors = 1; + if (!$util.isInteger(message.maxValidationErrors)) + return "maxValidationErrors: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + return null; + }; + + /** + * Creates an OptimizeToursRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.OptimizeToursRequest} OptimizeToursRequest + */ + OptimizeToursRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.OptimizeToursRequest) + return object; + var message = new $root.google.maps.routeoptimization.v1.OptimizeToursRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.model: object expected"); + message.model = $root.google.maps.routeoptimization.v1.ShipmentModel.fromObject(object.model); + } + switch (object.solvingMode) { + default: + if (typeof object.solvingMode === "number") { + message.solvingMode = object.solvingMode; + break; + } + break; + case "DEFAULT_SOLVE": + case 0: + message.solvingMode = 0; + break; + case "VALIDATE_ONLY": + case 1: + message.solvingMode = 1; + break; + case "DETECT_SOME_INFEASIBLE_SHIPMENTS": + case 2: + message.solvingMode = 2; + break; + } + switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "RETURN_FAST": + case 1: + message.searchMode = 1; + break; + case "CONSUME_ALL_AVAILABLE_TIME": + case 2: + message.searchMode = 2; + break; + } + if (object.injectedFirstSolutionRoutes) { + if (!Array.isArray(object.injectedFirstSolutionRoutes)) + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.injectedFirstSolutionRoutes: array expected"); + message.injectedFirstSolutionRoutes = []; + for (var i = 0; i < object.injectedFirstSolutionRoutes.length; ++i) { + if (typeof object.injectedFirstSolutionRoutes[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.injectedFirstSolutionRoutes: object expected"); + message.injectedFirstSolutionRoutes[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.fromObject(object.injectedFirstSolutionRoutes[i]); + } + } + if (object.injectedSolutionConstraint != null) { + if (typeof object.injectedSolutionConstraint !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.injectedSolutionConstraint: object expected"); + message.injectedSolutionConstraint = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.fromObject(object.injectedSolutionConstraint); + } + if (object.refreshDetailsRoutes) { + if (!Array.isArray(object.refreshDetailsRoutes)) + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.refreshDetailsRoutes: array expected"); + message.refreshDetailsRoutes = []; + for (var i = 0; i < object.refreshDetailsRoutes.length; ++i) { + if (typeof object.refreshDetailsRoutes[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursRequest.refreshDetailsRoutes: object expected"); + message.refreshDetailsRoutes[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.fromObject(object.refreshDetailsRoutes[i]); + } + } + if (object.interpretInjectedSolutionsUsingLabels != null) + message.interpretInjectedSolutionsUsingLabels = Boolean(object.interpretInjectedSolutionsUsingLabels); + if (object.considerRoadTraffic != null) + message.considerRoadTraffic = Boolean(object.considerRoadTraffic); + if (object.populatePolylines != null) + message.populatePolylines = Boolean(object.populatePolylines); + if (object.populateTransitionPolylines != null) + message.populateTransitionPolylines = Boolean(object.populateTransitionPolylines); + if (object.allowLargeDeadlineDespiteInterruptionRisk != null) + message.allowLargeDeadlineDespiteInterruptionRisk = Boolean(object.allowLargeDeadlineDespiteInterruptionRisk); + if (object.useGeodesicDistances != null) + message.useGeodesicDistances = Boolean(object.useGeodesicDistances); + if (object.geodesicMetersPerSecond != null) + message.geodesicMetersPerSecond = Number(object.geodesicMetersPerSecond); + if (object.maxValidationErrors != null) + message.maxValidationErrors = object.maxValidationErrors | 0; + if (object.label != null) + message.label = String(object.label); + return message; + }; + + /** + * Creates a plain object from an OptimizeToursRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursRequest} message OptimizeToursRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeToursRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.injectedFirstSolutionRoutes = []; + object.refreshDetailsRoutes = []; + } + if (options.defaults) { + object.parent = ""; + object.timeout = null; + object.model = null; + object.solvingMode = options.enums === String ? "DEFAULT_SOLVE" : 0; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.injectedSolutionConstraint = null; + object.interpretInjectedSolutionsUsingLabels = false; + object.considerRoadTraffic = false; + object.populatePolylines = false; + object.populateTransitionPolylines = false; + object.allowLargeDeadlineDespiteInterruptionRisk = false; + object.useGeodesicDistances = false; + object.label = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.maps.routeoptimization.v1.ShipmentModel.toObject(message.model, options); + if (message.solvingMode != null && message.hasOwnProperty("solvingMode")) + object.solvingMode = options.enums === String ? $root.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode[message.solvingMode] === undefined ? message.solvingMode : $root.google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode[message.solvingMode] : message.solvingMode; + if (message.maxValidationErrors != null && message.hasOwnProperty("maxValidationErrors")) { + object.maxValidationErrors = message.maxValidationErrors; + if (options.oneofs) + object._maxValidationErrors = "maxValidationErrors"; + } + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.injectedFirstSolutionRoutes && message.injectedFirstSolutionRoutes.length) { + object.injectedFirstSolutionRoutes = []; + for (var j = 0; j < message.injectedFirstSolutionRoutes.length; ++j) + object.injectedFirstSolutionRoutes[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.toObject(message.injectedFirstSolutionRoutes[j], options); + } + if (message.injectedSolutionConstraint != null && message.hasOwnProperty("injectedSolutionConstraint")) + object.injectedSolutionConstraint = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.toObject(message.injectedSolutionConstraint, options); + if (message.refreshDetailsRoutes && message.refreshDetailsRoutes.length) { + object.refreshDetailsRoutes = []; + for (var j = 0; j < message.refreshDetailsRoutes.length; ++j) + object.refreshDetailsRoutes[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.toObject(message.refreshDetailsRoutes[j], options); + } + if (message.interpretInjectedSolutionsUsingLabels != null && message.hasOwnProperty("interpretInjectedSolutionsUsingLabels")) + object.interpretInjectedSolutionsUsingLabels = message.interpretInjectedSolutionsUsingLabels; + if (message.considerRoadTraffic != null && message.hasOwnProperty("considerRoadTraffic")) + object.considerRoadTraffic = message.considerRoadTraffic; + if (message.populatePolylines != null && message.hasOwnProperty("populatePolylines")) + object.populatePolylines = message.populatePolylines; + if (message.populateTransitionPolylines != null && message.hasOwnProperty("populateTransitionPolylines")) + object.populateTransitionPolylines = message.populateTransitionPolylines; + if (message.allowLargeDeadlineDespiteInterruptionRisk != null && message.hasOwnProperty("allowLargeDeadlineDespiteInterruptionRisk")) + object.allowLargeDeadlineDespiteInterruptionRisk = message.allowLargeDeadlineDespiteInterruptionRisk; + if (message.useGeodesicDistances != null && message.hasOwnProperty("useGeodesicDistances")) + object.useGeodesicDistances = message.useGeodesicDistances; + if (message.geodesicMetersPerSecond != null && message.hasOwnProperty("geodesicMetersPerSecond")) { + object.geodesicMetersPerSecond = options.json && !isFinite(message.geodesicMetersPerSecond) ? String(message.geodesicMetersPerSecond) : message.geodesicMetersPerSecond; + if (options.oneofs) + object._geodesicMetersPerSecond = "geodesicMetersPerSecond"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + return object; + }; + + /** + * Converts this OptimizeToursRequest to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @instance + * @returns {Object.} JSON object + */ + OptimizeToursRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeToursRequest + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.OptimizeToursRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeToursRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.OptimizeToursRequest"; + }; + + /** + * SolvingMode enum. + * @name google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode + * @enum {number} + * @property {number} DEFAULT_SOLVE=0 DEFAULT_SOLVE value + * @property {number} VALIDATE_ONLY=1 VALIDATE_ONLY value + * @property {number} DETECT_SOME_INFEASIBLE_SHIPMENTS=2 DETECT_SOME_INFEASIBLE_SHIPMENTS value + */ + OptimizeToursRequest.SolvingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SOLVE"] = 0; + values[valuesById[1] = "VALIDATE_ONLY"] = 1; + values[valuesById[2] = "DETECT_SOME_INFEASIBLE_SHIPMENTS"] = 2; + return values; + })(); + + /** + * SearchMode enum. + * @name google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode + * @enum {number} + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} RETURN_FAST=1 RETURN_FAST value + * @property {number} CONSUME_ALL_AVAILABLE_TIME=2 CONSUME_ALL_AVAILABLE_TIME value + */ + OptimizeToursRequest.SearchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETURN_FAST"] = 1; + values[valuesById[2] = "CONSUME_ALL_AVAILABLE_TIME"] = 2; + return values; + })(); + + return OptimizeToursRequest; + })(); + + v1.OptimizeToursResponse = (function() { + + /** + * Properties of an OptimizeToursResponse. + * @memberof google.maps.routeoptimization.v1 + * @interface IOptimizeToursResponse + * @property {Array.|null} [routes] OptimizeToursResponse routes + * @property {string|null} [requestLabel] OptimizeToursResponse requestLabel + * @property {Array.|null} [skippedShipments] OptimizeToursResponse skippedShipments + * @property {Array.|null} [validationErrors] OptimizeToursResponse validationErrors + * @property {google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics|null} [metrics] OptimizeToursResponse metrics + */ + + /** + * Constructs a new OptimizeToursResponse. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an OptimizeToursResponse. + * @implements IOptimizeToursResponse + * @constructor + * @param {google.maps.routeoptimization.v1.IOptimizeToursResponse=} [properties] Properties to set + */ + function OptimizeToursResponse(properties) { + this.routes = []; + this.skippedShipments = []; + this.validationErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeToursResponse routes. + * @member {Array.} routes + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @instance + */ + OptimizeToursResponse.prototype.routes = $util.emptyArray; + + /** + * OptimizeToursResponse requestLabel. + * @member {string} requestLabel + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @instance + */ + OptimizeToursResponse.prototype.requestLabel = ""; + + /** + * OptimizeToursResponse skippedShipments. + * @member {Array.} skippedShipments + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @instance + */ + OptimizeToursResponse.prototype.skippedShipments = $util.emptyArray; + + /** + * OptimizeToursResponse validationErrors. + * @member {Array.} validationErrors + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @instance + */ + OptimizeToursResponse.prototype.validationErrors = $util.emptyArray; + + /** + * OptimizeToursResponse metrics. + * @member {google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics|null|undefined} metrics + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @instance + */ + OptimizeToursResponse.prototype.metrics = null; + + /** + * Creates a new OptimizeToursResponse instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursResponse=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse} OptimizeToursResponse instance + */ + OptimizeToursResponse.create = function create(properties) { + return new OptimizeToursResponse(properties); + }; + + /** + * Encodes the specified OptimizeToursResponse message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursResponse} message OptimizeToursResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeToursResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routes != null && message.routes.length) + for (var i = 0; i < message.routes.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestLabel != null && Object.hasOwnProperty.call(message, "requestLabel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestLabel); + if (message.skippedShipments != null && message.skippedShipments.length) + for (var i = 0; i < message.skippedShipments.length; ++i) + $root.google.maps.routeoptimization.v1.SkippedShipment.encode(message.skippedShipments[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.validationErrors != null && message.validationErrors.length) + for (var i = 0; i < message.validationErrors.length; ++i) + $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.encode(message.validationErrors[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.encode(message.metrics, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizeToursResponse message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursResponse} message OptimizeToursResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeToursResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeToursResponse message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse} OptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeToursResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.OptimizeToursResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.routes && message.routes.length)) + message.routes = []; + message.routes.push($root.google.maps.routeoptimization.v1.ShipmentRoute.decode(reader, reader.uint32())); + break; + } + case 3: { + message.requestLabel = reader.string(); + break; + } + case 4: { + if (!(message.skippedShipments && message.skippedShipments.length)) + message.skippedShipments = []; + message.skippedShipments.push($root.google.maps.routeoptimization.v1.SkippedShipment.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.validationErrors && message.validationErrors.length)) + message.validationErrors = []; + message.validationErrors.push($root.google.maps.routeoptimization.v1.OptimizeToursValidationError.decode(reader, reader.uint32())); + break; + } + case 6: { + message.metrics = $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeToursResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse} OptimizeToursResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeToursResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeToursResponse message. + * @function verify + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeToursResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routes != null && message.hasOwnProperty("routes")) { + if (!Array.isArray(message.routes)) + return "routes: array expected"; + for (var i = 0; i < message.routes.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.verify(message.routes[i]); + if (error) + return "routes." + error; + } + } + if (message.requestLabel != null && message.hasOwnProperty("requestLabel")) + if (!$util.isString(message.requestLabel)) + return "requestLabel: string expected"; + if (message.skippedShipments != null && message.hasOwnProperty("skippedShipments")) { + if (!Array.isArray(message.skippedShipments)) + return "skippedShipments: array expected"; + for (var i = 0; i < message.skippedShipments.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.SkippedShipment.verify(message.skippedShipments[i]); + if (error) + return "skippedShipments." + error; + } + } + if (message.validationErrors != null && message.hasOwnProperty("validationErrors")) { + if (!Array.isArray(message.validationErrors)) + return "validationErrors: array expected"; + for (var i = 0; i < message.validationErrors.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.verify(message.validationErrors[i]); + if (error) + return "validationErrors." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates an OptimizeToursResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse} OptimizeToursResponse + */ + OptimizeToursResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.OptimizeToursResponse) + return object; + var message = new $root.google.maps.routeoptimization.v1.OptimizeToursResponse(); + if (object.routes) { + if (!Array.isArray(object.routes)) + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.routes: array expected"); + message.routes = []; + for (var i = 0; i < object.routes.length; ++i) { + if (typeof object.routes[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.routes: object expected"); + message.routes[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.fromObject(object.routes[i]); + } + } + if (object.requestLabel != null) + message.requestLabel = String(object.requestLabel); + if (object.skippedShipments) { + if (!Array.isArray(object.skippedShipments)) + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.skippedShipments: array expected"); + message.skippedShipments = []; + for (var i = 0; i < object.skippedShipments.length; ++i) { + if (typeof object.skippedShipments[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.skippedShipments: object expected"); + message.skippedShipments[i] = $root.google.maps.routeoptimization.v1.SkippedShipment.fromObject(object.skippedShipments[i]); + } + } + if (object.validationErrors) { + if (!Array.isArray(object.validationErrors)) + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.validationErrors: array expected"); + message.validationErrors = []; + for (var i = 0; i < object.validationErrors.length; ++i) { + if (typeof object.validationErrors[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.validationErrors: object expected"); + message.validationErrors[i] = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.fromObject(object.validationErrors[i]); + } + } + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.metrics: object expected"); + message.metrics = $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from an OptimizeToursResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse} message OptimizeToursResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeToursResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.routes = []; + object.skippedShipments = []; + object.validationErrors = []; + } + if (options.defaults) { + object.requestLabel = ""; + object.metrics = null; + } + if (message.routes && message.routes.length) { + object.routes = []; + for (var j = 0; j < message.routes.length; ++j) + object.routes[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.toObject(message.routes[j], options); + } + if (message.requestLabel != null && message.hasOwnProperty("requestLabel")) + object.requestLabel = message.requestLabel; + if (message.skippedShipments && message.skippedShipments.length) { + object.skippedShipments = []; + for (var j = 0; j < message.skippedShipments.length; ++j) + object.skippedShipments[j] = $root.google.maps.routeoptimization.v1.SkippedShipment.toObject(message.skippedShipments[j], options); + } + if (message.validationErrors && message.validationErrors.length) { + object.validationErrors = []; + for (var j = 0; j < message.validationErrors.length; ++j) + object.validationErrors[j] = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.toObject(message.validationErrors[j], options); + } + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.toObject(message.metrics, options); + return object; + }; + + /** + * Converts this OptimizeToursResponse to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @instance + * @returns {Object.} JSON object + */ + OptimizeToursResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeToursResponse + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeToursResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.OptimizeToursResponse"; + }; + + OptimizeToursResponse.Metrics = (function() { + + /** + * Properties of a Metrics. + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @interface IMetrics + * @property {google.maps.routeoptimization.v1.IAggregatedMetrics|null} [aggregatedRouteMetrics] Metrics aggregatedRouteMetrics + * @property {number|null} [skippedMandatoryShipmentCount] Metrics skippedMandatoryShipmentCount + * @property {number|null} [usedVehicleCount] Metrics usedVehicleCount + * @property {google.protobuf.ITimestamp|null} [earliestVehicleStartTime] Metrics earliestVehicleStartTime + * @property {google.protobuf.ITimestamp|null} [latestVehicleEndTime] Metrics latestVehicleEndTime + * @property {Object.|null} [costs] Metrics costs + * @property {number|null} [totalCost] Metrics totalCost + */ + + /** + * Constructs a new Metrics. + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse + * @classdesc Represents a Metrics. + * @implements IMetrics + * @constructor + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics=} [properties] Properties to set + */ + function Metrics(properties) { + this.costs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metrics aggregatedRouteMetrics. + * @member {google.maps.routeoptimization.v1.IAggregatedMetrics|null|undefined} aggregatedRouteMetrics + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.aggregatedRouteMetrics = null; + + /** + * Metrics skippedMandatoryShipmentCount. + * @member {number} skippedMandatoryShipmentCount + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.skippedMandatoryShipmentCount = 0; + + /** + * Metrics usedVehicleCount. + * @member {number} usedVehicleCount + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.usedVehicleCount = 0; + + /** + * Metrics earliestVehicleStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestVehicleStartTime + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.earliestVehicleStartTime = null; + + /** + * Metrics latestVehicleEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestVehicleEndTime + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.latestVehicleEndTime = null; + + /** + * Metrics costs. + * @member {Object.} costs + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.costs = $util.emptyObject; + + /** + * Metrics totalCost. + * @member {number} totalCost + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + */ + Metrics.prototype.totalCost = 0; + + /** + * Creates a new Metrics instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} Metrics instance + */ + Metrics.create = function create(properties) { + return new Metrics(properties); + }; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregatedRouteMetrics != null && Object.hasOwnProperty.call(message, "aggregatedRouteMetrics")) + $root.google.maps.routeoptimization.v1.AggregatedMetrics.encode(message.aggregatedRouteMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skippedMandatoryShipmentCount != null && Object.hasOwnProperty.call(message, "skippedMandatoryShipmentCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.skippedMandatoryShipmentCount); + if (message.usedVehicleCount != null && Object.hasOwnProperty.call(message, "usedVehicleCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.usedVehicleCount); + if (message.earliestVehicleStartTime != null && Object.hasOwnProperty.call(message, "earliestVehicleStartTime")) + $root.google.protobuf.Timestamp.encode(message.earliestVehicleStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.latestVehicleEndTime != null && Object.hasOwnProperty.call(message, "latestVehicleEndTime")) + $root.google.protobuf.Timestamp.encode(message.latestVehicleEndTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.totalCost != null && Object.hasOwnProperty.call(message, "totalCost")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.totalCost); + if (message.costs != null && Object.hasOwnProperty.call(message, "costs")) + for (var keys = Object.keys(message.costs), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.costs[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.aggregatedRouteMetrics = $root.google.maps.routeoptimization.v1.AggregatedMetrics.decode(reader, reader.uint32()); + break; + } + case 2: { + message.skippedMandatoryShipmentCount = reader.int32(); + break; + } + case 3: { + message.usedVehicleCount = reader.int32(); + break; + } + case 4: { + message.earliestVehicleStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.latestVehicleEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.costs === $util.emptyObject) + message.costs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.double(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.costs[key] = value; + break; + } + case 6: { + message.totalCost = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metrics message. + * @function verify + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregatedRouteMetrics != null && message.hasOwnProperty("aggregatedRouteMetrics")) { + var error = $root.google.maps.routeoptimization.v1.AggregatedMetrics.verify(message.aggregatedRouteMetrics); + if (error) + return "aggregatedRouteMetrics." + error; + } + if (message.skippedMandatoryShipmentCount != null && message.hasOwnProperty("skippedMandatoryShipmentCount")) + if (!$util.isInteger(message.skippedMandatoryShipmentCount)) + return "skippedMandatoryShipmentCount: integer expected"; + if (message.usedVehicleCount != null && message.hasOwnProperty("usedVehicleCount")) + if (!$util.isInteger(message.usedVehicleCount)) + return "usedVehicleCount: integer expected"; + if (message.earliestVehicleStartTime != null && message.hasOwnProperty("earliestVehicleStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestVehicleStartTime); + if (error) + return "earliestVehicleStartTime." + error; + } + if (message.latestVehicleEndTime != null && message.hasOwnProperty("latestVehicleEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestVehicleEndTime); + if (error) + return "latestVehicleEndTime." + error; + } + if (message.costs != null && message.hasOwnProperty("costs")) { + if (!$util.isObject(message.costs)) + return "costs: object expected"; + var key = Object.keys(message.costs); + for (var i = 0; i < key.length; ++i) + if (typeof message.costs[key[i]] !== "number") + return "costs: number{k:string} expected"; + } + if (message.totalCost != null && message.hasOwnProperty("totalCost")) + if (typeof message.totalCost !== "number") + return "totalCost: number expected"; + return null; + }; + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} Metrics + */ + Metrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics) + return object; + var message = new $root.google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics(); + if (object.aggregatedRouteMetrics != null) { + if (typeof object.aggregatedRouteMetrics !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.aggregatedRouteMetrics: object expected"); + message.aggregatedRouteMetrics = $root.google.maps.routeoptimization.v1.AggregatedMetrics.fromObject(object.aggregatedRouteMetrics); + } + if (object.skippedMandatoryShipmentCount != null) + message.skippedMandatoryShipmentCount = object.skippedMandatoryShipmentCount | 0; + if (object.usedVehicleCount != null) + message.usedVehicleCount = object.usedVehicleCount | 0; + if (object.earliestVehicleStartTime != null) { + if (typeof object.earliestVehicleStartTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.earliestVehicleStartTime: object expected"); + message.earliestVehicleStartTime = $root.google.protobuf.Timestamp.fromObject(object.earliestVehicleStartTime); + } + if (object.latestVehicleEndTime != null) { + if (typeof object.latestVehicleEndTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.latestVehicleEndTime: object expected"); + message.latestVehicleEndTime = $root.google.protobuf.Timestamp.fromObject(object.latestVehicleEndTime); + } + if (object.costs) { + if (typeof object.costs !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics.costs: object expected"); + message.costs = {}; + for (var keys = Object.keys(object.costs), i = 0; i < keys.length; ++i) + message.costs[keys[i]] = Number(object.costs[keys[i]]); + } + if (object.totalCost != null) + message.totalCost = Number(object.totalCost); + return message; + }; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics} message Metrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.costs = {}; + if (options.defaults) { + object.aggregatedRouteMetrics = null; + object.skippedMandatoryShipmentCount = 0; + object.usedVehicleCount = 0; + object.earliestVehicleStartTime = null; + object.latestVehicleEndTime = null; + object.totalCost = 0; + } + if (message.aggregatedRouteMetrics != null && message.hasOwnProperty("aggregatedRouteMetrics")) + object.aggregatedRouteMetrics = $root.google.maps.routeoptimization.v1.AggregatedMetrics.toObject(message.aggregatedRouteMetrics, options); + if (message.skippedMandatoryShipmentCount != null && message.hasOwnProperty("skippedMandatoryShipmentCount")) + object.skippedMandatoryShipmentCount = message.skippedMandatoryShipmentCount; + if (message.usedVehicleCount != null && message.hasOwnProperty("usedVehicleCount")) + object.usedVehicleCount = message.usedVehicleCount; + if (message.earliestVehicleStartTime != null && message.hasOwnProperty("earliestVehicleStartTime")) + object.earliestVehicleStartTime = $root.google.protobuf.Timestamp.toObject(message.earliestVehicleStartTime, options); + if (message.latestVehicleEndTime != null && message.hasOwnProperty("latestVehicleEndTime")) + object.latestVehicleEndTime = $root.google.protobuf.Timestamp.toObject(message.latestVehicleEndTime, options); + if (message.totalCost != null && message.hasOwnProperty("totalCost")) + object.totalCost = options.json && !isFinite(message.totalCost) ? String(message.totalCost) : message.totalCost; + var keys2; + if (message.costs && (keys2 = Object.keys(message.costs)).length) { + object.costs = {}; + for (var j = 0; j < keys2.length; ++j) + object.costs[keys2[j]] = options.json && !isFinite(message.costs[keys2[j]]) ? String(message.costs[keys2[j]]) : message.costs[keys2[j]]; + } + return object; + }; + + /** + * Converts this Metrics to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @instance + * @returns {Object.} JSON object + */ + Metrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metrics + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics"; + }; + + return Metrics; + })(); + + return OptimizeToursResponse; + })(); + + v1.ShipmentModel = (function() { + + /** + * Properties of a ShipmentModel. + * @memberof google.maps.routeoptimization.v1 + * @interface IShipmentModel + * @property {Array.|null} [shipments] ShipmentModel shipments + * @property {Array.|null} [vehicles] ShipmentModel vehicles + * @property {number|null} [maxActiveVehicles] ShipmentModel maxActiveVehicles + * @property {google.protobuf.ITimestamp|null} [globalStartTime] ShipmentModel globalStartTime + * @property {google.protobuf.ITimestamp|null} [globalEndTime] ShipmentModel globalEndTime + * @property {number|null} [globalDurationCostPerHour] ShipmentModel globalDurationCostPerHour + * @property {Array.|null} [durationDistanceMatrices] ShipmentModel durationDistanceMatrices + * @property {Array.|null} [durationDistanceMatrixSrcTags] ShipmentModel durationDistanceMatrixSrcTags + * @property {Array.|null} [durationDistanceMatrixDstTags] ShipmentModel durationDistanceMatrixDstTags + * @property {Array.|null} [transitionAttributes] ShipmentModel transitionAttributes + * @property {Array.|null} [shipmentTypeIncompatibilities] ShipmentModel shipmentTypeIncompatibilities + * @property {Array.|null} [shipmentTypeRequirements] ShipmentModel shipmentTypeRequirements + * @property {Array.|null} [precedenceRules] ShipmentModel precedenceRules + */ + + /** + * Constructs a new ShipmentModel. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a ShipmentModel. + * @implements IShipmentModel + * @constructor + * @param {google.maps.routeoptimization.v1.IShipmentModel=} [properties] Properties to set + */ + function ShipmentModel(properties) { + this.shipments = []; + this.vehicles = []; + this.durationDistanceMatrices = []; + this.durationDistanceMatrixSrcTags = []; + this.durationDistanceMatrixDstTags = []; + this.transitionAttributes = []; + this.shipmentTypeIncompatibilities = []; + this.shipmentTypeRequirements = []; + this.precedenceRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShipmentModel shipments. + * @member {Array.} shipments + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.shipments = $util.emptyArray; + + /** + * ShipmentModel vehicles. + * @member {Array.} vehicles + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.vehicles = $util.emptyArray; + + /** + * ShipmentModel maxActiveVehicles. + * @member {number|null|undefined} maxActiveVehicles + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.maxActiveVehicles = null; + + /** + * ShipmentModel globalStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} globalStartTime + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.globalStartTime = null; + + /** + * ShipmentModel globalEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} globalEndTime + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.globalEndTime = null; + + /** + * ShipmentModel globalDurationCostPerHour. + * @member {number} globalDurationCostPerHour + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.globalDurationCostPerHour = 0; + + /** + * ShipmentModel durationDistanceMatrices. + * @member {Array.} durationDistanceMatrices + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.durationDistanceMatrices = $util.emptyArray; + + /** + * ShipmentModel durationDistanceMatrixSrcTags. + * @member {Array.} durationDistanceMatrixSrcTags + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.durationDistanceMatrixSrcTags = $util.emptyArray; + + /** + * ShipmentModel durationDistanceMatrixDstTags. + * @member {Array.} durationDistanceMatrixDstTags + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.durationDistanceMatrixDstTags = $util.emptyArray; + + /** + * ShipmentModel transitionAttributes. + * @member {Array.} transitionAttributes + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.transitionAttributes = $util.emptyArray; + + /** + * ShipmentModel shipmentTypeIncompatibilities. + * @member {Array.} shipmentTypeIncompatibilities + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.shipmentTypeIncompatibilities = $util.emptyArray; + + /** + * ShipmentModel shipmentTypeRequirements. + * @member {Array.} shipmentTypeRequirements + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.shipmentTypeRequirements = $util.emptyArray; + + /** + * ShipmentModel precedenceRules. + * @member {Array.} precedenceRules + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + ShipmentModel.prototype.precedenceRules = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ShipmentModel _maxActiveVehicles. + * @member {"maxActiveVehicles"|undefined} _maxActiveVehicles + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + */ + Object.defineProperty(ShipmentModel.prototype, "_maxActiveVehicles", { + get: $util.oneOfGetter($oneOfFields = ["maxActiveVehicles"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShipmentModel instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {google.maps.routeoptimization.v1.IShipmentModel=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentModel} ShipmentModel instance + */ + ShipmentModel.create = function create(properties) { + return new ShipmentModel(properties); + }; + + /** + * Encodes the specified ShipmentModel message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {google.maps.routeoptimization.v1.IShipmentModel} message ShipmentModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentModel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shipments != null && message.shipments.length) + for (var i = 0; i < message.shipments.length; ++i) + $root.google.maps.routeoptimization.v1.Shipment.encode(message.shipments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vehicles != null && message.vehicles.length) + for (var i = 0; i < message.vehicles.length; ++i) + $root.google.maps.routeoptimization.v1.Vehicle.encode(message.vehicles[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxActiveVehicles != null && Object.hasOwnProperty.call(message, "maxActiveVehicles")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxActiveVehicles); + if (message.globalStartTime != null && Object.hasOwnProperty.call(message, "globalStartTime")) + $root.google.protobuf.Timestamp.encode(message.globalStartTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.globalEndTime != null && Object.hasOwnProperty.call(message, "globalEndTime")) + $root.google.protobuf.Timestamp.encode(message.globalEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.globalDurationCostPerHour != null && Object.hasOwnProperty.call(message, "globalDurationCostPerHour")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.globalDurationCostPerHour); + if (message.durationDistanceMatrices != null && message.durationDistanceMatrices.length) + for (var i = 0; i < message.durationDistanceMatrices.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.encode(message.durationDistanceMatrices[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.durationDistanceMatrixSrcTags != null && message.durationDistanceMatrixSrcTags.length) + for (var i = 0; i < message.durationDistanceMatrixSrcTags.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.durationDistanceMatrixSrcTags[i]); + if (message.durationDistanceMatrixDstTags != null && message.durationDistanceMatrixDstTags.length) + for (var i = 0; i < message.durationDistanceMatrixDstTags.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.durationDistanceMatrixDstTags[i]); + if (message.transitionAttributes != null && message.transitionAttributes.length) + for (var i = 0; i < message.transitionAttributes.length; ++i) + $root.google.maps.routeoptimization.v1.TransitionAttributes.encode(message.transitionAttributes[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.shipmentTypeIncompatibilities != null && message.shipmentTypeIncompatibilities.length) + for (var i = 0; i < message.shipmentTypeIncompatibilities.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.encode(message.shipmentTypeIncompatibilities[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.shipmentTypeRequirements != null && message.shipmentTypeRequirements.length) + for (var i = 0; i < message.shipmentTypeRequirements.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.encode(message.shipmentTypeRequirements[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.precedenceRules != null && message.precedenceRules.length) + for (var i = 0; i < message.precedenceRules.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.encode(message.precedenceRules[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ShipmentModel message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {google.maps.routeoptimization.v1.IShipmentModel} message ShipmentModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentModel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShipmentModel message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentModel} ShipmentModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentModel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentModel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.shipments && message.shipments.length)) + message.shipments = []; + message.shipments.push($root.google.maps.routeoptimization.v1.Shipment.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.vehicles && message.vehicles.length)) + message.vehicles = []; + message.vehicles.push($root.google.maps.routeoptimization.v1.Vehicle.decode(reader, reader.uint32())); + break; + } + case 4: { + message.maxActiveVehicles = reader.int32(); + break; + } + case 5: { + message.globalStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.globalEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.globalDurationCostPerHour = reader.double(); + break; + } + case 8: { + if (!(message.durationDistanceMatrices && message.durationDistanceMatrices.length)) + message.durationDistanceMatrices = []; + message.durationDistanceMatrices.push($root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.durationDistanceMatrixSrcTags && message.durationDistanceMatrixSrcTags.length)) + message.durationDistanceMatrixSrcTags = []; + message.durationDistanceMatrixSrcTags.push(reader.string()); + break; + } + case 10: { + if (!(message.durationDistanceMatrixDstTags && message.durationDistanceMatrixDstTags.length)) + message.durationDistanceMatrixDstTags = []; + message.durationDistanceMatrixDstTags.push(reader.string()); + break; + } + case 11: { + if (!(message.transitionAttributes && message.transitionAttributes.length)) + message.transitionAttributes = []; + message.transitionAttributes.push($root.google.maps.routeoptimization.v1.TransitionAttributes.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.shipmentTypeIncompatibilities && message.shipmentTypeIncompatibilities.length)) + message.shipmentTypeIncompatibilities = []; + message.shipmentTypeIncompatibilities.push($root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.shipmentTypeRequirements && message.shipmentTypeRequirements.length)) + message.shipmentTypeRequirements = []; + message.shipmentTypeRequirements.push($root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.precedenceRules && message.precedenceRules.length)) + message.precedenceRules = []; + message.precedenceRules.push($root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShipmentModel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentModel} ShipmentModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentModel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShipmentModel message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShipmentModel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.shipments != null && message.hasOwnProperty("shipments")) { + if (!Array.isArray(message.shipments)) + return "shipments: array expected"; + for (var i = 0; i < message.shipments.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Shipment.verify(message.shipments[i]); + if (error) + return "shipments." + error; + } + } + if (message.vehicles != null && message.hasOwnProperty("vehicles")) { + if (!Array.isArray(message.vehicles)) + return "vehicles: array expected"; + for (var i = 0; i < message.vehicles.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Vehicle.verify(message.vehicles[i]); + if (error) + return "vehicles." + error; + } + } + if (message.maxActiveVehicles != null && message.hasOwnProperty("maxActiveVehicles")) { + properties._maxActiveVehicles = 1; + if (!$util.isInteger(message.maxActiveVehicles)) + return "maxActiveVehicles: integer expected"; + } + if (message.globalStartTime != null && message.hasOwnProperty("globalStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.globalStartTime); + if (error) + return "globalStartTime." + error; + } + if (message.globalEndTime != null && message.hasOwnProperty("globalEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.globalEndTime); + if (error) + return "globalEndTime." + error; + } + if (message.globalDurationCostPerHour != null && message.hasOwnProperty("globalDurationCostPerHour")) + if (typeof message.globalDurationCostPerHour !== "number") + return "globalDurationCostPerHour: number expected"; + if (message.durationDistanceMatrices != null && message.hasOwnProperty("durationDistanceMatrices")) { + if (!Array.isArray(message.durationDistanceMatrices)) + return "durationDistanceMatrices: array expected"; + for (var i = 0; i < message.durationDistanceMatrices.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.verify(message.durationDistanceMatrices[i]); + if (error) + return "durationDistanceMatrices." + error; + } + } + if (message.durationDistanceMatrixSrcTags != null && message.hasOwnProperty("durationDistanceMatrixSrcTags")) { + if (!Array.isArray(message.durationDistanceMatrixSrcTags)) + return "durationDistanceMatrixSrcTags: array expected"; + for (var i = 0; i < message.durationDistanceMatrixSrcTags.length; ++i) + if (!$util.isString(message.durationDistanceMatrixSrcTags[i])) + return "durationDistanceMatrixSrcTags: string[] expected"; + } + if (message.durationDistanceMatrixDstTags != null && message.hasOwnProperty("durationDistanceMatrixDstTags")) { + if (!Array.isArray(message.durationDistanceMatrixDstTags)) + return "durationDistanceMatrixDstTags: array expected"; + for (var i = 0; i < message.durationDistanceMatrixDstTags.length; ++i) + if (!$util.isString(message.durationDistanceMatrixDstTags[i])) + return "durationDistanceMatrixDstTags: string[] expected"; + } + if (message.transitionAttributes != null && message.hasOwnProperty("transitionAttributes")) { + if (!Array.isArray(message.transitionAttributes)) + return "transitionAttributes: array expected"; + for (var i = 0; i < message.transitionAttributes.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.TransitionAttributes.verify(message.transitionAttributes[i]); + if (error) + return "transitionAttributes." + error; + } + } + if (message.shipmentTypeIncompatibilities != null && message.hasOwnProperty("shipmentTypeIncompatibilities")) { + if (!Array.isArray(message.shipmentTypeIncompatibilities)) + return "shipmentTypeIncompatibilities: array expected"; + for (var i = 0; i < message.shipmentTypeIncompatibilities.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.verify(message.shipmentTypeIncompatibilities[i]); + if (error) + return "shipmentTypeIncompatibilities." + error; + } + } + if (message.shipmentTypeRequirements != null && message.hasOwnProperty("shipmentTypeRequirements")) { + if (!Array.isArray(message.shipmentTypeRequirements)) + return "shipmentTypeRequirements: array expected"; + for (var i = 0; i < message.shipmentTypeRequirements.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.verify(message.shipmentTypeRequirements[i]); + if (error) + return "shipmentTypeRequirements." + error; + } + } + if (message.precedenceRules != null && message.hasOwnProperty("precedenceRules")) { + if (!Array.isArray(message.precedenceRules)) + return "precedenceRules: array expected"; + for (var i = 0; i < message.precedenceRules.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.verify(message.precedenceRules[i]); + if (error) + return "precedenceRules." + error; + } + } + return null; + }; + + /** + * Creates a ShipmentModel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentModel} ShipmentModel + */ + ShipmentModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentModel) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentModel(); + if (object.shipments) { + if (!Array.isArray(object.shipments)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.shipments: array expected"); + message.shipments = []; + for (var i = 0; i < object.shipments.length; ++i) { + if (typeof object.shipments[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.shipments: object expected"); + message.shipments[i] = $root.google.maps.routeoptimization.v1.Shipment.fromObject(object.shipments[i]); + } + } + if (object.vehicles) { + if (!Array.isArray(object.vehicles)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.vehicles: array expected"); + message.vehicles = []; + for (var i = 0; i < object.vehicles.length; ++i) { + if (typeof object.vehicles[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.vehicles: object expected"); + message.vehicles[i] = $root.google.maps.routeoptimization.v1.Vehicle.fromObject(object.vehicles[i]); + } + } + if (object.maxActiveVehicles != null) + message.maxActiveVehicles = object.maxActiveVehicles | 0; + if (object.globalStartTime != null) { + if (typeof object.globalStartTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.globalStartTime: object expected"); + message.globalStartTime = $root.google.protobuf.Timestamp.fromObject(object.globalStartTime); + } + if (object.globalEndTime != null) { + if (typeof object.globalEndTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.globalEndTime: object expected"); + message.globalEndTime = $root.google.protobuf.Timestamp.fromObject(object.globalEndTime); + } + if (object.globalDurationCostPerHour != null) + message.globalDurationCostPerHour = Number(object.globalDurationCostPerHour); + if (object.durationDistanceMatrices) { + if (!Array.isArray(object.durationDistanceMatrices)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.durationDistanceMatrices: array expected"); + message.durationDistanceMatrices = []; + for (var i = 0; i < object.durationDistanceMatrices.length; ++i) { + if (typeof object.durationDistanceMatrices[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.durationDistanceMatrices: object expected"); + message.durationDistanceMatrices[i] = $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.fromObject(object.durationDistanceMatrices[i]); + } + } + if (object.durationDistanceMatrixSrcTags) { + if (!Array.isArray(object.durationDistanceMatrixSrcTags)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.durationDistanceMatrixSrcTags: array expected"); + message.durationDistanceMatrixSrcTags = []; + for (var i = 0; i < object.durationDistanceMatrixSrcTags.length; ++i) + message.durationDistanceMatrixSrcTags[i] = String(object.durationDistanceMatrixSrcTags[i]); + } + if (object.durationDistanceMatrixDstTags) { + if (!Array.isArray(object.durationDistanceMatrixDstTags)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.durationDistanceMatrixDstTags: array expected"); + message.durationDistanceMatrixDstTags = []; + for (var i = 0; i < object.durationDistanceMatrixDstTags.length; ++i) + message.durationDistanceMatrixDstTags[i] = String(object.durationDistanceMatrixDstTags[i]); + } + if (object.transitionAttributes) { + if (!Array.isArray(object.transitionAttributes)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.transitionAttributes: array expected"); + message.transitionAttributes = []; + for (var i = 0; i < object.transitionAttributes.length; ++i) { + if (typeof object.transitionAttributes[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.transitionAttributes: object expected"); + message.transitionAttributes[i] = $root.google.maps.routeoptimization.v1.TransitionAttributes.fromObject(object.transitionAttributes[i]); + } + } + if (object.shipmentTypeIncompatibilities) { + if (!Array.isArray(object.shipmentTypeIncompatibilities)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.shipmentTypeIncompatibilities: array expected"); + message.shipmentTypeIncompatibilities = []; + for (var i = 0; i < object.shipmentTypeIncompatibilities.length; ++i) { + if (typeof object.shipmentTypeIncompatibilities[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.shipmentTypeIncompatibilities: object expected"); + message.shipmentTypeIncompatibilities[i] = $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.fromObject(object.shipmentTypeIncompatibilities[i]); + } + } + if (object.shipmentTypeRequirements) { + if (!Array.isArray(object.shipmentTypeRequirements)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.shipmentTypeRequirements: array expected"); + message.shipmentTypeRequirements = []; + for (var i = 0; i < object.shipmentTypeRequirements.length; ++i) { + if (typeof object.shipmentTypeRequirements[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.shipmentTypeRequirements: object expected"); + message.shipmentTypeRequirements[i] = $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.fromObject(object.shipmentTypeRequirements[i]); + } + } + if (object.precedenceRules) { + if (!Array.isArray(object.precedenceRules)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.precedenceRules: array expected"); + message.precedenceRules = []; + for (var i = 0; i < object.precedenceRules.length; ++i) { + if (typeof object.precedenceRules[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.precedenceRules: object expected"); + message.precedenceRules[i] = $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.fromObject(object.precedenceRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ShipmentModel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel} message ShipmentModel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShipmentModel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.shipments = []; + object.vehicles = []; + object.durationDistanceMatrices = []; + object.durationDistanceMatrixSrcTags = []; + object.durationDistanceMatrixDstTags = []; + object.transitionAttributes = []; + object.shipmentTypeIncompatibilities = []; + object.shipmentTypeRequirements = []; + object.precedenceRules = []; + } + if (options.defaults) { + object.globalStartTime = null; + object.globalEndTime = null; + object.globalDurationCostPerHour = 0; + } + if (message.shipments && message.shipments.length) { + object.shipments = []; + for (var j = 0; j < message.shipments.length; ++j) + object.shipments[j] = $root.google.maps.routeoptimization.v1.Shipment.toObject(message.shipments[j], options); + } + if (message.vehicles && message.vehicles.length) { + object.vehicles = []; + for (var j = 0; j < message.vehicles.length; ++j) + object.vehicles[j] = $root.google.maps.routeoptimization.v1.Vehicle.toObject(message.vehicles[j], options); + } + if (message.maxActiveVehicles != null && message.hasOwnProperty("maxActiveVehicles")) { + object.maxActiveVehicles = message.maxActiveVehicles; + if (options.oneofs) + object._maxActiveVehicles = "maxActiveVehicles"; + } + if (message.globalStartTime != null && message.hasOwnProperty("globalStartTime")) + object.globalStartTime = $root.google.protobuf.Timestamp.toObject(message.globalStartTime, options); + if (message.globalEndTime != null && message.hasOwnProperty("globalEndTime")) + object.globalEndTime = $root.google.protobuf.Timestamp.toObject(message.globalEndTime, options); + if (message.globalDurationCostPerHour != null && message.hasOwnProperty("globalDurationCostPerHour")) + object.globalDurationCostPerHour = options.json && !isFinite(message.globalDurationCostPerHour) ? String(message.globalDurationCostPerHour) : message.globalDurationCostPerHour; + if (message.durationDistanceMatrices && message.durationDistanceMatrices.length) { + object.durationDistanceMatrices = []; + for (var j = 0; j < message.durationDistanceMatrices.length; ++j) + object.durationDistanceMatrices[j] = $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.toObject(message.durationDistanceMatrices[j], options); + } + if (message.durationDistanceMatrixSrcTags && message.durationDistanceMatrixSrcTags.length) { + object.durationDistanceMatrixSrcTags = []; + for (var j = 0; j < message.durationDistanceMatrixSrcTags.length; ++j) + object.durationDistanceMatrixSrcTags[j] = message.durationDistanceMatrixSrcTags[j]; + } + if (message.durationDistanceMatrixDstTags && message.durationDistanceMatrixDstTags.length) { + object.durationDistanceMatrixDstTags = []; + for (var j = 0; j < message.durationDistanceMatrixDstTags.length; ++j) + object.durationDistanceMatrixDstTags[j] = message.durationDistanceMatrixDstTags[j]; + } + if (message.transitionAttributes && message.transitionAttributes.length) { + object.transitionAttributes = []; + for (var j = 0; j < message.transitionAttributes.length; ++j) + object.transitionAttributes[j] = $root.google.maps.routeoptimization.v1.TransitionAttributes.toObject(message.transitionAttributes[j], options); + } + if (message.shipmentTypeIncompatibilities && message.shipmentTypeIncompatibilities.length) { + object.shipmentTypeIncompatibilities = []; + for (var j = 0; j < message.shipmentTypeIncompatibilities.length; ++j) + object.shipmentTypeIncompatibilities[j] = $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.toObject(message.shipmentTypeIncompatibilities[j], options); + } + if (message.shipmentTypeRequirements && message.shipmentTypeRequirements.length) { + object.shipmentTypeRequirements = []; + for (var j = 0; j < message.shipmentTypeRequirements.length; ++j) + object.shipmentTypeRequirements[j] = $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.toObject(message.shipmentTypeRequirements[j], options); + } + if (message.precedenceRules && message.precedenceRules.length) { + object.precedenceRules = []; + for (var j = 0; j < message.precedenceRules.length; ++j) + object.precedenceRules[j] = $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.toObject(message.precedenceRules[j], options); + } + return object; + }; + + /** + * Converts this ShipmentModel to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @instance + * @returns {Object.} JSON object + */ + ShipmentModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShipmentModel + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShipmentModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentModel"; + }; + + ShipmentModel.DurationDistanceMatrix = (function() { + + /** + * Properties of a DurationDistanceMatrix. + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @interface IDurationDistanceMatrix + * @property {Array.|null} [rows] DurationDistanceMatrix rows + * @property {string|null} [vehicleStartTag] DurationDistanceMatrix vehicleStartTag + */ + + /** + * Constructs a new DurationDistanceMatrix. + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @classdesc Represents a DurationDistanceMatrix. + * @implements IDurationDistanceMatrix + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix=} [properties] Properties to set + */ + function DurationDistanceMatrix(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DurationDistanceMatrix rows. + * @member {Array.} rows + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @instance + */ + DurationDistanceMatrix.prototype.rows = $util.emptyArray; + + /** + * DurationDistanceMatrix vehicleStartTag. + * @member {string} vehicleStartTag + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @instance + */ + DurationDistanceMatrix.prototype.vehicleStartTag = ""; + + /** + * Creates a new DurationDistanceMatrix instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} DurationDistanceMatrix instance + */ + DurationDistanceMatrix.create = function create(properties) { + return new DurationDistanceMatrix(properties); + }; + + /** + * Encodes the specified DurationDistanceMatrix message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix} message DurationDistanceMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DurationDistanceMatrix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.encode(message.rows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vehicleStartTag != null && Object.hasOwnProperty.call(message, "vehicleStartTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vehicleStartTag); + return writer; + }; + + /** + * Encodes the specified DurationDistanceMatrix message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.IDurationDistanceMatrix} message DurationDistanceMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DurationDistanceMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DurationDistanceMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} DurationDistanceMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DurationDistanceMatrix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.decode(reader, reader.uint32())); + break; + } + case 2: { + message.vehicleStartTag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DurationDistanceMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} DurationDistanceMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DurationDistanceMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DurationDistanceMatrix message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DurationDistanceMatrix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.vehicleStartTag != null && message.hasOwnProperty("vehicleStartTag")) + if (!$util.isString(message.vehicleStartTag)) + return "vehicleStartTag: string expected"; + return null; + }; + + /** + * Creates a DurationDistanceMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} DurationDistanceMatrix + */ + DurationDistanceMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix(); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.rows: object expected"); + message.rows[i] = $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.fromObject(object.rows[i]); + } + } + if (object.vehicleStartTag != null) + message.vehicleStartTag = String(object.vehicleStartTag); + return message; + }; + + /** + * Creates a plain object from a DurationDistanceMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix} message DurationDistanceMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DurationDistanceMatrix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) + object.vehicleStartTag = ""; + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.toObject(message.rows[j], options); + } + if (message.vehicleStartTag != null && message.hasOwnProperty("vehicleStartTag")) + object.vehicleStartTag = message.vehicleStartTag; + return object; + }; + + /** + * Converts this DurationDistanceMatrix to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @instance + * @returns {Object.} JSON object + */ + DurationDistanceMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DurationDistanceMatrix + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DurationDistanceMatrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix"; + }; + + DurationDistanceMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @interface IRow + * @property {Array.|null} [durations] Row durations + * @property {Array.|null} [meters] Row meters + */ + + /** + * Constructs a new Row. + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.durations = []; + this.meters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row durations. + * @member {Array.} durations + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @instance + */ + Row.prototype.durations = $util.emptyArray; + + /** + * Row meters. + * @member {Array.} meters + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @instance + */ + Row.prototype.meters = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.durations != null && message.durations.length) + for (var i = 0; i < message.durations.length; ++i) + $root.google.protobuf.Duration.encode(message.durations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.meters != null && message.meters.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.meters.length; ++i) + writer.double(message.meters[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.durations && message.durations.length)) + message.durations = []; + message.durations.push($root.google.protobuf.Duration.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.meters && message.meters.length)) + message.meters = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.meters.push(reader.double()); + } else + message.meters.push(reader.double()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.durations != null && message.hasOwnProperty("durations")) { + if (!Array.isArray(message.durations)) + return "durations: array expected"; + for (var i = 0; i < message.durations.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.durations[i]); + if (error) + return "durations." + error; + } + } + if (message.meters != null && message.hasOwnProperty("meters")) { + if (!Array.isArray(message.meters)) + return "meters: array expected"; + for (var i = 0; i < message.meters.length; ++i) + if (typeof message.meters[i] !== "number") + return "meters: number[] expected"; + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row(); + if (object.durations) { + if (!Array.isArray(object.durations)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.durations: array expected"); + message.durations = []; + for (var i = 0; i < object.durations.length; ++i) { + if (typeof object.durations[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.durations: object expected"); + message.durations[i] = $root.google.protobuf.Duration.fromObject(object.durations[i]); + } + } + if (object.meters) { + if (!Array.isArray(object.meters)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row.meters: array expected"); + message.meters = []; + for (var i = 0; i < object.meters.length; ++i) + message.meters[i] = Number(object.meters[i]); + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.durations = []; + object.meters = []; + } + if (message.durations && message.durations.length) { + object.durations = []; + for (var j = 0; j < message.durations.length; ++j) + object.durations[j] = $root.google.protobuf.Duration.toObject(message.durations[j], options); + } + if (message.meters && message.meters.length) { + object.meters = []; + for (var j = 0; j < message.meters.length; ++j) + object.meters[j] = options.json && !isFinite(message.meters[j]) ? String(message.meters[j]) : message.meters[j]; + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row"; + }; + + return Row; + })(); + + return DurationDistanceMatrix; + })(); + + ShipmentModel.PrecedenceRule = (function() { + + /** + * Properties of a PrecedenceRule. + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @interface IPrecedenceRule + * @property {number|null} [firstIndex] PrecedenceRule firstIndex + * @property {boolean|null} [firstIsDelivery] PrecedenceRule firstIsDelivery + * @property {number|null} [secondIndex] PrecedenceRule secondIndex + * @property {boolean|null} [secondIsDelivery] PrecedenceRule secondIsDelivery + * @property {google.protobuf.IDuration|null} [offsetDuration] PrecedenceRule offsetDuration + */ + + /** + * Constructs a new PrecedenceRule. + * @memberof google.maps.routeoptimization.v1.ShipmentModel + * @classdesc Represents a PrecedenceRule. + * @implements IPrecedenceRule + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule=} [properties] Properties to set + */ + function PrecedenceRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrecedenceRule firstIndex. + * @member {number|null|undefined} firstIndex + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + PrecedenceRule.prototype.firstIndex = null; + + /** + * PrecedenceRule firstIsDelivery. + * @member {boolean} firstIsDelivery + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + PrecedenceRule.prototype.firstIsDelivery = false; + + /** + * PrecedenceRule secondIndex. + * @member {number|null|undefined} secondIndex + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + PrecedenceRule.prototype.secondIndex = null; + + /** + * PrecedenceRule secondIsDelivery. + * @member {boolean} secondIsDelivery + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + PrecedenceRule.prototype.secondIsDelivery = false; + + /** + * PrecedenceRule offsetDuration. + * @member {google.protobuf.IDuration|null|undefined} offsetDuration + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + PrecedenceRule.prototype.offsetDuration = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrecedenceRule _firstIndex. + * @member {"firstIndex"|undefined} _firstIndex + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + Object.defineProperty(PrecedenceRule.prototype, "_firstIndex", { + get: $util.oneOfGetter($oneOfFields = ["firstIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PrecedenceRule _secondIndex. + * @member {"secondIndex"|undefined} _secondIndex + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + */ + Object.defineProperty(PrecedenceRule.prototype, "_secondIndex", { + get: $util.oneOfGetter($oneOfFields = ["secondIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrecedenceRule instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} PrecedenceRule instance + */ + PrecedenceRule.create = function create(properties) { + return new PrecedenceRule(properties); + }; + + /** + * Encodes the specified PrecedenceRule message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule} message PrecedenceRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrecedenceRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstIndex != null && Object.hasOwnProperty.call(message, "firstIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.firstIndex); + if (message.secondIndex != null && Object.hasOwnProperty.call(message, "secondIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.secondIndex); + if (message.firstIsDelivery != null && Object.hasOwnProperty.call(message, "firstIsDelivery")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.firstIsDelivery); + if (message.secondIsDelivery != null && Object.hasOwnProperty.call(message, "secondIsDelivery")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.secondIsDelivery); + if (message.offsetDuration != null && Object.hasOwnProperty.call(message, "offsetDuration")) + $root.google.protobuf.Duration.encode(message.offsetDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrecedenceRule message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.IPrecedenceRule} message PrecedenceRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrecedenceRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrecedenceRule message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} PrecedenceRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrecedenceRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.firstIndex = reader.int32(); + break; + } + case 3: { + message.firstIsDelivery = reader.bool(); + break; + } + case 2: { + message.secondIndex = reader.int32(); + break; + } + case 4: { + message.secondIsDelivery = reader.bool(); + break; + } + case 5: { + message.offsetDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrecedenceRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} PrecedenceRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrecedenceRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrecedenceRule message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrecedenceRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firstIndex != null && message.hasOwnProperty("firstIndex")) { + properties._firstIndex = 1; + if (!$util.isInteger(message.firstIndex)) + return "firstIndex: integer expected"; + } + if (message.firstIsDelivery != null && message.hasOwnProperty("firstIsDelivery")) + if (typeof message.firstIsDelivery !== "boolean") + return "firstIsDelivery: boolean expected"; + if (message.secondIndex != null && message.hasOwnProperty("secondIndex")) { + properties._secondIndex = 1; + if (!$util.isInteger(message.secondIndex)) + return "secondIndex: integer expected"; + } + if (message.secondIsDelivery != null && message.hasOwnProperty("secondIsDelivery")) + if (typeof message.secondIsDelivery !== "boolean") + return "secondIsDelivery: boolean expected"; + if (message.offsetDuration != null && message.hasOwnProperty("offsetDuration")) { + var error = $root.google.protobuf.Duration.verify(message.offsetDuration); + if (error) + return "offsetDuration." + error; + } + return null; + }; + + /** + * Creates a PrecedenceRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} PrecedenceRule + */ + PrecedenceRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule(); + if (object.firstIndex != null) + message.firstIndex = object.firstIndex | 0; + if (object.firstIsDelivery != null) + message.firstIsDelivery = Boolean(object.firstIsDelivery); + if (object.secondIndex != null) + message.secondIndex = object.secondIndex | 0; + if (object.secondIsDelivery != null) + message.secondIsDelivery = Boolean(object.secondIsDelivery); + if (object.offsetDuration != null) { + if (typeof object.offsetDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule.offsetDuration: object expected"); + message.offsetDuration = $root.google.protobuf.Duration.fromObject(object.offsetDuration); + } + return message; + }; + + /** + * Creates a plain object from a PrecedenceRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule} message PrecedenceRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrecedenceRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstIsDelivery = false; + object.secondIsDelivery = false; + object.offsetDuration = null; + } + if (message.firstIndex != null && message.hasOwnProperty("firstIndex")) { + object.firstIndex = message.firstIndex; + if (options.oneofs) + object._firstIndex = "firstIndex"; + } + if (message.secondIndex != null && message.hasOwnProperty("secondIndex")) { + object.secondIndex = message.secondIndex; + if (options.oneofs) + object._secondIndex = "secondIndex"; + } + if (message.firstIsDelivery != null && message.hasOwnProperty("firstIsDelivery")) + object.firstIsDelivery = message.firstIsDelivery; + if (message.secondIsDelivery != null && message.hasOwnProperty("secondIsDelivery")) + object.secondIsDelivery = message.secondIsDelivery; + if (message.offsetDuration != null && message.hasOwnProperty("offsetDuration")) + object.offsetDuration = $root.google.protobuf.Duration.toObject(message.offsetDuration, options); + return object; + }; + + /** + * Converts this PrecedenceRule to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @instance + * @returns {Object.} JSON object + */ + PrecedenceRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrecedenceRule + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrecedenceRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule"; + }; + + return PrecedenceRule; + })(); + + return ShipmentModel; + })(); + + v1.Shipment = (function() { + + /** + * Properties of a Shipment. + * @memberof google.maps.routeoptimization.v1 + * @interface IShipment + * @property {string|null} [displayName] Shipment displayName + * @property {Array.|null} [pickups] Shipment pickups + * @property {Array.|null} [deliveries] Shipment deliveries + * @property {Object.|null} [loadDemands] Shipment loadDemands + * @property {number|null} [penaltyCost] Shipment penaltyCost + * @property {Array.|null} [allowedVehicleIndices] Shipment allowedVehicleIndices + * @property {Array.|null} [costsPerVehicle] Shipment costsPerVehicle + * @property {Array.|null} [costsPerVehicleIndices] Shipment costsPerVehicleIndices + * @property {number|null} [pickupToDeliveryRelativeDetourLimit] Shipment pickupToDeliveryRelativeDetourLimit + * @property {google.protobuf.IDuration|null} [pickupToDeliveryAbsoluteDetourLimit] Shipment pickupToDeliveryAbsoluteDetourLimit + * @property {google.protobuf.IDuration|null} [pickupToDeliveryTimeLimit] Shipment pickupToDeliveryTimeLimit + * @property {string|null} [shipmentType] Shipment shipmentType + * @property {string|null} [label] Shipment label + * @property {boolean|null} [ignore] Shipment ignore + */ + + /** + * Constructs a new Shipment. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a Shipment. + * @implements IShipment + * @constructor + * @param {google.maps.routeoptimization.v1.IShipment=} [properties] Properties to set + */ + function Shipment(properties) { + this.pickups = []; + this.deliveries = []; + this.loadDemands = {}; + this.allowedVehicleIndices = []; + this.costsPerVehicle = []; + this.costsPerVehicleIndices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Shipment displayName. + * @member {string} displayName + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.displayName = ""; + + /** + * Shipment pickups. + * @member {Array.} pickups + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.pickups = $util.emptyArray; + + /** + * Shipment deliveries. + * @member {Array.} deliveries + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.deliveries = $util.emptyArray; + + /** + * Shipment loadDemands. + * @member {Object.} loadDemands + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.loadDemands = $util.emptyObject; + + /** + * Shipment penaltyCost. + * @member {number|null|undefined} penaltyCost + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.penaltyCost = null; + + /** + * Shipment allowedVehicleIndices. + * @member {Array.} allowedVehicleIndices + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.allowedVehicleIndices = $util.emptyArray; + + /** + * Shipment costsPerVehicle. + * @member {Array.} costsPerVehicle + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.costsPerVehicle = $util.emptyArray; + + /** + * Shipment costsPerVehicleIndices. + * @member {Array.} costsPerVehicleIndices + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.costsPerVehicleIndices = $util.emptyArray; + + /** + * Shipment pickupToDeliveryRelativeDetourLimit. + * @member {number|null|undefined} pickupToDeliveryRelativeDetourLimit + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.pickupToDeliveryRelativeDetourLimit = null; + + /** + * Shipment pickupToDeliveryAbsoluteDetourLimit. + * @member {google.protobuf.IDuration|null|undefined} pickupToDeliveryAbsoluteDetourLimit + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.pickupToDeliveryAbsoluteDetourLimit = null; + + /** + * Shipment pickupToDeliveryTimeLimit. + * @member {google.protobuf.IDuration|null|undefined} pickupToDeliveryTimeLimit + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.pickupToDeliveryTimeLimit = null; + + /** + * Shipment shipmentType. + * @member {string} shipmentType + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.shipmentType = ""; + + /** + * Shipment label. + * @member {string} label + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.label = ""; + + /** + * Shipment ignore. + * @member {boolean} ignore + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Shipment.prototype.ignore = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Shipment _penaltyCost. + * @member {"penaltyCost"|undefined} _penaltyCost + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Object.defineProperty(Shipment.prototype, "_penaltyCost", { + get: $util.oneOfGetter($oneOfFields = ["penaltyCost"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Shipment _pickupToDeliveryRelativeDetourLimit. + * @member {"pickupToDeliveryRelativeDetourLimit"|undefined} _pickupToDeliveryRelativeDetourLimit + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + */ + Object.defineProperty(Shipment.prototype, "_pickupToDeliveryRelativeDetourLimit", { + get: $util.oneOfGetter($oneOfFields = ["pickupToDeliveryRelativeDetourLimit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Shipment instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {google.maps.routeoptimization.v1.IShipment=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Shipment} Shipment instance + */ + Shipment.create = function create(properties) { + return new Shipment(properties); + }; + + /** + * Encodes the specified Shipment message. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {google.maps.routeoptimization.v1.IShipment} message Shipment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Shipment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pickups != null && message.pickups.length) + for (var i = 0; i < message.pickups.length; ++i) + $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.encode(message.pickups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deliveries != null && message.deliveries.length) + for (var i = 0; i < message.deliveries.length; ++i) + $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.encode(message.deliveries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.penaltyCost != null && Object.hasOwnProperty.call(message, "penaltyCost")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.penaltyCost); + if (message.allowedVehicleIndices != null && message.allowedVehicleIndices.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.allowedVehicleIndices.length; ++i) + writer.int32(message.allowedVehicleIndices[i]); + writer.ldelim(); + } + if (message.costsPerVehicle != null && message.costsPerVehicle.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.costsPerVehicle.length; ++i) + writer.double(message.costsPerVehicle[i]); + writer.ldelim(); + } + if (message.costsPerVehicleIndices != null && message.costsPerVehicleIndices.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.costsPerVehicleIndices.length; ++i) + writer.int32(message.costsPerVehicleIndices[i]); + writer.ldelim(); + } + if (message.pickupToDeliveryRelativeDetourLimit != null && Object.hasOwnProperty.call(message, "pickupToDeliveryRelativeDetourLimit")) + writer.uint32(/* id 8, wireType 1 =*/65).double(message.pickupToDeliveryRelativeDetourLimit); + if (message.pickupToDeliveryAbsoluteDetourLimit != null && Object.hasOwnProperty.call(message, "pickupToDeliveryAbsoluteDetourLimit")) + $root.google.protobuf.Duration.encode(message.pickupToDeliveryAbsoluteDetourLimit, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.pickupToDeliveryTimeLimit != null && Object.hasOwnProperty.call(message, "pickupToDeliveryTimeLimit")) + $root.google.protobuf.Duration.encode(message.pickupToDeliveryTimeLimit, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.shipmentType != null && Object.hasOwnProperty.call(message, "shipmentType")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.shipmentType); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.label); + if (message.ignore != null && Object.hasOwnProperty.call(message, "ignore")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.ignore); + if (message.loadDemands != null && Object.hasOwnProperty.call(message, "loadDemands")) + for (var keys = Object.keys(message.loadDemands), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.maps.routeoptimization.v1.Shipment.Load.encode(message.loadDemands[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Shipment message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {google.maps.routeoptimization.v1.IShipment} message Shipment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Shipment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Shipment message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Shipment} Shipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Shipment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Shipment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 16: { + message.displayName = reader.string(); + break; + } + case 1: { + if (!(message.pickups && message.pickups.length)) + message.pickups = []; + message.pickups.push($root.google.maps.routeoptimization.v1.Shipment.VisitRequest.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.deliveries && message.deliveries.length)) + message.deliveries = []; + message.deliveries.push($root.google.maps.routeoptimization.v1.Shipment.VisitRequest.decode(reader, reader.uint32())); + break; + } + case 14: { + if (message.loadDemands === $util.emptyObject) + message.loadDemands = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.maps.routeoptimization.v1.Shipment.Load.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.loadDemands[key] = value; + break; + } + case 4: { + message.penaltyCost = reader.double(); + break; + } + case 5: { + if (!(message.allowedVehicleIndices && message.allowedVehicleIndices.length)) + message.allowedVehicleIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedVehicleIndices.push(reader.int32()); + } else + message.allowedVehicleIndices.push(reader.int32()); + break; + } + case 6: { + if (!(message.costsPerVehicle && message.costsPerVehicle.length)) + message.costsPerVehicle = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.costsPerVehicle.push(reader.double()); + } else + message.costsPerVehicle.push(reader.double()); + break; + } + case 7: { + if (!(message.costsPerVehicleIndices && message.costsPerVehicleIndices.length)) + message.costsPerVehicleIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.costsPerVehicleIndices.push(reader.int32()); + } else + message.costsPerVehicleIndices.push(reader.int32()); + break; + } + case 8: { + message.pickupToDeliveryRelativeDetourLimit = reader.double(); + break; + } + case 9: { + message.pickupToDeliveryAbsoluteDetourLimit = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 10: { + message.pickupToDeliveryTimeLimit = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 11: { + message.shipmentType = reader.string(); + break; + } + case 12: { + message.label = reader.string(); + break; + } + case 13: { + message.ignore = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Shipment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Shipment} Shipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Shipment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Shipment message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Shipment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.pickups != null && message.hasOwnProperty("pickups")) { + if (!Array.isArray(message.pickups)) + return "pickups: array expected"; + for (var i = 0; i < message.pickups.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.verify(message.pickups[i]); + if (error) + return "pickups." + error; + } + } + if (message.deliveries != null && message.hasOwnProperty("deliveries")) { + if (!Array.isArray(message.deliveries)) + return "deliveries: array expected"; + for (var i = 0; i < message.deliveries.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.verify(message.deliveries[i]); + if (error) + return "deliveries." + error; + } + } + if (message.loadDemands != null && message.hasOwnProperty("loadDemands")) { + if (!$util.isObject(message.loadDemands)) + return "loadDemands: object expected"; + var key = Object.keys(message.loadDemands); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Shipment.Load.verify(message.loadDemands[key[i]]); + if (error) + return "loadDemands." + error; + } + } + if (message.penaltyCost != null && message.hasOwnProperty("penaltyCost")) { + properties._penaltyCost = 1; + if (typeof message.penaltyCost !== "number") + return "penaltyCost: number expected"; + } + if (message.allowedVehicleIndices != null && message.hasOwnProperty("allowedVehicleIndices")) { + if (!Array.isArray(message.allowedVehicleIndices)) + return "allowedVehicleIndices: array expected"; + for (var i = 0; i < message.allowedVehicleIndices.length; ++i) + if (!$util.isInteger(message.allowedVehicleIndices[i])) + return "allowedVehicleIndices: integer[] expected"; + } + if (message.costsPerVehicle != null && message.hasOwnProperty("costsPerVehicle")) { + if (!Array.isArray(message.costsPerVehicle)) + return "costsPerVehicle: array expected"; + for (var i = 0; i < message.costsPerVehicle.length; ++i) + if (typeof message.costsPerVehicle[i] !== "number") + return "costsPerVehicle: number[] expected"; + } + if (message.costsPerVehicleIndices != null && message.hasOwnProperty("costsPerVehicleIndices")) { + if (!Array.isArray(message.costsPerVehicleIndices)) + return "costsPerVehicleIndices: array expected"; + for (var i = 0; i < message.costsPerVehicleIndices.length; ++i) + if (!$util.isInteger(message.costsPerVehicleIndices[i])) + return "costsPerVehicleIndices: integer[] expected"; + } + if (message.pickupToDeliveryRelativeDetourLimit != null && message.hasOwnProperty("pickupToDeliveryRelativeDetourLimit")) { + properties._pickupToDeliveryRelativeDetourLimit = 1; + if (typeof message.pickupToDeliveryRelativeDetourLimit !== "number") + return "pickupToDeliveryRelativeDetourLimit: number expected"; + } + if (message.pickupToDeliveryAbsoluteDetourLimit != null && message.hasOwnProperty("pickupToDeliveryAbsoluteDetourLimit")) { + var error = $root.google.protobuf.Duration.verify(message.pickupToDeliveryAbsoluteDetourLimit); + if (error) + return "pickupToDeliveryAbsoluteDetourLimit." + error; + } + if (message.pickupToDeliveryTimeLimit != null && message.hasOwnProperty("pickupToDeliveryTimeLimit")) { + var error = $root.google.protobuf.Duration.verify(message.pickupToDeliveryTimeLimit); + if (error) + return "pickupToDeliveryTimeLimit." + error; + } + if (message.shipmentType != null && message.hasOwnProperty("shipmentType")) + if (!$util.isString(message.shipmentType)) + return "shipmentType: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.ignore != null && message.hasOwnProperty("ignore")) + if (typeof message.ignore !== "boolean") + return "ignore: boolean expected"; + return null; + }; + + /** + * Creates a Shipment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Shipment} Shipment + */ + Shipment.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Shipment) + return object; + var message = new $root.google.maps.routeoptimization.v1.Shipment(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.pickups) { + if (!Array.isArray(object.pickups)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.pickups: array expected"); + message.pickups = []; + for (var i = 0; i < object.pickups.length; ++i) { + if (typeof object.pickups[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.pickups: object expected"); + message.pickups[i] = $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.fromObject(object.pickups[i]); + } + } + if (object.deliveries) { + if (!Array.isArray(object.deliveries)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.deliveries: array expected"); + message.deliveries = []; + for (var i = 0; i < object.deliveries.length; ++i) { + if (typeof object.deliveries[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.deliveries: object expected"); + message.deliveries[i] = $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.fromObject(object.deliveries[i]); + } + } + if (object.loadDemands) { + if (typeof object.loadDemands !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.loadDemands: object expected"); + message.loadDemands = {}; + for (var keys = Object.keys(object.loadDemands), i = 0; i < keys.length; ++i) { + if (typeof object.loadDemands[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.loadDemands: object expected"); + message.loadDemands[keys[i]] = $root.google.maps.routeoptimization.v1.Shipment.Load.fromObject(object.loadDemands[keys[i]]); + } + } + if (object.penaltyCost != null) + message.penaltyCost = Number(object.penaltyCost); + if (object.allowedVehicleIndices) { + if (!Array.isArray(object.allowedVehicleIndices)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.allowedVehicleIndices: array expected"); + message.allowedVehicleIndices = []; + for (var i = 0; i < object.allowedVehicleIndices.length; ++i) + message.allowedVehicleIndices[i] = object.allowedVehicleIndices[i] | 0; + } + if (object.costsPerVehicle) { + if (!Array.isArray(object.costsPerVehicle)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.costsPerVehicle: array expected"); + message.costsPerVehicle = []; + for (var i = 0; i < object.costsPerVehicle.length; ++i) + message.costsPerVehicle[i] = Number(object.costsPerVehicle[i]); + } + if (object.costsPerVehicleIndices) { + if (!Array.isArray(object.costsPerVehicleIndices)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.costsPerVehicleIndices: array expected"); + message.costsPerVehicleIndices = []; + for (var i = 0; i < object.costsPerVehicleIndices.length; ++i) + message.costsPerVehicleIndices[i] = object.costsPerVehicleIndices[i] | 0; + } + if (object.pickupToDeliveryRelativeDetourLimit != null) + message.pickupToDeliveryRelativeDetourLimit = Number(object.pickupToDeliveryRelativeDetourLimit); + if (object.pickupToDeliveryAbsoluteDetourLimit != null) { + if (typeof object.pickupToDeliveryAbsoluteDetourLimit !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.pickupToDeliveryAbsoluteDetourLimit: object expected"); + message.pickupToDeliveryAbsoluteDetourLimit = $root.google.protobuf.Duration.fromObject(object.pickupToDeliveryAbsoluteDetourLimit); + } + if (object.pickupToDeliveryTimeLimit != null) { + if (typeof object.pickupToDeliveryTimeLimit !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.pickupToDeliveryTimeLimit: object expected"); + message.pickupToDeliveryTimeLimit = $root.google.protobuf.Duration.fromObject(object.pickupToDeliveryTimeLimit); + } + if (object.shipmentType != null) + message.shipmentType = String(object.shipmentType); + if (object.label != null) + message.label = String(object.label); + if (object.ignore != null) + message.ignore = Boolean(object.ignore); + return message; + }; + + /** + * Creates a plain object from a Shipment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {google.maps.routeoptimization.v1.Shipment} message Shipment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Shipment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pickups = []; + object.deliveries = []; + object.allowedVehicleIndices = []; + object.costsPerVehicle = []; + object.costsPerVehicleIndices = []; + } + if (options.objects || options.defaults) + object.loadDemands = {}; + if (options.defaults) { + object.pickupToDeliveryAbsoluteDetourLimit = null; + object.pickupToDeliveryTimeLimit = null; + object.shipmentType = ""; + object.label = ""; + object.ignore = false; + object.displayName = ""; + } + if (message.pickups && message.pickups.length) { + object.pickups = []; + for (var j = 0; j < message.pickups.length; ++j) + object.pickups[j] = $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.toObject(message.pickups[j], options); + } + if (message.deliveries && message.deliveries.length) { + object.deliveries = []; + for (var j = 0; j < message.deliveries.length; ++j) + object.deliveries[j] = $root.google.maps.routeoptimization.v1.Shipment.VisitRequest.toObject(message.deliveries[j], options); + } + if (message.penaltyCost != null && message.hasOwnProperty("penaltyCost")) { + object.penaltyCost = options.json && !isFinite(message.penaltyCost) ? String(message.penaltyCost) : message.penaltyCost; + if (options.oneofs) + object._penaltyCost = "penaltyCost"; + } + if (message.allowedVehicleIndices && message.allowedVehicleIndices.length) { + object.allowedVehicleIndices = []; + for (var j = 0; j < message.allowedVehicleIndices.length; ++j) + object.allowedVehicleIndices[j] = message.allowedVehicleIndices[j]; + } + if (message.costsPerVehicle && message.costsPerVehicle.length) { + object.costsPerVehicle = []; + for (var j = 0; j < message.costsPerVehicle.length; ++j) + object.costsPerVehicle[j] = options.json && !isFinite(message.costsPerVehicle[j]) ? String(message.costsPerVehicle[j]) : message.costsPerVehicle[j]; + } + if (message.costsPerVehicleIndices && message.costsPerVehicleIndices.length) { + object.costsPerVehicleIndices = []; + for (var j = 0; j < message.costsPerVehicleIndices.length; ++j) + object.costsPerVehicleIndices[j] = message.costsPerVehicleIndices[j]; + } + if (message.pickupToDeliveryRelativeDetourLimit != null && message.hasOwnProperty("pickupToDeliveryRelativeDetourLimit")) { + object.pickupToDeliveryRelativeDetourLimit = options.json && !isFinite(message.pickupToDeliveryRelativeDetourLimit) ? String(message.pickupToDeliveryRelativeDetourLimit) : message.pickupToDeliveryRelativeDetourLimit; + if (options.oneofs) + object._pickupToDeliveryRelativeDetourLimit = "pickupToDeliveryRelativeDetourLimit"; + } + if (message.pickupToDeliveryAbsoluteDetourLimit != null && message.hasOwnProperty("pickupToDeliveryAbsoluteDetourLimit")) + object.pickupToDeliveryAbsoluteDetourLimit = $root.google.protobuf.Duration.toObject(message.pickupToDeliveryAbsoluteDetourLimit, options); + if (message.pickupToDeliveryTimeLimit != null && message.hasOwnProperty("pickupToDeliveryTimeLimit")) + object.pickupToDeliveryTimeLimit = $root.google.protobuf.Duration.toObject(message.pickupToDeliveryTimeLimit, options); + if (message.shipmentType != null && message.hasOwnProperty("shipmentType")) + object.shipmentType = message.shipmentType; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.ignore != null && message.hasOwnProperty("ignore")) + object.ignore = message.ignore; + var keys2; + if (message.loadDemands && (keys2 = Object.keys(message.loadDemands)).length) { + object.loadDemands = {}; + for (var j = 0; j < keys2.length; ++j) + object.loadDemands[keys2[j]] = $root.google.maps.routeoptimization.v1.Shipment.Load.toObject(message.loadDemands[keys2[j]], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Shipment to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Shipment + * @instance + * @returns {Object.} JSON object + */ + Shipment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Shipment + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Shipment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Shipment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Shipment"; + }; + + Shipment.VisitRequest = (function() { + + /** + * Properties of a VisitRequest. + * @memberof google.maps.routeoptimization.v1.Shipment + * @interface IVisitRequest + * @property {google.type.ILatLng|null} [arrivalLocation] VisitRequest arrivalLocation + * @property {google.maps.routeoptimization.v1.IWaypoint|null} [arrivalWaypoint] VisitRequest arrivalWaypoint + * @property {google.type.ILatLng|null} [departureLocation] VisitRequest departureLocation + * @property {google.maps.routeoptimization.v1.IWaypoint|null} [departureWaypoint] VisitRequest departureWaypoint + * @property {Array.|null} [tags] VisitRequest tags + * @property {Array.|null} [timeWindows] VisitRequest timeWindows + * @property {google.protobuf.IDuration|null} [duration] VisitRequest duration + * @property {number|null} [cost] VisitRequest cost + * @property {Object.|null} [loadDemands] VisitRequest loadDemands + * @property {Array.|null} [visitTypes] VisitRequest visitTypes + * @property {string|null} [label] VisitRequest label + */ + + /** + * Constructs a new VisitRequest. + * @memberof google.maps.routeoptimization.v1.Shipment + * @classdesc Represents a VisitRequest. + * @implements IVisitRequest + * @constructor + * @param {google.maps.routeoptimization.v1.Shipment.IVisitRequest=} [properties] Properties to set + */ + function VisitRequest(properties) { + this.tags = []; + this.timeWindows = []; + this.loadDemands = {}; + this.visitTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VisitRequest arrivalLocation. + * @member {google.type.ILatLng|null|undefined} arrivalLocation + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.arrivalLocation = null; + + /** + * VisitRequest arrivalWaypoint. + * @member {google.maps.routeoptimization.v1.IWaypoint|null|undefined} arrivalWaypoint + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.arrivalWaypoint = null; + + /** + * VisitRequest departureLocation. + * @member {google.type.ILatLng|null|undefined} departureLocation + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.departureLocation = null; + + /** + * VisitRequest departureWaypoint. + * @member {google.maps.routeoptimization.v1.IWaypoint|null|undefined} departureWaypoint + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.departureWaypoint = null; + + /** + * VisitRequest tags. + * @member {Array.} tags + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.tags = $util.emptyArray; + + /** + * VisitRequest timeWindows. + * @member {Array.} timeWindows + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.timeWindows = $util.emptyArray; + + /** + * VisitRequest duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.duration = null; + + /** + * VisitRequest cost. + * @member {number} cost + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.cost = 0; + + /** + * VisitRequest loadDemands. + * @member {Object.} loadDemands + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.loadDemands = $util.emptyObject; + + /** + * VisitRequest visitTypes. + * @member {Array.} visitTypes + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.visitTypes = $util.emptyArray; + + /** + * VisitRequest label. + * @member {string} label + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + */ + VisitRequest.prototype.label = ""; + + /** + * Creates a new VisitRequest instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {google.maps.routeoptimization.v1.Shipment.IVisitRequest=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Shipment.VisitRequest} VisitRequest instance + */ + VisitRequest.create = function create(properties) { + return new VisitRequest(properties); + }; + + /** + * Encodes the specified VisitRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.VisitRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {google.maps.routeoptimization.v1.Shipment.IVisitRequest} message VisitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisitRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.arrivalLocation != null && Object.hasOwnProperty.call(message, "arrivalLocation")) + $root.google.type.LatLng.encode(message.arrivalLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arrivalWaypoint != null && Object.hasOwnProperty.call(message, "arrivalWaypoint")) + $root.google.maps.routeoptimization.v1.Waypoint.encode(message.arrivalWaypoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.departureLocation != null && Object.hasOwnProperty.call(message, "departureLocation")) + $root.google.type.LatLng.encode(message.departureLocation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.departureWaypoint != null && Object.hasOwnProperty.call(message, "departureWaypoint")) + $root.google.maps.routeoptimization.v1.Waypoint.encode(message.departureWaypoint, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tags[i]); + if (message.timeWindows != null && message.timeWindows.length) + for (var i = 0; i < message.timeWindows.length; ++i) + $root.google.maps.routeoptimization.v1.TimeWindow.encode(message.timeWindows[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 8, wireType 1 =*/65).double(message.cost); + if (message.visitTypes != null && message.visitTypes.length) + for (var i = 0; i < message.visitTypes.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.visitTypes[i]); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.label); + if (message.loadDemands != null && Object.hasOwnProperty.call(message, "loadDemands")) + for (var keys = Object.keys(message.loadDemands), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.maps.routeoptimization.v1.Shipment.Load.encode(message.loadDemands[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified VisitRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.VisitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {google.maps.routeoptimization.v1.Shipment.IVisitRequest} message VisitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisitRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisitRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Shipment.VisitRequest} VisitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisitRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Shipment.VisitRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.arrivalLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arrivalWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.departureLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 4: { + message.departureWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 6: { + if (!(message.timeWindows && message.timeWindows.length)) + message.timeWindows = []; + message.timeWindows.push($root.google.maps.routeoptimization.v1.TimeWindow.decode(reader, reader.uint32())); + break; + } + case 7: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cost = reader.double(); + break; + } + case 12: { + if (message.loadDemands === $util.emptyObject) + message.loadDemands = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.maps.routeoptimization.v1.Shipment.Load.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.loadDemands[key] = value; + break; + } + case 10: { + if (!(message.visitTypes && message.visitTypes.length)) + message.visitTypes = []; + message.visitTypes.push(reader.string()); + break; + } + case 11: { + message.label = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisitRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Shipment.VisitRequest} VisitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisitRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisitRequest message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisitRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.arrivalLocation != null && message.hasOwnProperty("arrivalLocation")) { + var error = $root.google.type.LatLng.verify(message.arrivalLocation); + if (error) + return "arrivalLocation." + error; + } + if (message.arrivalWaypoint != null && message.hasOwnProperty("arrivalWaypoint")) { + var error = $root.google.maps.routeoptimization.v1.Waypoint.verify(message.arrivalWaypoint); + if (error) + return "arrivalWaypoint." + error; + } + if (message.departureLocation != null && message.hasOwnProperty("departureLocation")) { + var error = $root.google.type.LatLng.verify(message.departureLocation); + if (error) + return "departureLocation." + error; + } + if (message.departureWaypoint != null && message.hasOwnProperty("departureWaypoint")) { + var error = $root.google.maps.routeoptimization.v1.Waypoint.verify(message.departureWaypoint); + if (error) + return "departureWaypoint." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.timeWindows != null && message.hasOwnProperty("timeWindows")) { + if (!Array.isArray(message.timeWindows)) + return "timeWindows: array expected"; + for (var i = 0; i < message.timeWindows.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.TimeWindow.verify(message.timeWindows[i]); + if (error) + return "timeWindows." + error; + } + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.loadDemands != null && message.hasOwnProperty("loadDemands")) { + if (!$util.isObject(message.loadDemands)) + return "loadDemands: object expected"; + var key = Object.keys(message.loadDemands); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Shipment.Load.verify(message.loadDemands[key[i]]); + if (error) + return "loadDemands." + error; + } + } + if (message.visitTypes != null && message.hasOwnProperty("visitTypes")) { + if (!Array.isArray(message.visitTypes)) + return "visitTypes: array expected"; + for (var i = 0; i < message.visitTypes.length; ++i) + if (!$util.isString(message.visitTypes[i])) + return "visitTypes: string[] expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + return null; + }; + + /** + * Creates a VisitRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Shipment.VisitRequest} VisitRequest + */ + VisitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Shipment.VisitRequest) + return object; + var message = new $root.google.maps.routeoptimization.v1.Shipment.VisitRequest(); + if (object.arrivalLocation != null) { + if (typeof object.arrivalLocation !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.arrivalLocation: object expected"); + message.arrivalLocation = $root.google.type.LatLng.fromObject(object.arrivalLocation); + } + if (object.arrivalWaypoint != null) { + if (typeof object.arrivalWaypoint !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.arrivalWaypoint: object expected"); + message.arrivalWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.fromObject(object.arrivalWaypoint); + } + if (object.departureLocation != null) { + if (typeof object.departureLocation !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.departureLocation: object expected"); + message.departureLocation = $root.google.type.LatLng.fromObject(object.departureLocation); + } + if (object.departureWaypoint != null) { + if (typeof object.departureWaypoint !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.departureWaypoint: object expected"); + message.departureWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.fromObject(object.departureWaypoint); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.timeWindows) { + if (!Array.isArray(object.timeWindows)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.timeWindows: array expected"); + message.timeWindows = []; + for (var i = 0; i < object.timeWindows.length; ++i) { + if (typeof object.timeWindows[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.timeWindows: object expected"); + message.timeWindows[i] = $root.google.maps.routeoptimization.v1.TimeWindow.fromObject(object.timeWindows[i]); + } + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.cost != null) + message.cost = Number(object.cost); + if (object.loadDemands) { + if (typeof object.loadDemands !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.loadDemands: object expected"); + message.loadDemands = {}; + for (var keys = Object.keys(object.loadDemands), i = 0; i < keys.length; ++i) { + if (typeof object.loadDemands[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.loadDemands: object expected"); + message.loadDemands[keys[i]] = $root.google.maps.routeoptimization.v1.Shipment.Load.fromObject(object.loadDemands[keys[i]]); + } + } + if (object.visitTypes) { + if (!Array.isArray(object.visitTypes)) + throw TypeError(".google.maps.routeoptimization.v1.Shipment.VisitRequest.visitTypes: array expected"); + message.visitTypes = []; + for (var i = 0; i < object.visitTypes.length; ++i) + message.visitTypes[i] = String(object.visitTypes[i]); + } + if (object.label != null) + message.label = String(object.label); + return message; + }; + + /** + * Creates a plain object from a VisitRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {google.maps.routeoptimization.v1.Shipment.VisitRequest} message VisitRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisitRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.timeWindows = []; + object.visitTypes = []; + } + if (options.objects || options.defaults) + object.loadDemands = {}; + if (options.defaults) { + object.arrivalLocation = null; + object.arrivalWaypoint = null; + object.departureLocation = null; + object.departureWaypoint = null; + object.duration = null; + object.cost = 0; + object.label = ""; + } + if (message.arrivalLocation != null && message.hasOwnProperty("arrivalLocation")) + object.arrivalLocation = $root.google.type.LatLng.toObject(message.arrivalLocation, options); + if (message.arrivalWaypoint != null && message.hasOwnProperty("arrivalWaypoint")) + object.arrivalWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.toObject(message.arrivalWaypoint, options); + if (message.departureLocation != null && message.hasOwnProperty("departureLocation")) + object.departureLocation = $root.google.type.LatLng.toObject(message.departureLocation, options); + if (message.departureWaypoint != null && message.hasOwnProperty("departureWaypoint")) + object.departureWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.toObject(message.departureWaypoint, options); + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.timeWindows && message.timeWindows.length) { + object.timeWindows = []; + for (var j = 0; j < message.timeWindows.length; ++j) + object.timeWindows[j] = $root.google.maps.routeoptimization.v1.TimeWindow.toObject(message.timeWindows[j], options); + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.visitTypes && message.visitTypes.length) { + object.visitTypes = []; + for (var j = 0; j < message.visitTypes.length; ++j) + object.visitTypes[j] = message.visitTypes[j]; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + var keys2; + if (message.loadDemands && (keys2 = Object.keys(message.loadDemands)).length) { + object.loadDemands = {}; + for (var j = 0; j < keys2.length; ++j) + object.loadDemands[keys2[j]] = $root.google.maps.routeoptimization.v1.Shipment.Load.toObject(message.loadDemands[keys2[j]], options); + } + return object; + }; + + /** + * Converts this VisitRequest to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @instance + * @returns {Object.} JSON object + */ + VisitRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisitRequest + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Shipment.VisitRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Shipment.VisitRequest"; + }; + + return VisitRequest; + })(); + + Shipment.Load = (function() { + + /** + * Properties of a Load. + * @memberof google.maps.routeoptimization.v1.Shipment + * @interface ILoad + * @property {number|Long|null} [amount] Load amount + */ + + /** + * Constructs a new Load. + * @memberof google.maps.routeoptimization.v1.Shipment + * @classdesc Represents a Load. + * @implements ILoad + * @constructor + * @param {google.maps.routeoptimization.v1.Shipment.ILoad=} [properties] Properties to set + */ + function Load(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Load amount. + * @member {number|Long} amount + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @instance + */ + Load.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Load instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {google.maps.routeoptimization.v1.Shipment.ILoad=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Shipment.Load} Load instance + */ + Load.create = function create(properties) { + return new Load(properties); + }; + + /** + * Encodes the specified Load message. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.Load.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {google.maps.routeoptimization.v1.Shipment.ILoad} message Load message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Load.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount); + return writer; + }; + + /** + * Encodes the specified Load message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Shipment.Load.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {google.maps.routeoptimization.v1.Shipment.ILoad} message Load message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Load.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Load message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Shipment.Load} Load + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Load.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Shipment.Load(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.amount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Load message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Shipment.Load} Load + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Load.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Load message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Load.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + return null; + }; + + /** + * Creates a Load message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Shipment.Load} Load + */ + Load.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Shipment.Load) + return object; + var message = new $root.google.maps.routeoptimization.v1.Shipment.Load(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = false; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Load message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {google.maps.routeoptimization.v1.Shipment.Load} message Load + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Load.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount; + return object; + }; + + /** + * Converts this Load to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @instance + * @returns {Object.} JSON object + */ + Load.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Load + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Shipment.Load + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Load.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Shipment.Load"; + }; + + return Load; + })(); + + return Shipment; + })(); + + v1.ShipmentTypeIncompatibility = (function() { + + /** + * Properties of a ShipmentTypeIncompatibility. + * @memberof google.maps.routeoptimization.v1 + * @interface IShipmentTypeIncompatibility + * @property {Array.|null} [types] ShipmentTypeIncompatibility types + * @property {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode|null} [incompatibilityMode] ShipmentTypeIncompatibility incompatibilityMode + */ + + /** + * Constructs a new ShipmentTypeIncompatibility. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a ShipmentTypeIncompatibility. + * @implements IShipmentTypeIncompatibility + * @constructor + * @param {google.maps.routeoptimization.v1.IShipmentTypeIncompatibility=} [properties] Properties to set + */ + function ShipmentTypeIncompatibility(properties) { + this.types = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShipmentTypeIncompatibility types. + * @member {Array.} types + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @instance + */ + ShipmentTypeIncompatibility.prototype.types = $util.emptyArray; + + /** + * ShipmentTypeIncompatibility incompatibilityMode. + * @member {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode} incompatibilityMode + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @instance + */ + ShipmentTypeIncompatibility.prototype.incompatibilityMode = 0; + + /** + * Creates a new ShipmentTypeIncompatibility instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {google.maps.routeoptimization.v1.IShipmentTypeIncompatibility=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} ShipmentTypeIncompatibility instance + */ + ShipmentTypeIncompatibility.create = function create(properties) { + return new ShipmentTypeIncompatibility(properties); + }; + + /** + * Encodes the specified ShipmentTypeIncompatibility message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {google.maps.routeoptimization.v1.IShipmentTypeIncompatibility} message ShipmentTypeIncompatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentTypeIncompatibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.types != null && message.types.length) + for (var i = 0; i < message.types.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.types[i]); + if (message.incompatibilityMode != null && Object.hasOwnProperty.call(message, "incompatibilityMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.incompatibilityMode); + return writer; + }; + + /** + * Encodes the specified ShipmentTypeIncompatibility message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {google.maps.routeoptimization.v1.IShipmentTypeIncompatibility} message ShipmentTypeIncompatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentTypeIncompatibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShipmentTypeIncompatibility message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} ShipmentTypeIncompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentTypeIncompatibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.types && message.types.length)) + message.types = []; + message.types.push(reader.string()); + break; + } + case 2: { + message.incompatibilityMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShipmentTypeIncompatibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} ShipmentTypeIncompatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentTypeIncompatibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShipmentTypeIncompatibility message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShipmentTypeIncompatibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.types != null && message.hasOwnProperty("types")) { + if (!Array.isArray(message.types)) + return "types: array expected"; + for (var i = 0; i < message.types.length; ++i) + if (!$util.isString(message.types[i])) + return "types: string[] expected"; + } + if (message.incompatibilityMode != null && message.hasOwnProperty("incompatibilityMode")) + switch (message.incompatibilityMode) { + default: + return "incompatibilityMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ShipmentTypeIncompatibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} ShipmentTypeIncompatibility + */ + ShipmentTypeIncompatibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility(); + if (object.types) { + if (!Array.isArray(object.types)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.types: array expected"); + message.types = []; + for (var i = 0; i < object.types.length; ++i) + message.types[i] = String(object.types[i]); + } + switch (object.incompatibilityMode) { + default: + if (typeof object.incompatibilityMode === "number") { + message.incompatibilityMode = object.incompatibilityMode; + break; + } + break; + case "INCOMPATIBILITY_MODE_UNSPECIFIED": + case 0: + message.incompatibilityMode = 0; + break; + case "NOT_PERFORMED_BY_SAME_VEHICLE": + case 1: + message.incompatibilityMode = 1; + break; + case "NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY": + case 2: + message.incompatibilityMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ShipmentTypeIncompatibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {google.maps.routeoptimization.v1.ShipmentTypeIncompatibility} message ShipmentTypeIncompatibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShipmentTypeIncompatibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.types = []; + if (options.defaults) + object.incompatibilityMode = options.enums === String ? "INCOMPATIBILITY_MODE_UNSPECIFIED" : 0; + if (message.types && message.types.length) { + object.types = []; + for (var j = 0; j < message.types.length; ++j) + object.types[j] = message.types[j]; + } + if (message.incompatibilityMode != null && message.hasOwnProperty("incompatibilityMode")) + object.incompatibilityMode = options.enums === String ? $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode[message.incompatibilityMode] === undefined ? message.incompatibilityMode : $root.google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode[message.incompatibilityMode] : message.incompatibilityMode; + return object; + }; + + /** + * Converts this ShipmentTypeIncompatibility to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @instance + * @returns {Object.} JSON object + */ + ShipmentTypeIncompatibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShipmentTypeIncompatibility + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShipmentTypeIncompatibility.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentTypeIncompatibility"; + }; + + /** + * IncompatibilityMode enum. + * @name google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + * @enum {number} + * @property {number} INCOMPATIBILITY_MODE_UNSPECIFIED=0 INCOMPATIBILITY_MODE_UNSPECIFIED value + * @property {number} NOT_PERFORMED_BY_SAME_VEHICLE=1 NOT_PERFORMED_BY_SAME_VEHICLE value + * @property {number} NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY=2 NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY value + */ + ShipmentTypeIncompatibility.IncompatibilityMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INCOMPATIBILITY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_PERFORMED_BY_SAME_VEHICLE"] = 1; + values[valuesById[2] = "NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY"] = 2; + return values; + })(); + + return ShipmentTypeIncompatibility; + })(); + + v1.ShipmentTypeRequirement = (function() { + + /** + * Properties of a ShipmentTypeRequirement. + * @memberof google.maps.routeoptimization.v1 + * @interface IShipmentTypeRequirement + * @property {Array.|null} [requiredShipmentTypeAlternatives] ShipmentTypeRequirement requiredShipmentTypeAlternatives + * @property {Array.|null} [dependentShipmentTypes] ShipmentTypeRequirement dependentShipmentTypes + * @property {google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode|null} [requirementMode] ShipmentTypeRequirement requirementMode + */ + + /** + * Constructs a new ShipmentTypeRequirement. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a ShipmentTypeRequirement. + * @implements IShipmentTypeRequirement + * @constructor + * @param {google.maps.routeoptimization.v1.IShipmentTypeRequirement=} [properties] Properties to set + */ + function ShipmentTypeRequirement(properties) { + this.requiredShipmentTypeAlternatives = []; + this.dependentShipmentTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShipmentTypeRequirement requiredShipmentTypeAlternatives. + * @member {Array.} requiredShipmentTypeAlternatives + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @instance + */ + ShipmentTypeRequirement.prototype.requiredShipmentTypeAlternatives = $util.emptyArray; + + /** + * ShipmentTypeRequirement dependentShipmentTypes. + * @member {Array.} dependentShipmentTypes + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @instance + */ + ShipmentTypeRequirement.prototype.dependentShipmentTypes = $util.emptyArray; + + /** + * ShipmentTypeRequirement requirementMode. + * @member {google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode} requirementMode + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @instance + */ + ShipmentTypeRequirement.prototype.requirementMode = 0; + + /** + * Creates a new ShipmentTypeRequirement instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {google.maps.routeoptimization.v1.IShipmentTypeRequirement=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentTypeRequirement} ShipmentTypeRequirement instance + */ + ShipmentTypeRequirement.create = function create(properties) { + return new ShipmentTypeRequirement(properties); + }; + + /** + * Encodes the specified ShipmentTypeRequirement message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeRequirement.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {google.maps.routeoptimization.v1.IShipmentTypeRequirement} message ShipmentTypeRequirement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentTypeRequirement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requiredShipmentTypeAlternatives != null && message.requiredShipmentTypeAlternatives.length) + for (var i = 0; i < message.requiredShipmentTypeAlternatives.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requiredShipmentTypeAlternatives[i]); + if (message.dependentShipmentTypes != null && message.dependentShipmentTypes.length) + for (var i = 0; i < message.dependentShipmentTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dependentShipmentTypes[i]); + if (message.requirementMode != null && Object.hasOwnProperty.call(message, "requirementMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requirementMode); + return writer; + }; + + /** + * Encodes the specified ShipmentTypeRequirement message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentTypeRequirement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {google.maps.routeoptimization.v1.IShipmentTypeRequirement} message ShipmentTypeRequirement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentTypeRequirement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShipmentTypeRequirement message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentTypeRequirement} ShipmentTypeRequirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentTypeRequirement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.requiredShipmentTypeAlternatives && message.requiredShipmentTypeAlternatives.length)) + message.requiredShipmentTypeAlternatives = []; + message.requiredShipmentTypeAlternatives.push(reader.string()); + break; + } + case 2: { + if (!(message.dependentShipmentTypes && message.dependentShipmentTypes.length)) + message.dependentShipmentTypes = []; + message.dependentShipmentTypes.push(reader.string()); + break; + } + case 3: { + message.requirementMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShipmentTypeRequirement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentTypeRequirement} ShipmentTypeRequirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentTypeRequirement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShipmentTypeRequirement message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShipmentTypeRequirement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requiredShipmentTypeAlternatives != null && message.hasOwnProperty("requiredShipmentTypeAlternatives")) { + if (!Array.isArray(message.requiredShipmentTypeAlternatives)) + return "requiredShipmentTypeAlternatives: array expected"; + for (var i = 0; i < message.requiredShipmentTypeAlternatives.length; ++i) + if (!$util.isString(message.requiredShipmentTypeAlternatives[i])) + return "requiredShipmentTypeAlternatives: string[] expected"; + } + if (message.dependentShipmentTypes != null && message.hasOwnProperty("dependentShipmentTypes")) { + if (!Array.isArray(message.dependentShipmentTypes)) + return "dependentShipmentTypes: array expected"; + for (var i = 0; i < message.dependentShipmentTypes.length; ++i) + if (!$util.isString(message.dependentShipmentTypes[i])) + return "dependentShipmentTypes: string[] expected"; + } + if (message.requirementMode != null && message.hasOwnProperty("requirementMode")) + switch (message.requirementMode) { + default: + return "requirementMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ShipmentTypeRequirement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentTypeRequirement} ShipmentTypeRequirement + */ + ShipmentTypeRequirement.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement(); + if (object.requiredShipmentTypeAlternatives) { + if (!Array.isArray(object.requiredShipmentTypeAlternatives)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentTypeRequirement.requiredShipmentTypeAlternatives: array expected"); + message.requiredShipmentTypeAlternatives = []; + for (var i = 0; i < object.requiredShipmentTypeAlternatives.length; ++i) + message.requiredShipmentTypeAlternatives[i] = String(object.requiredShipmentTypeAlternatives[i]); + } + if (object.dependentShipmentTypes) { + if (!Array.isArray(object.dependentShipmentTypes)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentTypeRequirement.dependentShipmentTypes: array expected"); + message.dependentShipmentTypes = []; + for (var i = 0; i < object.dependentShipmentTypes.length; ++i) + message.dependentShipmentTypes[i] = String(object.dependentShipmentTypes[i]); + } + switch (object.requirementMode) { + default: + if (typeof object.requirementMode === "number") { + message.requirementMode = object.requirementMode; + break; + } + break; + case "REQUIREMENT_MODE_UNSPECIFIED": + case 0: + message.requirementMode = 0; + break; + case "PERFORMED_BY_SAME_VEHICLE": + case 1: + message.requirementMode = 1; + break; + case "IN_SAME_VEHICLE_AT_PICKUP_TIME": + case 2: + message.requirementMode = 2; + break; + case "IN_SAME_VEHICLE_AT_DELIVERY_TIME": + case 3: + message.requirementMode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ShipmentTypeRequirement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {google.maps.routeoptimization.v1.ShipmentTypeRequirement} message ShipmentTypeRequirement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShipmentTypeRequirement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.requiredShipmentTypeAlternatives = []; + object.dependentShipmentTypes = []; + } + if (options.defaults) + object.requirementMode = options.enums === String ? "REQUIREMENT_MODE_UNSPECIFIED" : 0; + if (message.requiredShipmentTypeAlternatives && message.requiredShipmentTypeAlternatives.length) { + object.requiredShipmentTypeAlternatives = []; + for (var j = 0; j < message.requiredShipmentTypeAlternatives.length; ++j) + object.requiredShipmentTypeAlternatives[j] = message.requiredShipmentTypeAlternatives[j]; + } + if (message.dependentShipmentTypes && message.dependentShipmentTypes.length) { + object.dependentShipmentTypes = []; + for (var j = 0; j < message.dependentShipmentTypes.length; ++j) + object.dependentShipmentTypes[j] = message.dependentShipmentTypes[j]; + } + if (message.requirementMode != null && message.hasOwnProperty("requirementMode")) + object.requirementMode = options.enums === String ? $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode[message.requirementMode] === undefined ? message.requirementMode : $root.google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode[message.requirementMode] : message.requirementMode; + return object; + }; + + /** + * Converts this ShipmentTypeRequirement to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @instance + * @returns {Object.} JSON object + */ + ShipmentTypeRequirement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShipmentTypeRequirement + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentTypeRequirement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShipmentTypeRequirement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentTypeRequirement"; + }; + + /** + * RequirementMode enum. + * @name google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + * @enum {number} + * @property {number} REQUIREMENT_MODE_UNSPECIFIED=0 REQUIREMENT_MODE_UNSPECIFIED value + * @property {number} PERFORMED_BY_SAME_VEHICLE=1 PERFORMED_BY_SAME_VEHICLE value + * @property {number} IN_SAME_VEHICLE_AT_PICKUP_TIME=2 IN_SAME_VEHICLE_AT_PICKUP_TIME value + * @property {number} IN_SAME_VEHICLE_AT_DELIVERY_TIME=3 IN_SAME_VEHICLE_AT_DELIVERY_TIME value + */ + ShipmentTypeRequirement.RequirementMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUIREMENT_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PERFORMED_BY_SAME_VEHICLE"] = 1; + values[valuesById[2] = "IN_SAME_VEHICLE_AT_PICKUP_TIME"] = 2; + values[valuesById[3] = "IN_SAME_VEHICLE_AT_DELIVERY_TIME"] = 3; + return values; + })(); + + return ShipmentTypeRequirement; + })(); + + v1.Vehicle = (function() { + + /** + * Properties of a Vehicle. + * @memberof google.maps.routeoptimization.v1 + * @interface IVehicle + * @property {string|null} [displayName] Vehicle displayName + * @property {google.maps.routeoptimization.v1.Vehicle.TravelMode|null} [travelMode] Vehicle travelMode + * @property {google.type.ILatLng|null} [startLocation] Vehicle startLocation + * @property {google.maps.routeoptimization.v1.IWaypoint|null} [startWaypoint] Vehicle startWaypoint + * @property {google.type.ILatLng|null} [endLocation] Vehicle endLocation + * @property {google.maps.routeoptimization.v1.IWaypoint|null} [endWaypoint] Vehicle endWaypoint + * @property {Array.|null} [startTags] Vehicle startTags + * @property {Array.|null} [endTags] Vehicle endTags + * @property {Array.|null} [startTimeWindows] Vehicle startTimeWindows + * @property {Array.|null} [endTimeWindows] Vehicle endTimeWindows + * @property {number|null} [travelDurationMultiple] Vehicle travelDurationMultiple + * @property {google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy|null} [unloadingPolicy] Vehicle unloadingPolicy + * @property {Object.|null} [loadLimits] Vehicle loadLimits + * @property {number|null} [costPerHour] Vehicle costPerHour + * @property {number|null} [costPerTraveledHour] Vehicle costPerTraveledHour + * @property {number|null} [costPerKilometer] Vehicle costPerKilometer + * @property {number|null} [fixedCost] Vehicle fixedCost + * @property {boolean|null} [usedIfRouteIsEmpty] Vehicle usedIfRouteIsEmpty + * @property {google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null} [routeDurationLimit] Vehicle routeDurationLimit + * @property {google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null} [travelDurationLimit] Vehicle travelDurationLimit + * @property {google.maps.routeoptimization.v1.IDistanceLimit|null} [routeDistanceLimit] Vehicle routeDistanceLimit + * @property {Object.|null} [extraVisitDurationForVisitType] Vehicle extraVisitDurationForVisitType + * @property {google.maps.routeoptimization.v1.IBreakRule|null} [breakRule] Vehicle breakRule + * @property {string|null} [label] Vehicle label + * @property {boolean|null} [ignore] Vehicle ignore + */ + + /** + * Constructs a new Vehicle. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a Vehicle. + * @implements IVehicle + * @constructor + * @param {google.maps.routeoptimization.v1.IVehicle=} [properties] Properties to set + */ + function Vehicle(properties) { + this.startTags = []; + this.endTags = []; + this.startTimeWindows = []; + this.endTimeWindows = []; + this.loadLimits = {}; + this.extraVisitDurationForVisitType = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vehicle displayName. + * @member {string} displayName + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.displayName = ""; + + /** + * Vehicle travelMode. + * @member {google.maps.routeoptimization.v1.Vehicle.TravelMode} travelMode + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.travelMode = 0; + + /** + * Vehicle startLocation. + * @member {google.type.ILatLng|null|undefined} startLocation + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.startLocation = null; + + /** + * Vehicle startWaypoint. + * @member {google.maps.routeoptimization.v1.IWaypoint|null|undefined} startWaypoint + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.startWaypoint = null; + + /** + * Vehicle endLocation. + * @member {google.type.ILatLng|null|undefined} endLocation + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.endLocation = null; + + /** + * Vehicle endWaypoint. + * @member {google.maps.routeoptimization.v1.IWaypoint|null|undefined} endWaypoint + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.endWaypoint = null; + + /** + * Vehicle startTags. + * @member {Array.} startTags + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.startTags = $util.emptyArray; + + /** + * Vehicle endTags. + * @member {Array.} endTags + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.endTags = $util.emptyArray; + + /** + * Vehicle startTimeWindows. + * @member {Array.} startTimeWindows + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.startTimeWindows = $util.emptyArray; + + /** + * Vehicle endTimeWindows. + * @member {Array.} endTimeWindows + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.endTimeWindows = $util.emptyArray; + + /** + * Vehicle travelDurationMultiple. + * @member {number|null|undefined} travelDurationMultiple + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.travelDurationMultiple = null; + + /** + * Vehicle unloadingPolicy. + * @member {google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy} unloadingPolicy + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.unloadingPolicy = 0; + + /** + * Vehicle loadLimits. + * @member {Object.} loadLimits + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.loadLimits = $util.emptyObject; + + /** + * Vehicle costPerHour. + * @member {number} costPerHour + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.costPerHour = 0; + + /** + * Vehicle costPerTraveledHour. + * @member {number} costPerTraveledHour + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.costPerTraveledHour = 0; + + /** + * Vehicle costPerKilometer. + * @member {number} costPerKilometer + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.costPerKilometer = 0; + + /** + * Vehicle fixedCost. + * @member {number} fixedCost + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.fixedCost = 0; + + /** + * Vehicle usedIfRouteIsEmpty. + * @member {boolean} usedIfRouteIsEmpty + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.usedIfRouteIsEmpty = false; + + /** + * Vehicle routeDurationLimit. + * @member {google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null|undefined} routeDurationLimit + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.routeDurationLimit = null; + + /** + * Vehicle travelDurationLimit. + * @member {google.maps.routeoptimization.v1.Vehicle.IDurationLimit|null|undefined} travelDurationLimit + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.travelDurationLimit = null; + + /** + * Vehicle routeDistanceLimit. + * @member {google.maps.routeoptimization.v1.IDistanceLimit|null|undefined} routeDistanceLimit + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.routeDistanceLimit = null; + + /** + * Vehicle extraVisitDurationForVisitType. + * @member {Object.} extraVisitDurationForVisitType + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.extraVisitDurationForVisitType = $util.emptyObject; + + /** + * Vehicle breakRule. + * @member {google.maps.routeoptimization.v1.IBreakRule|null|undefined} breakRule + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.breakRule = null; + + /** + * Vehicle label. + * @member {string} label + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.label = ""; + + /** + * Vehicle ignore. + * @member {boolean} ignore + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Vehicle.prototype.ignore = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Vehicle _travelDurationMultiple. + * @member {"travelDurationMultiple"|undefined} _travelDurationMultiple + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + */ + Object.defineProperty(Vehicle.prototype, "_travelDurationMultiple", { + get: $util.oneOfGetter($oneOfFields = ["travelDurationMultiple"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Vehicle instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {google.maps.routeoptimization.v1.IVehicle=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Vehicle} Vehicle instance + */ + Vehicle.create = function create(properties) { + return new Vehicle(properties); + }; + + /** + * Encodes the specified Vehicle message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {google.maps.routeoptimization.v1.IVehicle} message Vehicle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vehicle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.travelMode); + if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) + $root.google.type.LatLng.encode(message.startLocation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startWaypoint != null && Object.hasOwnProperty.call(message, "startWaypoint")) + $root.google.maps.routeoptimization.v1.Waypoint.encode(message.startWaypoint, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) + $root.google.type.LatLng.encode(message.endLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endWaypoint != null && Object.hasOwnProperty.call(message, "endWaypoint")) + $root.google.maps.routeoptimization.v1.Waypoint.encode(message.endWaypoint, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.startTags != null && message.startTags.length) + for (var i = 0; i < message.startTags.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.startTags[i]); + if (message.endTags != null && message.endTags.length) + for (var i = 0; i < message.endTags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.endTags[i]); + if (message.startTimeWindows != null && message.startTimeWindows.length) + for (var i = 0; i < message.startTimeWindows.length; ++i) + $root.google.maps.routeoptimization.v1.TimeWindow.encode(message.startTimeWindows[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endTimeWindows != null && message.endTimeWindows.length) + for (var i = 0; i < message.endTimeWindows.length; ++i) + $root.google.maps.routeoptimization.v1.TimeWindow.encode(message.endTimeWindows[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.travelDurationMultiple != null && Object.hasOwnProperty.call(message, "travelDurationMultiple")) + writer.uint32(/* id 11, wireType 1 =*/89).double(message.travelDurationMultiple); + if (message.unloadingPolicy != null && Object.hasOwnProperty.call(message, "unloadingPolicy")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.unloadingPolicy); + if (message.costPerHour != null && Object.hasOwnProperty.call(message, "costPerHour")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.costPerHour); + if (message.costPerTraveledHour != null && Object.hasOwnProperty.call(message, "costPerTraveledHour")) + writer.uint32(/* id 17, wireType 1 =*/137).double(message.costPerTraveledHour); + if (message.costPerKilometer != null && Object.hasOwnProperty.call(message, "costPerKilometer")) + writer.uint32(/* id 18, wireType 1 =*/145).double(message.costPerKilometer); + if (message.fixedCost != null && Object.hasOwnProperty.call(message, "fixedCost")) + writer.uint32(/* id 19, wireType 1 =*/153).double(message.fixedCost); + if (message.usedIfRouteIsEmpty != null && Object.hasOwnProperty.call(message, "usedIfRouteIsEmpty")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.usedIfRouteIsEmpty); + if (message.routeDurationLimit != null && Object.hasOwnProperty.call(message, "routeDurationLimit")) + $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.encode(message.routeDurationLimit, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.travelDurationLimit != null && Object.hasOwnProperty.call(message, "travelDurationLimit")) + $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.encode(message.travelDurationLimit, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.routeDistanceLimit != null && Object.hasOwnProperty.call(message, "routeDistanceLimit")) + $root.google.maps.routeoptimization.v1.DistanceLimit.encode(message.routeDistanceLimit, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.extraVisitDurationForVisitType != null && Object.hasOwnProperty.call(message, "extraVisitDurationForVisitType")) + for (var keys = Object.keys(message.extraVisitDurationForVisitType), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 24, wireType 2 =*/194).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Duration.encode(message.extraVisitDurationForVisitType[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.breakRule != null && Object.hasOwnProperty.call(message, "breakRule")) + $root.google.maps.routeoptimization.v1.BreakRule.encode(message.breakRule, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.label); + if (message.ignore != null && Object.hasOwnProperty.call(message, "ignore")) + writer.uint32(/* id 28, wireType 0 =*/224).bool(message.ignore); + if (message.loadLimits != null && Object.hasOwnProperty.call(message, "loadLimits")) + for (var keys = Object.keys(message.loadLimits), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 30, wireType 2 =*/242).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.encode(message.loadLimits[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 32, wireType 2 =*/258).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Vehicle message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {google.maps.routeoptimization.v1.IVehicle} message Vehicle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vehicle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vehicle message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Vehicle} Vehicle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vehicle.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Vehicle(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 32: { + message.displayName = reader.string(); + break; + } + case 1: { + message.travelMode = reader.int32(); + break; + } + case 3: { + message.startLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.startTags && message.startTags.length)) + message.startTags = []; + message.startTags.push(reader.string()); + break; + } + case 8: { + if (!(message.endTags && message.endTags.length)) + message.endTags = []; + message.endTags.push(reader.string()); + break; + } + case 9: { + if (!(message.startTimeWindows && message.startTimeWindows.length)) + message.startTimeWindows = []; + message.startTimeWindows.push($root.google.maps.routeoptimization.v1.TimeWindow.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.endTimeWindows && message.endTimeWindows.length)) + message.endTimeWindows = []; + message.endTimeWindows.push($root.google.maps.routeoptimization.v1.TimeWindow.decode(reader, reader.uint32())); + break; + } + case 11: { + message.travelDurationMultiple = reader.double(); + break; + } + case 12: { + message.unloadingPolicy = reader.int32(); + break; + } + case 30: { + if (message.loadLimits === $util.emptyObject) + message.loadLimits = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.loadLimits[key] = value; + break; + } + case 16: { + message.costPerHour = reader.double(); + break; + } + case 17: { + message.costPerTraveledHour = reader.double(); + break; + } + case 18: { + message.costPerKilometer = reader.double(); + break; + } + case 19: { + message.fixedCost = reader.double(); + break; + } + case 20: { + message.usedIfRouteIsEmpty = reader.bool(); + break; + } + case 21: { + message.routeDurationLimit = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.decode(reader, reader.uint32()); + break; + } + case 22: { + message.travelDurationLimit = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.decode(reader, reader.uint32()); + break; + } + case 23: { + message.routeDistanceLimit = $root.google.maps.routeoptimization.v1.DistanceLimit.decode(reader, reader.uint32()); + break; + } + case 24: { + if (message.extraVisitDurationForVisitType === $util.emptyObject) + message.extraVisitDurationForVisitType = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.extraVisitDurationForVisitType[key] = value; + break; + } + case 25: { + message.breakRule = $root.google.maps.routeoptimization.v1.BreakRule.decode(reader, reader.uint32()); + break; + } + case 27: { + message.label = reader.string(); + break; + } + case 28: { + message.ignore = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vehicle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Vehicle} Vehicle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vehicle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vehicle message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vehicle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startLocation != null && message.hasOwnProperty("startLocation")) { + var error = $root.google.type.LatLng.verify(message.startLocation); + if (error) + return "startLocation." + error; + } + if (message.startWaypoint != null && message.hasOwnProperty("startWaypoint")) { + var error = $root.google.maps.routeoptimization.v1.Waypoint.verify(message.startWaypoint); + if (error) + return "startWaypoint." + error; + } + if (message.endLocation != null && message.hasOwnProperty("endLocation")) { + var error = $root.google.type.LatLng.verify(message.endLocation); + if (error) + return "endLocation." + error; + } + if (message.endWaypoint != null && message.hasOwnProperty("endWaypoint")) { + var error = $root.google.maps.routeoptimization.v1.Waypoint.verify(message.endWaypoint); + if (error) + return "endWaypoint." + error; + } + if (message.startTags != null && message.hasOwnProperty("startTags")) { + if (!Array.isArray(message.startTags)) + return "startTags: array expected"; + for (var i = 0; i < message.startTags.length; ++i) + if (!$util.isString(message.startTags[i])) + return "startTags: string[] expected"; + } + if (message.endTags != null && message.hasOwnProperty("endTags")) { + if (!Array.isArray(message.endTags)) + return "endTags: array expected"; + for (var i = 0; i < message.endTags.length; ++i) + if (!$util.isString(message.endTags[i])) + return "endTags: string[] expected"; + } + if (message.startTimeWindows != null && message.hasOwnProperty("startTimeWindows")) { + if (!Array.isArray(message.startTimeWindows)) + return "startTimeWindows: array expected"; + for (var i = 0; i < message.startTimeWindows.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.TimeWindow.verify(message.startTimeWindows[i]); + if (error) + return "startTimeWindows." + error; + } + } + if (message.endTimeWindows != null && message.hasOwnProperty("endTimeWindows")) { + if (!Array.isArray(message.endTimeWindows)) + return "endTimeWindows: array expected"; + for (var i = 0; i < message.endTimeWindows.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.TimeWindow.verify(message.endTimeWindows[i]); + if (error) + return "endTimeWindows." + error; + } + } + if (message.travelDurationMultiple != null && message.hasOwnProperty("travelDurationMultiple")) { + properties._travelDurationMultiple = 1; + if (typeof message.travelDurationMultiple !== "number") + return "travelDurationMultiple: number expected"; + } + if (message.unloadingPolicy != null && message.hasOwnProperty("unloadingPolicy")) + switch (message.unloadingPolicy) { + default: + return "unloadingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.loadLimits != null && message.hasOwnProperty("loadLimits")) { + if (!$util.isObject(message.loadLimits)) + return "loadLimits: object expected"; + var key = Object.keys(message.loadLimits); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.verify(message.loadLimits[key[i]]); + if (error) + return "loadLimits." + error; + } + } + if (message.costPerHour != null && message.hasOwnProperty("costPerHour")) + if (typeof message.costPerHour !== "number") + return "costPerHour: number expected"; + if (message.costPerTraveledHour != null && message.hasOwnProperty("costPerTraveledHour")) + if (typeof message.costPerTraveledHour !== "number") + return "costPerTraveledHour: number expected"; + if (message.costPerKilometer != null && message.hasOwnProperty("costPerKilometer")) + if (typeof message.costPerKilometer !== "number") + return "costPerKilometer: number expected"; + if (message.fixedCost != null && message.hasOwnProperty("fixedCost")) + if (typeof message.fixedCost !== "number") + return "fixedCost: number expected"; + if (message.usedIfRouteIsEmpty != null && message.hasOwnProperty("usedIfRouteIsEmpty")) + if (typeof message.usedIfRouteIsEmpty !== "boolean") + return "usedIfRouteIsEmpty: boolean expected"; + if (message.routeDurationLimit != null && message.hasOwnProperty("routeDurationLimit")) { + var error = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.verify(message.routeDurationLimit); + if (error) + return "routeDurationLimit." + error; + } + if (message.travelDurationLimit != null && message.hasOwnProperty("travelDurationLimit")) { + var error = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.verify(message.travelDurationLimit); + if (error) + return "travelDurationLimit." + error; + } + if (message.routeDistanceLimit != null && message.hasOwnProperty("routeDistanceLimit")) { + var error = $root.google.maps.routeoptimization.v1.DistanceLimit.verify(message.routeDistanceLimit); + if (error) + return "routeDistanceLimit." + error; + } + if (message.extraVisitDurationForVisitType != null && message.hasOwnProperty("extraVisitDurationForVisitType")) { + if (!$util.isObject(message.extraVisitDurationForVisitType)) + return "extraVisitDurationForVisitType: object expected"; + var key = Object.keys(message.extraVisitDurationForVisitType); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Duration.verify(message.extraVisitDurationForVisitType[key[i]]); + if (error) + return "extraVisitDurationForVisitType." + error; + } + } + if (message.breakRule != null && message.hasOwnProperty("breakRule")) { + var error = $root.google.maps.routeoptimization.v1.BreakRule.verify(message.breakRule); + if (error) + return "breakRule." + error; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.ignore != null && message.hasOwnProperty("ignore")) + if (typeof message.ignore !== "boolean") + return "ignore: boolean expected"; + return null; + }; + + /** + * Creates a Vehicle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Vehicle} Vehicle + */ + Vehicle.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Vehicle) + return object; + var message = new $root.google.maps.routeoptimization.v1.Vehicle(); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.travelMode) { + default: + if (typeof object.travelMode === "number") { + message.travelMode = object.travelMode; + break; + } + break; + case "TRAVEL_MODE_UNSPECIFIED": + case 0: + message.travelMode = 0; + break; + case "DRIVING": + case 1: + message.travelMode = 1; + break; + case "WALKING": + case 2: + message.travelMode = 2; + break; + } + if (object.startLocation != null) { + if (typeof object.startLocation !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.startLocation: object expected"); + message.startLocation = $root.google.type.LatLng.fromObject(object.startLocation); + } + if (object.startWaypoint != null) { + if (typeof object.startWaypoint !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.startWaypoint: object expected"); + message.startWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.fromObject(object.startWaypoint); + } + if (object.endLocation != null) { + if (typeof object.endLocation !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.endLocation: object expected"); + message.endLocation = $root.google.type.LatLng.fromObject(object.endLocation); + } + if (object.endWaypoint != null) { + if (typeof object.endWaypoint !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.endWaypoint: object expected"); + message.endWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.fromObject(object.endWaypoint); + } + if (object.startTags) { + if (!Array.isArray(object.startTags)) + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.startTags: array expected"); + message.startTags = []; + for (var i = 0; i < object.startTags.length; ++i) + message.startTags[i] = String(object.startTags[i]); + } + if (object.endTags) { + if (!Array.isArray(object.endTags)) + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.endTags: array expected"); + message.endTags = []; + for (var i = 0; i < object.endTags.length; ++i) + message.endTags[i] = String(object.endTags[i]); + } + if (object.startTimeWindows) { + if (!Array.isArray(object.startTimeWindows)) + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.startTimeWindows: array expected"); + message.startTimeWindows = []; + for (var i = 0; i < object.startTimeWindows.length; ++i) { + if (typeof object.startTimeWindows[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.startTimeWindows: object expected"); + message.startTimeWindows[i] = $root.google.maps.routeoptimization.v1.TimeWindow.fromObject(object.startTimeWindows[i]); + } + } + if (object.endTimeWindows) { + if (!Array.isArray(object.endTimeWindows)) + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.endTimeWindows: array expected"); + message.endTimeWindows = []; + for (var i = 0; i < object.endTimeWindows.length; ++i) { + if (typeof object.endTimeWindows[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.endTimeWindows: object expected"); + message.endTimeWindows[i] = $root.google.maps.routeoptimization.v1.TimeWindow.fromObject(object.endTimeWindows[i]); + } + } + if (object.travelDurationMultiple != null) + message.travelDurationMultiple = Number(object.travelDurationMultiple); + switch (object.unloadingPolicy) { + default: + if (typeof object.unloadingPolicy === "number") { + message.unloadingPolicy = object.unloadingPolicy; + break; + } + break; + case "UNLOADING_POLICY_UNSPECIFIED": + case 0: + message.unloadingPolicy = 0; + break; + case "LAST_IN_FIRST_OUT": + case 1: + message.unloadingPolicy = 1; + break; + case "FIRST_IN_FIRST_OUT": + case 2: + message.unloadingPolicy = 2; + break; + } + if (object.loadLimits) { + if (typeof object.loadLimits !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.loadLimits: object expected"); + message.loadLimits = {}; + for (var keys = Object.keys(object.loadLimits), i = 0; i < keys.length; ++i) { + if (typeof object.loadLimits[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.loadLimits: object expected"); + message.loadLimits[keys[i]] = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.fromObject(object.loadLimits[keys[i]]); + } + } + if (object.costPerHour != null) + message.costPerHour = Number(object.costPerHour); + if (object.costPerTraveledHour != null) + message.costPerTraveledHour = Number(object.costPerTraveledHour); + if (object.costPerKilometer != null) + message.costPerKilometer = Number(object.costPerKilometer); + if (object.fixedCost != null) + message.fixedCost = Number(object.fixedCost); + if (object.usedIfRouteIsEmpty != null) + message.usedIfRouteIsEmpty = Boolean(object.usedIfRouteIsEmpty); + if (object.routeDurationLimit != null) { + if (typeof object.routeDurationLimit !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.routeDurationLimit: object expected"); + message.routeDurationLimit = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.fromObject(object.routeDurationLimit); + } + if (object.travelDurationLimit != null) { + if (typeof object.travelDurationLimit !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.travelDurationLimit: object expected"); + message.travelDurationLimit = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.fromObject(object.travelDurationLimit); + } + if (object.routeDistanceLimit != null) { + if (typeof object.routeDistanceLimit !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.routeDistanceLimit: object expected"); + message.routeDistanceLimit = $root.google.maps.routeoptimization.v1.DistanceLimit.fromObject(object.routeDistanceLimit); + } + if (object.extraVisitDurationForVisitType) { + if (typeof object.extraVisitDurationForVisitType !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.extraVisitDurationForVisitType: object expected"); + message.extraVisitDurationForVisitType = {}; + for (var keys = Object.keys(object.extraVisitDurationForVisitType), i = 0; i < keys.length; ++i) { + if (typeof object.extraVisitDurationForVisitType[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.extraVisitDurationForVisitType: object expected"); + message.extraVisitDurationForVisitType[keys[i]] = $root.google.protobuf.Duration.fromObject(object.extraVisitDurationForVisitType[keys[i]]); + } + } + if (object.breakRule != null) { + if (typeof object.breakRule !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.breakRule: object expected"); + message.breakRule = $root.google.maps.routeoptimization.v1.BreakRule.fromObject(object.breakRule); + } + if (object.label != null) + message.label = String(object.label); + if (object.ignore != null) + message.ignore = Boolean(object.ignore); + return message; + }; + + /** + * Creates a plain object from a Vehicle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {google.maps.routeoptimization.v1.Vehicle} message Vehicle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vehicle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startTags = []; + object.endTags = []; + object.startTimeWindows = []; + object.endTimeWindows = []; + } + if (options.objects || options.defaults) { + object.extraVisitDurationForVisitType = {}; + object.loadLimits = {}; + } + if (options.defaults) { + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + object.startLocation = null; + object.startWaypoint = null; + object.endLocation = null; + object.endWaypoint = null; + object.unloadingPolicy = options.enums === String ? "UNLOADING_POLICY_UNSPECIFIED" : 0; + object.costPerHour = 0; + object.costPerTraveledHour = 0; + object.costPerKilometer = 0; + object.fixedCost = 0; + object.usedIfRouteIsEmpty = false; + object.routeDurationLimit = null; + object.travelDurationLimit = null; + object.routeDistanceLimit = null; + object.breakRule = null; + object.label = ""; + object.ignore = false; + object.displayName = ""; + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routeoptimization.v1.Vehicle.TravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routeoptimization.v1.Vehicle.TravelMode[message.travelMode] : message.travelMode; + if (message.startLocation != null && message.hasOwnProperty("startLocation")) + object.startLocation = $root.google.type.LatLng.toObject(message.startLocation, options); + if (message.startWaypoint != null && message.hasOwnProperty("startWaypoint")) + object.startWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.toObject(message.startWaypoint, options); + if (message.endLocation != null && message.hasOwnProperty("endLocation")) + object.endLocation = $root.google.type.LatLng.toObject(message.endLocation, options); + if (message.endWaypoint != null && message.hasOwnProperty("endWaypoint")) + object.endWaypoint = $root.google.maps.routeoptimization.v1.Waypoint.toObject(message.endWaypoint, options); + if (message.startTags && message.startTags.length) { + object.startTags = []; + for (var j = 0; j < message.startTags.length; ++j) + object.startTags[j] = message.startTags[j]; + } + if (message.endTags && message.endTags.length) { + object.endTags = []; + for (var j = 0; j < message.endTags.length; ++j) + object.endTags[j] = message.endTags[j]; + } + if (message.startTimeWindows && message.startTimeWindows.length) { + object.startTimeWindows = []; + for (var j = 0; j < message.startTimeWindows.length; ++j) + object.startTimeWindows[j] = $root.google.maps.routeoptimization.v1.TimeWindow.toObject(message.startTimeWindows[j], options); + } + if (message.endTimeWindows && message.endTimeWindows.length) { + object.endTimeWindows = []; + for (var j = 0; j < message.endTimeWindows.length; ++j) + object.endTimeWindows[j] = $root.google.maps.routeoptimization.v1.TimeWindow.toObject(message.endTimeWindows[j], options); + } + if (message.travelDurationMultiple != null && message.hasOwnProperty("travelDurationMultiple")) { + object.travelDurationMultiple = options.json && !isFinite(message.travelDurationMultiple) ? String(message.travelDurationMultiple) : message.travelDurationMultiple; + if (options.oneofs) + object._travelDurationMultiple = "travelDurationMultiple"; + } + if (message.unloadingPolicy != null && message.hasOwnProperty("unloadingPolicy")) + object.unloadingPolicy = options.enums === String ? $root.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy[message.unloadingPolicy] === undefined ? message.unloadingPolicy : $root.google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy[message.unloadingPolicy] : message.unloadingPolicy; + if (message.costPerHour != null && message.hasOwnProperty("costPerHour")) + object.costPerHour = options.json && !isFinite(message.costPerHour) ? String(message.costPerHour) : message.costPerHour; + if (message.costPerTraveledHour != null && message.hasOwnProperty("costPerTraveledHour")) + object.costPerTraveledHour = options.json && !isFinite(message.costPerTraveledHour) ? String(message.costPerTraveledHour) : message.costPerTraveledHour; + if (message.costPerKilometer != null && message.hasOwnProperty("costPerKilometer")) + object.costPerKilometer = options.json && !isFinite(message.costPerKilometer) ? String(message.costPerKilometer) : message.costPerKilometer; + if (message.fixedCost != null && message.hasOwnProperty("fixedCost")) + object.fixedCost = options.json && !isFinite(message.fixedCost) ? String(message.fixedCost) : message.fixedCost; + if (message.usedIfRouteIsEmpty != null && message.hasOwnProperty("usedIfRouteIsEmpty")) + object.usedIfRouteIsEmpty = message.usedIfRouteIsEmpty; + if (message.routeDurationLimit != null && message.hasOwnProperty("routeDurationLimit")) + object.routeDurationLimit = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.toObject(message.routeDurationLimit, options); + if (message.travelDurationLimit != null && message.hasOwnProperty("travelDurationLimit")) + object.travelDurationLimit = $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit.toObject(message.travelDurationLimit, options); + if (message.routeDistanceLimit != null && message.hasOwnProperty("routeDistanceLimit")) + object.routeDistanceLimit = $root.google.maps.routeoptimization.v1.DistanceLimit.toObject(message.routeDistanceLimit, options); + var keys2; + if (message.extraVisitDurationForVisitType && (keys2 = Object.keys(message.extraVisitDurationForVisitType)).length) { + object.extraVisitDurationForVisitType = {}; + for (var j = 0; j < keys2.length; ++j) + object.extraVisitDurationForVisitType[keys2[j]] = $root.google.protobuf.Duration.toObject(message.extraVisitDurationForVisitType[keys2[j]], options); + } + if (message.breakRule != null && message.hasOwnProperty("breakRule")) + object.breakRule = $root.google.maps.routeoptimization.v1.BreakRule.toObject(message.breakRule, options); + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.ignore != null && message.hasOwnProperty("ignore")) + object.ignore = message.ignore; + if (message.loadLimits && (keys2 = Object.keys(message.loadLimits)).length) { + object.loadLimits = {}; + for (var j = 0; j < keys2.length; ++j) + object.loadLimits[keys2[j]] = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.toObject(message.loadLimits[keys2[j]], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Vehicle to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Vehicle + * @instance + * @returns {Object.} JSON object + */ + Vehicle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vehicle + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Vehicle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vehicle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Vehicle"; + }; + + /** + * TravelMode enum. + * @name google.maps.routeoptimization.v1.Vehicle.TravelMode + * @enum {number} + * @property {number} TRAVEL_MODE_UNSPECIFIED=0 TRAVEL_MODE_UNSPECIFIED value + * @property {number} DRIVING=1 DRIVING value + * @property {number} WALKING=2 WALKING value + */ + Vehicle.TravelMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAVEL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVING"] = 1; + values[valuesById[2] = "WALKING"] = 2; + return values; + })(); + + /** + * UnloadingPolicy enum. + * @name google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy + * @enum {number} + * @property {number} UNLOADING_POLICY_UNSPECIFIED=0 UNLOADING_POLICY_UNSPECIFIED value + * @property {number} LAST_IN_FIRST_OUT=1 LAST_IN_FIRST_OUT value + * @property {number} FIRST_IN_FIRST_OUT=2 FIRST_IN_FIRST_OUT value + */ + Vehicle.UnloadingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNLOADING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "LAST_IN_FIRST_OUT"] = 1; + values[valuesById[2] = "FIRST_IN_FIRST_OUT"] = 2; + return values; + })(); + + Vehicle.LoadLimit = (function() { + + /** + * Properties of a LoadLimit. + * @memberof google.maps.routeoptimization.v1.Vehicle + * @interface ILoadLimit + * @property {number|Long|null} [maxLoad] LoadLimit maxLoad + * @property {number|Long|null} [softMaxLoad] LoadLimit softMaxLoad + * @property {number|null} [costPerUnitAboveSoftMax] LoadLimit costPerUnitAboveSoftMax + * @property {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null} [startLoadInterval] LoadLimit startLoadInterval + * @property {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null} [endLoadInterval] LoadLimit endLoadInterval + */ + + /** + * Constructs a new LoadLimit. + * @memberof google.maps.routeoptimization.v1.Vehicle + * @classdesc Represents a LoadLimit. + * @implements ILoadLimit + * @constructor + * @param {google.maps.routeoptimization.v1.Vehicle.ILoadLimit=} [properties] Properties to set + */ + function LoadLimit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadLimit maxLoad. + * @member {number|Long|null|undefined} maxLoad + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + */ + LoadLimit.prototype.maxLoad = null; + + /** + * LoadLimit softMaxLoad. + * @member {number|Long} softMaxLoad + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + */ + LoadLimit.prototype.softMaxLoad = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LoadLimit costPerUnitAboveSoftMax. + * @member {number} costPerUnitAboveSoftMax + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + */ + LoadLimit.prototype.costPerUnitAboveSoftMax = 0; + + /** + * LoadLimit startLoadInterval. + * @member {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null|undefined} startLoadInterval + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + */ + LoadLimit.prototype.startLoadInterval = null; + + /** + * LoadLimit endLoadInterval. + * @member {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval|null|undefined} endLoadInterval + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + */ + LoadLimit.prototype.endLoadInterval = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LoadLimit _maxLoad. + * @member {"maxLoad"|undefined} _maxLoad + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + */ + Object.defineProperty(LoadLimit.prototype, "_maxLoad", { + get: $util.oneOfGetter($oneOfFields = ["maxLoad"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LoadLimit instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.ILoadLimit=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit} LoadLimit instance + */ + LoadLimit.create = function create(properties) { + return new LoadLimit(properties); + }; + + /** + * Encodes the specified LoadLimit message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.ILoadLimit} message LoadLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxLoad != null && Object.hasOwnProperty.call(message, "maxLoad")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxLoad); + if (message.softMaxLoad != null && Object.hasOwnProperty.call(message, "softMaxLoad")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.softMaxLoad); + if (message.costPerUnitAboveSoftMax != null && Object.hasOwnProperty.call(message, "costPerUnitAboveSoftMax")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.costPerUnitAboveSoftMax); + if (message.startLoadInterval != null && Object.hasOwnProperty.call(message, "startLoadInterval")) + $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.encode(message.startLoadInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endLoadInterval != null && Object.hasOwnProperty.call(message, "endLoadInterval")) + $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.encode(message.endLoadInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoadLimit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.ILoadLimit} message LoadLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadLimit message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit} LoadLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadLimit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxLoad = reader.int64(); + break; + } + case 2: { + message.softMaxLoad = reader.int64(); + break; + } + case 3: { + message.costPerUnitAboveSoftMax = reader.double(); + break; + } + case 4: { + message.startLoadInterval = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endLoadInterval = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoadLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit} LoadLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadLimit message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxLoad != null && message.hasOwnProperty("maxLoad")) { + properties._maxLoad = 1; + if (!$util.isInteger(message.maxLoad) && !(message.maxLoad && $util.isInteger(message.maxLoad.low) && $util.isInteger(message.maxLoad.high))) + return "maxLoad: integer|Long expected"; + } + if (message.softMaxLoad != null && message.hasOwnProperty("softMaxLoad")) + if (!$util.isInteger(message.softMaxLoad) && !(message.softMaxLoad && $util.isInteger(message.softMaxLoad.low) && $util.isInteger(message.softMaxLoad.high))) + return "softMaxLoad: integer|Long expected"; + if (message.costPerUnitAboveSoftMax != null && message.hasOwnProperty("costPerUnitAboveSoftMax")) + if (typeof message.costPerUnitAboveSoftMax !== "number") + return "costPerUnitAboveSoftMax: number expected"; + if (message.startLoadInterval != null && message.hasOwnProperty("startLoadInterval")) { + var error = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.verify(message.startLoadInterval); + if (error) + return "startLoadInterval." + error; + } + if (message.endLoadInterval != null && message.hasOwnProperty("endLoadInterval")) { + var error = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.verify(message.endLoadInterval); + if (error) + return "endLoadInterval." + error; + } + return null; + }; + + /** + * Creates a LoadLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit} LoadLimit + */ + LoadLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit) + return object; + var message = new $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit(); + if (object.maxLoad != null) + if ($util.Long) + (message.maxLoad = $util.Long.fromValue(object.maxLoad)).unsigned = false; + else if (typeof object.maxLoad === "string") + message.maxLoad = parseInt(object.maxLoad, 10); + else if (typeof object.maxLoad === "number") + message.maxLoad = object.maxLoad; + else if (typeof object.maxLoad === "object") + message.maxLoad = new $util.LongBits(object.maxLoad.low >>> 0, object.maxLoad.high >>> 0).toNumber(); + if (object.softMaxLoad != null) + if ($util.Long) + (message.softMaxLoad = $util.Long.fromValue(object.softMaxLoad)).unsigned = false; + else if (typeof object.softMaxLoad === "string") + message.softMaxLoad = parseInt(object.softMaxLoad, 10); + else if (typeof object.softMaxLoad === "number") + message.softMaxLoad = object.softMaxLoad; + else if (typeof object.softMaxLoad === "object") + message.softMaxLoad = new $util.LongBits(object.softMaxLoad.low >>> 0, object.softMaxLoad.high >>> 0).toNumber(); + if (object.costPerUnitAboveSoftMax != null) + message.costPerUnitAboveSoftMax = Number(object.costPerUnitAboveSoftMax); + if (object.startLoadInterval != null) { + if (typeof object.startLoadInterval !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.LoadLimit.startLoadInterval: object expected"); + message.startLoadInterval = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.fromObject(object.startLoadInterval); + } + if (object.endLoadInterval != null) { + if (typeof object.endLoadInterval !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.LoadLimit.endLoadInterval: object expected"); + message.endLoadInterval = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.fromObject(object.endLoadInterval); + } + return message; + }; + + /** + * Creates a plain object from a LoadLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.LoadLimit} message LoadLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadLimit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.softMaxLoad = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.softMaxLoad = options.longs === String ? "0" : 0; + object.costPerUnitAboveSoftMax = 0; + object.startLoadInterval = null; + object.endLoadInterval = null; + } + if (message.maxLoad != null && message.hasOwnProperty("maxLoad")) { + if (typeof message.maxLoad === "number") + object.maxLoad = options.longs === String ? String(message.maxLoad) : message.maxLoad; + else + object.maxLoad = options.longs === String ? $util.Long.prototype.toString.call(message.maxLoad) : options.longs === Number ? new $util.LongBits(message.maxLoad.low >>> 0, message.maxLoad.high >>> 0).toNumber() : message.maxLoad; + if (options.oneofs) + object._maxLoad = "maxLoad"; + } + if (message.softMaxLoad != null && message.hasOwnProperty("softMaxLoad")) + if (typeof message.softMaxLoad === "number") + object.softMaxLoad = options.longs === String ? String(message.softMaxLoad) : message.softMaxLoad; + else + object.softMaxLoad = options.longs === String ? $util.Long.prototype.toString.call(message.softMaxLoad) : options.longs === Number ? new $util.LongBits(message.softMaxLoad.low >>> 0, message.softMaxLoad.high >>> 0).toNumber() : message.softMaxLoad; + if (message.costPerUnitAboveSoftMax != null && message.hasOwnProperty("costPerUnitAboveSoftMax")) + object.costPerUnitAboveSoftMax = options.json && !isFinite(message.costPerUnitAboveSoftMax) ? String(message.costPerUnitAboveSoftMax) : message.costPerUnitAboveSoftMax; + if (message.startLoadInterval != null && message.hasOwnProperty("startLoadInterval")) + object.startLoadInterval = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.toObject(message.startLoadInterval, options); + if (message.endLoadInterval != null && message.hasOwnProperty("endLoadInterval")) + object.endLoadInterval = $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.toObject(message.endLoadInterval, options); + return object; + }; + + /** + * Converts this LoadLimit to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @instance + * @returns {Object.} JSON object + */ + LoadLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadLimit + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Vehicle.LoadLimit"; + }; + + LoadLimit.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @interface IInterval + * @property {number|Long|null} [min] Interval min + * @property {number|Long|null} [max] Interval max + */ + + /** + * Constructs a new Interval. + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval=} [properties] Properties to set + */ + function Interval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interval min. + * @member {number|Long} min + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @instance + */ + Interval.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Interval max. + * @member {number|Long|null|undefined} max + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @instance + */ + Interval.prototype.max = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Interval _max. + * @member {"max"|undefined} _max + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @instance + */ + Object.defineProperty(Interval.prototype, "_max", { + get: $util.oneOfGetter($oneOfFields = ["max"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.max); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.LoadLimit.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.min = reader.int64(); + break; + } + case 2: { + message.max = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.min != null && message.hasOwnProperty("min")) + if (!$util.isInteger(message.min) && !(message.min && $util.isInteger(message.min.low) && $util.isInteger(message.min.high))) + return "min: integer|Long expected"; + if (message.max != null && message.hasOwnProperty("max")) { + properties._max = 1; + if (!$util.isInteger(message.max) && !(message.max && $util.isInteger(message.max.low) && $util.isInteger(message.max.high))) + return "max: integer|Long expected"; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval) + return object; + var message = new $root.google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval(); + if (object.min != null) + if ($util.Long) + (message.min = $util.Long.fromValue(object.min)).unsigned = false; + else if (typeof object.min === "string") + message.min = parseInt(object.min, 10); + else if (typeof object.min === "number") + message.min = object.min; + else if (typeof object.min === "object") + message.min = new $util.LongBits(object.min.low >>> 0, object.min.high >>> 0).toNumber(); + if (object.max != null) + if ($util.Long) + (message.max = $util.Long.fromValue(object.max)).unsigned = false; + else if (typeof object.max === "string") + message.max = parseInt(object.max, 10); + else if (typeof object.max === "number") + message.max = object.max; + else if (typeof object.max === "object") + message.max = new $util.LongBits(object.max.low >>> 0, object.max.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.min = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.min = options.longs === String ? "0" : 0; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min === "number") + object.min = options.longs === String ? String(message.min) : message.min; + else + object.min = options.longs === String ? $util.Long.prototype.toString.call(message.min) : options.longs === Number ? new $util.LongBits(message.min.low >>> 0, message.min.high >>> 0).toNumber() : message.min; + if (message.max != null && message.hasOwnProperty("max")) { + if (typeof message.max === "number") + object.max = options.longs === String ? String(message.max) : message.max; + else + object.max = options.longs === String ? $util.Long.prototype.toString.call(message.max) : options.longs === Number ? new $util.LongBits(message.max.low >>> 0, message.max.high >>> 0).toNumber() : message.max; + if (options.oneofs) + object._max = "max"; + } + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval"; + }; + + return Interval; + })(); + + return LoadLimit; + })(); + + Vehicle.DurationLimit = (function() { + + /** + * Properties of a DurationLimit. + * @memberof google.maps.routeoptimization.v1.Vehicle + * @interface IDurationLimit + * @property {google.protobuf.IDuration|null} [maxDuration] DurationLimit maxDuration + * @property {google.protobuf.IDuration|null} [softMaxDuration] DurationLimit softMaxDuration + * @property {number|null} [costPerHourAfterSoftMax] DurationLimit costPerHourAfterSoftMax + * @property {google.protobuf.IDuration|null} [quadraticSoftMaxDuration] DurationLimit quadraticSoftMaxDuration + * @property {number|null} [costPerSquareHourAfterQuadraticSoftMax] DurationLimit costPerSquareHourAfterQuadraticSoftMax + */ + + /** + * Constructs a new DurationLimit. + * @memberof google.maps.routeoptimization.v1.Vehicle + * @classdesc Represents a DurationLimit. + * @implements IDurationLimit + * @constructor + * @param {google.maps.routeoptimization.v1.Vehicle.IDurationLimit=} [properties] Properties to set + */ + function DurationLimit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DurationLimit maxDuration. + * @member {google.protobuf.IDuration|null|undefined} maxDuration + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + DurationLimit.prototype.maxDuration = null; + + /** + * DurationLimit softMaxDuration. + * @member {google.protobuf.IDuration|null|undefined} softMaxDuration + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + DurationLimit.prototype.softMaxDuration = null; + + /** + * DurationLimit costPerHourAfterSoftMax. + * @member {number|null|undefined} costPerHourAfterSoftMax + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + DurationLimit.prototype.costPerHourAfterSoftMax = null; + + /** + * DurationLimit quadraticSoftMaxDuration. + * @member {google.protobuf.IDuration|null|undefined} quadraticSoftMaxDuration + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + DurationLimit.prototype.quadraticSoftMaxDuration = null; + + /** + * DurationLimit costPerSquareHourAfterQuadraticSoftMax. + * @member {number|null|undefined} costPerSquareHourAfterQuadraticSoftMax + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + DurationLimit.prototype.costPerSquareHourAfterQuadraticSoftMax = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DurationLimit _costPerHourAfterSoftMax. + * @member {"costPerHourAfterSoftMax"|undefined} _costPerHourAfterSoftMax + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + Object.defineProperty(DurationLimit.prototype, "_costPerHourAfterSoftMax", { + get: $util.oneOfGetter($oneOfFields = ["costPerHourAfterSoftMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DurationLimit _costPerSquareHourAfterQuadraticSoftMax. + * @member {"costPerSquareHourAfterQuadraticSoftMax"|undefined} _costPerSquareHourAfterQuadraticSoftMax + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + */ + Object.defineProperty(DurationLimit.prototype, "_costPerSquareHourAfterQuadraticSoftMax", { + get: $util.oneOfGetter($oneOfFields = ["costPerSquareHourAfterQuadraticSoftMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DurationLimit instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.IDurationLimit=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Vehicle.DurationLimit} DurationLimit instance + */ + DurationLimit.create = function create(properties) { + return new DurationLimit(properties); + }; + + /** + * Encodes the specified DurationLimit message. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.DurationLimit.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.IDurationLimit} message DurationLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DurationLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxDuration != null && Object.hasOwnProperty.call(message, "maxDuration")) + $root.google.protobuf.Duration.encode(message.maxDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.softMaxDuration != null && Object.hasOwnProperty.call(message, "softMaxDuration")) + $root.google.protobuf.Duration.encode(message.softMaxDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.costPerHourAfterSoftMax != null && Object.hasOwnProperty.call(message, "costPerHourAfterSoftMax")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.costPerHourAfterSoftMax); + if (message.quadraticSoftMaxDuration != null && Object.hasOwnProperty.call(message, "quadraticSoftMaxDuration")) + $root.google.protobuf.Duration.encode(message.quadraticSoftMaxDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.costPerSquareHourAfterQuadraticSoftMax != null && Object.hasOwnProperty.call(message, "costPerSquareHourAfterQuadraticSoftMax")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.costPerSquareHourAfterQuadraticSoftMax); + return writer; + }; + + /** + * Encodes the specified DurationLimit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Vehicle.DurationLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.IDurationLimit} message DurationLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DurationLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DurationLimit message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Vehicle.DurationLimit} DurationLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DurationLimit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.softMaxDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.costPerHourAfterSoftMax = reader.double(); + break; + } + case 4: { + message.quadraticSoftMaxDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.costPerSquareHourAfterQuadraticSoftMax = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DurationLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Vehicle.DurationLimit} DurationLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DurationLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DurationLimit message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DurationLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxDuration); + if (error) + return "maxDuration." + error; + } + if (message.softMaxDuration != null && message.hasOwnProperty("softMaxDuration")) { + var error = $root.google.protobuf.Duration.verify(message.softMaxDuration); + if (error) + return "softMaxDuration." + error; + } + if (message.costPerHourAfterSoftMax != null && message.hasOwnProperty("costPerHourAfterSoftMax")) { + properties._costPerHourAfterSoftMax = 1; + if (typeof message.costPerHourAfterSoftMax !== "number") + return "costPerHourAfterSoftMax: number expected"; + } + if (message.quadraticSoftMaxDuration != null && message.hasOwnProperty("quadraticSoftMaxDuration")) { + var error = $root.google.protobuf.Duration.verify(message.quadraticSoftMaxDuration); + if (error) + return "quadraticSoftMaxDuration." + error; + } + if (message.costPerSquareHourAfterQuadraticSoftMax != null && message.hasOwnProperty("costPerSquareHourAfterQuadraticSoftMax")) { + properties._costPerSquareHourAfterQuadraticSoftMax = 1; + if (typeof message.costPerSquareHourAfterQuadraticSoftMax !== "number") + return "costPerSquareHourAfterQuadraticSoftMax: number expected"; + } + return null; + }; + + /** + * Creates a DurationLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Vehicle.DurationLimit} DurationLimit + */ + DurationLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit) + return object; + var message = new $root.google.maps.routeoptimization.v1.Vehicle.DurationLimit(); + if (object.maxDuration != null) { + if (typeof object.maxDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.DurationLimit.maxDuration: object expected"); + message.maxDuration = $root.google.protobuf.Duration.fromObject(object.maxDuration); + } + if (object.softMaxDuration != null) { + if (typeof object.softMaxDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.DurationLimit.softMaxDuration: object expected"); + message.softMaxDuration = $root.google.protobuf.Duration.fromObject(object.softMaxDuration); + } + if (object.costPerHourAfterSoftMax != null) + message.costPerHourAfterSoftMax = Number(object.costPerHourAfterSoftMax); + if (object.quadraticSoftMaxDuration != null) { + if (typeof object.quadraticSoftMaxDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Vehicle.DurationLimit.quadraticSoftMaxDuration: object expected"); + message.quadraticSoftMaxDuration = $root.google.protobuf.Duration.fromObject(object.quadraticSoftMaxDuration); + } + if (object.costPerSquareHourAfterQuadraticSoftMax != null) + message.costPerSquareHourAfterQuadraticSoftMax = Number(object.costPerSquareHourAfterQuadraticSoftMax); + return message; + }; + + /** + * Creates a plain object from a DurationLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {google.maps.routeoptimization.v1.Vehicle.DurationLimit} message DurationLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DurationLimit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxDuration = null; + object.softMaxDuration = null; + object.quadraticSoftMaxDuration = null; + } + if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) + object.maxDuration = $root.google.protobuf.Duration.toObject(message.maxDuration, options); + if (message.softMaxDuration != null && message.hasOwnProperty("softMaxDuration")) + object.softMaxDuration = $root.google.protobuf.Duration.toObject(message.softMaxDuration, options); + if (message.costPerHourAfterSoftMax != null && message.hasOwnProperty("costPerHourAfterSoftMax")) { + object.costPerHourAfterSoftMax = options.json && !isFinite(message.costPerHourAfterSoftMax) ? String(message.costPerHourAfterSoftMax) : message.costPerHourAfterSoftMax; + if (options.oneofs) + object._costPerHourAfterSoftMax = "costPerHourAfterSoftMax"; + } + if (message.quadraticSoftMaxDuration != null && message.hasOwnProperty("quadraticSoftMaxDuration")) + object.quadraticSoftMaxDuration = $root.google.protobuf.Duration.toObject(message.quadraticSoftMaxDuration, options); + if (message.costPerSquareHourAfterQuadraticSoftMax != null && message.hasOwnProperty("costPerSquareHourAfterQuadraticSoftMax")) { + object.costPerSquareHourAfterQuadraticSoftMax = options.json && !isFinite(message.costPerSquareHourAfterQuadraticSoftMax) ? String(message.costPerSquareHourAfterQuadraticSoftMax) : message.costPerSquareHourAfterQuadraticSoftMax; + if (options.oneofs) + object._costPerSquareHourAfterQuadraticSoftMax = "costPerSquareHourAfterQuadraticSoftMax"; + } + return object; + }; + + /** + * Converts this DurationLimit to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @instance + * @returns {Object.} JSON object + */ + DurationLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DurationLimit + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Vehicle.DurationLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DurationLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Vehicle.DurationLimit"; + }; + + return DurationLimit; + })(); + + return Vehicle; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.maps.routeoptimization.v1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @property {google.protobuf.ITimestamp|null} [softStartTime] TimeWindow softStartTime + * @property {google.protobuf.ITimestamp|null} [softEndTime] TimeWindow softEndTime + * @property {number|null} [costPerHourBeforeSoftStartTime] TimeWindow costPerHourBeforeSoftStartTime + * @property {number|null} [costPerHourAfterSoftEndTime] TimeWindow costPerHourAfterSoftEndTime + */ + + /** + * Constructs a new TimeWindow. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.maps.routeoptimization.v1.ITimeWindow=} [properties] Properties to set + */ + function TimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * TimeWindow softStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} softStartTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.softStartTime = null; + + /** + * TimeWindow softEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} softEndTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.softEndTime = null; + + /** + * TimeWindow costPerHourBeforeSoftStartTime. + * @member {number|null|undefined} costPerHourBeforeSoftStartTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.costPerHourBeforeSoftStartTime = null; + + /** + * TimeWindow costPerHourAfterSoftEndTime. + * @member {number|null|undefined} costPerHourAfterSoftEndTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.costPerHourAfterSoftEndTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TimeWindow _costPerHourBeforeSoftStartTime. + * @member {"costPerHourBeforeSoftStartTime"|undefined} _costPerHourBeforeSoftStartTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + Object.defineProperty(TimeWindow.prototype, "_costPerHourBeforeSoftStartTime", { + get: $util.oneOfGetter($oneOfFields = ["costPerHourBeforeSoftStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TimeWindow _costPerHourAfterSoftEndTime. + * @member {"costPerHourAfterSoftEndTime"|undefined} _costPerHourAfterSoftEndTime + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + */ + Object.defineProperty(TimeWindow.prototype, "_costPerHourAfterSoftEndTime", { + get: $util.oneOfGetter($oneOfFields = ["costPerHourAfterSoftEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {google.maps.routeoptimization.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.maps.routeoptimization.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {google.maps.routeoptimization.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.softStartTime != null && Object.hasOwnProperty.call(message, "softStartTime")) + $root.google.protobuf.Timestamp.encode(message.softStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.softEndTime != null && Object.hasOwnProperty.call(message, "softEndTime")) + $root.google.protobuf.Timestamp.encode(message.softEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.costPerHourBeforeSoftStartTime != null && Object.hasOwnProperty.call(message, "costPerHourBeforeSoftStartTime")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.costPerHourBeforeSoftStartTime); + if (message.costPerHourAfterSoftEndTime != null && Object.hasOwnProperty.call(message, "costPerHourAfterSoftEndTime")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.costPerHourAfterSoftEndTime); + return writer; + }; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {google.maps.routeoptimization.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.TimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.softStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.softEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.costPerHourBeforeSoftStartTime = reader.double(); + break; + } + case 6: { + message.costPerHourAfterSoftEndTime = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.softStartTime != null && message.hasOwnProperty("softStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.softStartTime); + if (error) + return "softStartTime." + error; + } + if (message.softEndTime != null && message.hasOwnProperty("softEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.softEndTime); + if (error) + return "softEndTime." + error; + } + if (message.costPerHourBeforeSoftStartTime != null && message.hasOwnProperty("costPerHourBeforeSoftStartTime")) { + properties._costPerHourBeforeSoftStartTime = 1; + if (typeof message.costPerHourBeforeSoftStartTime !== "number") + return "costPerHourBeforeSoftStartTime: number expected"; + } + if (message.costPerHourAfterSoftEndTime != null && message.hasOwnProperty("costPerHourAfterSoftEndTime")) { + properties._costPerHourAfterSoftEndTime = 1; + if (typeof message.costPerHourAfterSoftEndTime !== "number") + return "costPerHourAfterSoftEndTime: number expected"; + } + return null; + }; + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.TimeWindow) + return object; + var message = new $root.google.maps.routeoptimization.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.softStartTime != null) { + if (typeof object.softStartTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.TimeWindow.softStartTime: object expected"); + message.softStartTime = $root.google.protobuf.Timestamp.fromObject(object.softStartTime); + } + if (object.softEndTime != null) { + if (typeof object.softEndTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.TimeWindow.softEndTime: object expected"); + message.softEndTime = $root.google.protobuf.Timestamp.fromObject(object.softEndTime); + } + if (object.costPerHourBeforeSoftStartTime != null) + message.costPerHourBeforeSoftStartTime = Number(object.costPerHourBeforeSoftStartTime); + if (object.costPerHourAfterSoftEndTime != null) + message.costPerHourAfterSoftEndTime = Number(object.costPerHourAfterSoftEndTime); + return message; + }; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {google.maps.routeoptimization.v1.TimeWindow} message TimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.softStartTime = null; + object.softEndTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.softStartTime != null && message.hasOwnProperty("softStartTime")) + object.softStartTime = $root.google.protobuf.Timestamp.toObject(message.softStartTime, options); + if (message.softEndTime != null && message.hasOwnProperty("softEndTime")) + object.softEndTime = $root.google.protobuf.Timestamp.toObject(message.softEndTime, options); + if (message.costPerHourBeforeSoftStartTime != null && message.hasOwnProperty("costPerHourBeforeSoftStartTime")) { + object.costPerHourBeforeSoftStartTime = options.json && !isFinite(message.costPerHourBeforeSoftStartTime) ? String(message.costPerHourBeforeSoftStartTime) : message.costPerHourBeforeSoftStartTime; + if (options.oneofs) + object._costPerHourBeforeSoftStartTime = "costPerHourBeforeSoftStartTime"; + } + if (message.costPerHourAfterSoftEndTime != null && message.hasOwnProperty("costPerHourAfterSoftEndTime")) { + object.costPerHourAfterSoftEndTime = options.json && !isFinite(message.costPerHourAfterSoftEndTime) ? String(message.costPerHourAfterSoftEndTime) : message.costPerHourAfterSoftEndTime; + if (options.oneofs) + object._costPerHourAfterSoftEndTime = "costPerHourAfterSoftEndTime"; + } + return object; + }; + + /** + * Converts this TimeWindow to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.TimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.TimeWindow"; + }; + + return TimeWindow; + })(); + + v1.DistanceLimit = (function() { + + /** + * Properties of a DistanceLimit. + * @memberof google.maps.routeoptimization.v1 + * @interface IDistanceLimit + * @property {number|Long|null} [maxMeters] DistanceLimit maxMeters + * @property {number|Long|null} [softMaxMeters] DistanceLimit softMaxMeters + * @property {number|null} [costPerKilometerAboveSoftMax] DistanceLimit costPerKilometerAboveSoftMax + */ + + /** + * Constructs a new DistanceLimit. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a DistanceLimit. + * @implements IDistanceLimit + * @constructor + * @param {google.maps.routeoptimization.v1.IDistanceLimit=} [properties] Properties to set + */ + function DistanceLimit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DistanceLimit maxMeters. + * @member {number|Long|null|undefined} maxMeters + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + */ + DistanceLimit.prototype.maxMeters = null; + + /** + * DistanceLimit softMaxMeters. + * @member {number|Long|null|undefined} softMaxMeters + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + */ + DistanceLimit.prototype.softMaxMeters = null; + + /** + * DistanceLimit costPerKilometerAboveSoftMax. + * @member {number|null|undefined} costPerKilometerAboveSoftMax + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + */ + DistanceLimit.prototype.costPerKilometerAboveSoftMax = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DistanceLimit _maxMeters. + * @member {"maxMeters"|undefined} _maxMeters + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + */ + Object.defineProperty(DistanceLimit.prototype, "_maxMeters", { + get: $util.oneOfGetter($oneOfFields = ["maxMeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DistanceLimit _softMaxMeters. + * @member {"softMaxMeters"|undefined} _softMaxMeters + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + */ + Object.defineProperty(DistanceLimit.prototype, "_softMaxMeters", { + get: $util.oneOfGetter($oneOfFields = ["softMaxMeters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DistanceLimit _costPerKilometerAboveSoftMax. + * @member {"costPerKilometerAboveSoftMax"|undefined} _costPerKilometerAboveSoftMax + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + */ + Object.defineProperty(DistanceLimit.prototype, "_costPerKilometerAboveSoftMax", { + get: $util.oneOfGetter($oneOfFields = ["costPerKilometerAboveSoftMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DistanceLimit instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {google.maps.routeoptimization.v1.IDistanceLimit=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.DistanceLimit} DistanceLimit instance + */ + DistanceLimit.create = function create(properties) { + return new DistanceLimit(properties); + }; + + /** + * Encodes the specified DistanceLimit message. Does not implicitly {@link google.maps.routeoptimization.v1.DistanceLimit.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {google.maps.routeoptimization.v1.IDistanceLimit} message DistanceLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistanceLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxMeters != null && Object.hasOwnProperty.call(message, "maxMeters")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxMeters); + if (message.softMaxMeters != null && Object.hasOwnProperty.call(message, "softMaxMeters")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.softMaxMeters); + if (message.costPerKilometerAboveSoftMax != null && Object.hasOwnProperty.call(message, "costPerKilometerAboveSoftMax")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.costPerKilometerAboveSoftMax); + return writer; + }; + + /** + * Encodes the specified DistanceLimit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.DistanceLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {google.maps.routeoptimization.v1.IDistanceLimit} message DistanceLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistanceLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DistanceLimit message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.DistanceLimit} DistanceLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistanceLimit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.DistanceLimit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxMeters = reader.int64(); + break; + } + case 2: { + message.softMaxMeters = reader.int64(); + break; + } + case 3: { + message.costPerKilometerAboveSoftMax = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DistanceLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.DistanceLimit} DistanceLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistanceLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DistanceLimit message. + * @function verify + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DistanceLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxMeters != null && message.hasOwnProperty("maxMeters")) { + properties._maxMeters = 1; + if (!$util.isInteger(message.maxMeters) && !(message.maxMeters && $util.isInteger(message.maxMeters.low) && $util.isInteger(message.maxMeters.high))) + return "maxMeters: integer|Long expected"; + } + if (message.softMaxMeters != null && message.hasOwnProperty("softMaxMeters")) { + properties._softMaxMeters = 1; + if (!$util.isInteger(message.softMaxMeters) && !(message.softMaxMeters && $util.isInteger(message.softMaxMeters.low) && $util.isInteger(message.softMaxMeters.high))) + return "softMaxMeters: integer|Long expected"; + } + if (message.costPerKilometerAboveSoftMax != null && message.hasOwnProperty("costPerKilometerAboveSoftMax")) { + properties._costPerKilometerAboveSoftMax = 1; + if (typeof message.costPerKilometerAboveSoftMax !== "number") + return "costPerKilometerAboveSoftMax: number expected"; + } + return null; + }; + + /** + * Creates a DistanceLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.DistanceLimit} DistanceLimit + */ + DistanceLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.DistanceLimit) + return object; + var message = new $root.google.maps.routeoptimization.v1.DistanceLimit(); + if (object.maxMeters != null) + if ($util.Long) + (message.maxMeters = $util.Long.fromValue(object.maxMeters)).unsigned = false; + else if (typeof object.maxMeters === "string") + message.maxMeters = parseInt(object.maxMeters, 10); + else if (typeof object.maxMeters === "number") + message.maxMeters = object.maxMeters; + else if (typeof object.maxMeters === "object") + message.maxMeters = new $util.LongBits(object.maxMeters.low >>> 0, object.maxMeters.high >>> 0).toNumber(); + if (object.softMaxMeters != null) + if ($util.Long) + (message.softMaxMeters = $util.Long.fromValue(object.softMaxMeters)).unsigned = false; + else if (typeof object.softMaxMeters === "string") + message.softMaxMeters = parseInt(object.softMaxMeters, 10); + else if (typeof object.softMaxMeters === "number") + message.softMaxMeters = object.softMaxMeters; + else if (typeof object.softMaxMeters === "object") + message.softMaxMeters = new $util.LongBits(object.softMaxMeters.low >>> 0, object.softMaxMeters.high >>> 0).toNumber(); + if (object.costPerKilometerAboveSoftMax != null) + message.costPerKilometerAboveSoftMax = Number(object.costPerKilometerAboveSoftMax); + return message; + }; + + /** + * Creates a plain object from a DistanceLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {google.maps.routeoptimization.v1.DistanceLimit} message DistanceLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DistanceLimit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.maxMeters != null && message.hasOwnProperty("maxMeters")) { + if (typeof message.maxMeters === "number") + object.maxMeters = options.longs === String ? String(message.maxMeters) : message.maxMeters; + else + object.maxMeters = options.longs === String ? $util.Long.prototype.toString.call(message.maxMeters) : options.longs === Number ? new $util.LongBits(message.maxMeters.low >>> 0, message.maxMeters.high >>> 0).toNumber() : message.maxMeters; + if (options.oneofs) + object._maxMeters = "maxMeters"; + } + if (message.softMaxMeters != null && message.hasOwnProperty("softMaxMeters")) { + if (typeof message.softMaxMeters === "number") + object.softMaxMeters = options.longs === String ? String(message.softMaxMeters) : message.softMaxMeters; + else + object.softMaxMeters = options.longs === String ? $util.Long.prototype.toString.call(message.softMaxMeters) : options.longs === Number ? new $util.LongBits(message.softMaxMeters.low >>> 0, message.softMaxMeters.high >>> 0).toNumber() : message.softMaxMeters; + if (options.oneofs) + object._softMaxMeters = "softMaxMeters"; + } + if (message.costPerKilometerAboveSoftMax != null && message.hasOwnProperty("costPerKilometerAboveSoftMax")) { + object.costPerKilometerAboveSoftMax = options.json && !isFinite(message.costPerKilometerAboveSoftMax) ? String(message.costPerKilometerAboveSoftMax) : message.costPerKilometerAboveSoftMax; + if (options.oneofs) + object._costPerKilometerAboveSoftMax = "costPerKilometerAboveSoftMax"; + } + return object; + }; + + /** + * Converts this DistanceLimit to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @instance + * @returns {Object.} JSON object + */ + DistanceLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DistanceLimit + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.DistanceLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DistanceLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.DistanceLimit"; + }; + + return DistanceLimit; + })(); + + v1.TransitionAttributes = (function() { + + /** + * Properties of a TransitionAttributes. + * @memberof google.maps.routeoptimization.v1 + * @interface ITransitionAttributes + * @property {string|null} [srcTag] TransitionAttributes srcTag + * @property {string|null} [excludedSrcTag] TransitionAttributes excludedSrcTag + * @property {string|null} [dstTag] TransitionAttributes dstTag + * @property {string|null} [excludedDstTag] TransitionAttributes excludedDstTag + * @property {number|null} [cost] TransitionAttributes cost + * @property {number|null} [costPerKilometer] TransitionAttributes costPerKilometer + * @property {google.maps.routeoptimization.v1.IDistanceLimit|null} [distanceLimit] TransitionAttributes distanceLimit + * @property {google.protobuf.IDuration|null} [delay] TransitionAttributes delay + */ + + /** + * Constructs a new TransitionAttributes. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a TransitionAttributes. + * @implements ITransitionAttributes + * @constructor + * @param {google.maps.routeoptimization.v1.ITransitionAttributes=} [properties] Properties to set + */ + function TransitionAttributes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitionAttributes srcTag. + * @member {string} srcTag + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.srcTag = ""; + + /** + * TransitionAttributes excludedSrcTag. + * @member {string} excludedSrcTag + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.excludedSrcTag = ""; + + /** + * TransitionAttributes dstTag. + * @member {string} dstTag + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.dstTag = ""; + + /** + * TransitionAttributes excludedDstTag. + * @member {string} excludedDstTag + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.excludedDstTag = ""; + + /** + * TransitionAttributes cost. + * @member {number} cost + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.cost = 0; + + /** + * TransitionAttributes costPerKilometer. + * @member {number} costPerKilometer + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.costPerKilometer = 0; + + /** + * TransitionAttributes distanceLimit. + * @member {google.maps.routeoptimization.v1.IDistanceLimit|null|undefined} distanceLimit + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.distanceLimit = null; + + /** + * TransitionAttributes delay. + * @member {google.protobuf.IDuration|null|undefined} delay + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + */ + TransitionAttributes.prototype.delay = null; + + /** + * Creates a new TransitionAttributes instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {google.maps.routeoptimization.v1.ITransitionAttributes=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.TransitionAttributes} TransitionAttributes instance + */ + TransitionAttributes.create = function create(properties) { + return new TransitionAttributes(properties); + }; + + /** + * Encodes the specified TransitionAttributes message. Does not implicitly {@link google.maps.routeoptimization.v1.TransitionAttributes.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {google.maps.routeoptimization.v1.ITransitionAttributes} message TransitionAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionAttributes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.srcTag != null && Object.hasOwnProperty.call(message, "srcTag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.srcTag); + if (message.excludedSrcTag != null && Object.hasOwnProperty.call(message, "excludedSrcTag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.excludedSrcTag); + if (message.dstTag != null && Object.hasOwnProperty.call(message, "dstTag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dstTag); + if (message.excludedDstTag != null && Object.hasOwnProperty.call(message, "excludedDstTag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludedDstTag); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.cost); + if (message.costPerKilometer != null && Object.hasOwnProperty.call(message, "costPerKilometer")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.costPerKilometer); + if (message.distanceLimit != null && Object.hasOwnProperty.call(message, "distanceLimit")) + $root.google.maps.routeoptimization.v1.DistanceLimit.encode(message.distanceLimit, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.delay != null && Object.hasOwnProperty.call(message, "delay")) + $root.google.protobuf.Duration.encode(message.delay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitionAttributes message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.TransitionAttributes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {google.maps.routeoptimization.v1.ITransitionAttributes} message TransitionAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitionAttributes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitionAttributes message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.TransitionAttributes} TransitionAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionAttributes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.TransitionAttributes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.srcTag = reader.string(); + break; + } + case 2: { + message.excludedSrcTag = reader.string(); + break; + } + case 3: { + message.dstTag = reader.string(); + break; + } + case 4: { + message.excludedDstTag = reader.string(); + break; + } + case 5: { + message.cost = reader.double(); + break; + } + case 6: { + message.costPerKilometer = reader.double(); + break; + } + case 7: { + message.distanceLimit = $root.google.maps.routeoptimization.v1.DistanceLimit.decode(reader, reader.uint32()); + break; + } + case 8: { + message.delay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitionAttributes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.TransitionAttributes} TransitionAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitionAttributes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitionAttributes message. + * @function verify + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitionAttributes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.srcTag != null && message.hasOwnProperty("srcTag")) + if (!$util.isString(message.srcTag)) + return "srcTag: string expected"; + if (message.excludedSrcTag != null && message.hasOwnProperty("excludedSrcTag")) + if (!$util.isString(message.excludedSrcTag)) + return "excludedSrcTag: string expected"; + if (message.dstTag != null && message.hasOwnProperty("dstTag")) + if (!$util.isString(message.dstTag)) + return "dstTag: string expected"; + if (message.excludedDstTag != null && message.hasOwnProperty("excludedDstTag")) + if (!$util.isString(message.excludedDstTag)) + return "excludedDstTag: string expected"; + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.costPerKilometer != null && message.hasOwnProperty("costPerKilometer")) + if (typeof message.costPerKilometer !== "number") + return "costPerKilometer: number expected"; + if (message.distanceLimit != null && message.hasOwnProperty("distanceLimit")) { + var error = $root.google.maps.routeoptimization.v1.DistanceLimit.verify(message.distanceLimit); + if (error) + return "distanceLimit." + error; + } + if (message.delay != null && message.hasOwnProperty("delay")) { + var error = $root.google.protobuf.Duration.verify(message.delay); + if (error) + return "delay." + error; + } + return null; + }; + + /** + * Creates a TransitionAttributes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.TransitionAttributes} TransitionAttributes + */ + TransitionAttributes.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.TransitionAttributes) + return object; + var message = new $root.google.maps.routeoptimization.v1.TransitionAttributes(); + if (object.srcTag != null) + message.srcTag = String(object.srcTag); + if (object.excludedSrcTag != null) + message.excludedSrcTag = String(object.excludedSrcTag); + if (object.dstTag != null) + message.dstTag = String(object.dstTag); + if (object.excludedDstTag != null) + message.excludedDstTag = String(object.excludedDstTag); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.costPerKilometer != null) + message.costPerKilometer = Number(object.costPerKilometer); + if (object.distanceLimit != null) { + if (typeof object.distanceLimit !== "object") + throw TypeError(".google.maps.routeoptimization.v1.TransitionAttributes.distanceLimit: object expected"); + message.distanceLimit = $root.google.maps.routeoptimization.v1.DistanceLimit.fromObject(object.distanceLimit); + } + if (object.delay != null) { + if (typeof object.delay !== "object") + throw TypeError(".google.maps.routeoptimization.v1.TransitionAttributes.delay: object expected"); + message.delay = $root.google.protobuf.Duration.fromObject(object.delay); + } + return message; + }; + + /** + * Creates a plain object from a TransitionAttributes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {google.maps.routeoptimization.v1.TransitionAttributes} message TransitionAttributes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitionAttributes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.srcTag = ""; + object.excludedSrcTag = ""; + object.dstTag = ""; + object.excludedDstTag = ""; + object.cost = 0; + object.costPerKilometer = 0; + object.distanceLimit = null; + object.delay = null; + } + if (message.srcTag != null && message.hasOwnProperty("srcTag")) + object.srcTag = message.srcTag; + if (message.excludedSrcTag != null && message.hasOwnProperty("excludedSrcTag")) + object.excludedSrcTag = message.excludedSrcTag; + if (message.dstTag != null && message.hasOwnProperty("dstTag")) + object.dstTag = message.dstTag; + if (message.excludedDstTag != null && message.hasOwnProperty("excludedDstTag")) + object.excludedDstTag = message.excludedDstTag; + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.costPerKilometer != null && message.hasOwnProperty("costPerKilometer")) + object.costPerKilometer = options.json && !isFinite(message.costPerKilometer) ? String(message.costPerKilometer) : message.costPerKilometer; + if (message.distanceLimit != null && message.hasOwnProperty("distanceLimit")) + object.distanceLimit = $root.google.maps.routeoptimization.v1.DistanceLimit.toObject(message.distanceLimit, options); + if (message.delay != null && message.hasOwnProperty("delay")) + object.delay = $root.google.protobuf.Duration.toObject(message.delay, options); + return object; + }; + + /** + * Converts this TransitionAttributes to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @instance + * @returns {Object.} JSON object + */ + TransitionAttributes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitionAttributes + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.TransitionAttributes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitionAttributes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.TransitionAttributes"; + }; + + return TransitionAttributes; + })(); + + v1.Waypoint = (function() { + + /** + * Properties of a Waypoint. + * @memberof google.maps.routeoptimization.v1 + * @interface IWaypoint + * @property {google.maps.routeoptimization.v1.ILocation|null} [location] Waypoint location + * @property {string|null} [placeId] Waypoint placeId + * @property {boolean|null} [sideOfRoad] Waypoint sideOfRoad + */ + + /** + * Constructs a new Waypoint. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a Waypoint. + * @implements IWaypoint + * @constructor + * @param {google.maps.routeoptimization.v1.IWaypoint=} [properties] Properties to set + */ + function Waypoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Waypoint location. + * @member {google.maps.routeoptimization.v1.ILocation|null|undefined} location + * @memberof google.maps.routeoptimization.v1.Waypoint + * @instance + */ + Waypoint.prototype.location = null; + + /** + * Waypoint placeId. + * @member {string|null|undefined} placeId + * @memberof google.maps.routeoptimization.v1.Waypoint + * @instance + */ + Waypoint.prototype.placeId = null; + + /** + * Waypoint sideOfRoad. + * @member {boolean} sideOfRoad + * @memberof google.maps.routeoptimization.v1.Waypoint + * @instance + */ + Waypoint.prototype.sideOfRoad = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Waypoint locationType. + * @member {"location"|"placeId"|undefined} locationType + * @memberof google.maps.routeoptimization.v1.Waypoint + * @instance + */ + Object.defineProperty(Waypoint.prototype, "locationType", { + get: $util.oneOfGetter($oneOfFields = ["location", "placeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Waypoint instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {google.maps.routeoptimization.v1.IWaypoint=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Waypoint} Waypoint instance + */ + Waypoint.create = function create(properties) { + return new Waypoint(properties); + }; + + /** + * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routeoptimization.v1.Waypoint.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {google.maps.routeoptimization.v1.IWaypoint} message Waypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Waypoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.maps.routeoptimization.v1.Location.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeId); + if (message.sideOfRoad != null && Object.hasOwnProperty.call(message, "sideOfRoad")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.sideOfRoad); + return writer; + }; + + /** + * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Waypoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {google.maps.routeoptimization.v1.IWaypoint} message Waypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Waypoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Waypoint message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Waypoint} Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Waypoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Waypoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = $root.google.maps.routeoptimization.v1.Location.decode(reader, reader.uint32()); + break; + } + case 2: { + message.placeId = reader.string(); + break; + } + case 3: { + message.sideOfRoad = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Waypoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Waypoint} Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Waypoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Waypoint message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Waypoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.location != null && message.hasOwnProperty("location")) { + properties.locationType = 1; + { + var error = $root.google.maps.routeoptimization.v1.Location.verify(message.location); + if (error) + return "location." + error; + } + } + if (message.placeId != null && message.hasOwnProperty("placeId")) { + if (properties.locationType === 1) + return "locationType: multiple values"; + properties.locationType = 1; + if (!$util.isString(message.placeId)) + return "placeId: string expected"; + } + if (message.sideOfRoad != null && message.hasOwnProperty("sideOfRoad")) + if (typeof message.sideOfRoad !== "boolean") + return "sideOfRoad: boolean expected"; + return null; + }; + + /** + * Creates a Waypoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Waypoint} Waypoint + */ + Waypoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Waypoint) + return object; + var message = new $root.google.maps.routeoptimization.v1.Waypoint(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Waypoint.location: object expected"); + message.location = $root.google.maps.routeoptimization.v1.Location.fromObject(object.location); + } + if (object.placeId != null) + message.placeId = String(object.placeId); + if (object.sideOfRoad != null) + message.sideOfRoad = Boolean(object.sideOfRoad); + return message; + }; + + /** + * Creates a plain object from a Waypoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {google.maps.routeoptimization.v1.Waypoint} message Waypoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Waypoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sideOfRoad = false; + if (message.location != null && message.hasOwnProperty("location")) { + object.location = $root.google.maps.routeoptimization.v1.Location.toObject(message.location, options); + if (options.oneofs) + object.locationType = "location"; + } + if (message.placeId != null && message.hasOwnProperty("placeId")) { + object.placeId = message.placeId; + if (options.oneofs) + object.locationType = "placeId"; + } + if (message.sideOfRoad != null && message.hasOwnProperty("sideOfRoad")) + object.sideOfRoad = message.sideOfRoad; + return object; + }; + + /** + * Converts this Waypoint to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Waypoint + * @instance + * @returns {Object.} JSON object + */ + Waypoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Waypoint + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Waypoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Waypoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Waypoint"; + }; + + return Waypoint; + })(); + + v1.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.maps.routeoptimization.v1 + * @interface ILocation + * @property {google.type.ILatLng|null} [latLng] Location latLng + * @property {number|null} [heading] Location heading + */ + + /** + * Constructs a new Location. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.maps.routeoptimization.v1.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.maps.routeoptimization.v1.Location + * @instance + */ + Location.prototype.latLng = null; + + /** + * Location heading. + * @member {number|null|undefined} heading + * @memberof google.maps.routeoptimization.v1.Location + * @instance + */ + Location.prototype.heading = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Location _heading. + * @member {"heading"|undefined} _heading + * @memberof google.maps.routeoptimization.v1.Location + * @instance + */ + Object.defineProperty(Location.prototype, "_heading", { + get: $util.oneOfGetter($oneOfFields = ["heading"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {google.maps.routeoptimization.v1.ILocation=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.maps.routeoptimization.v1.Location.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {google.maps.routeoptimization.v1.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heading != null && Object.hasOwnProperty.call(message, "heading")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.heading); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {google.maps.routeoptimization.v1.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heading = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + if (message.heading != null && message.hasOwnProperty("heading")) { + properties._heading = 1; + if (!$util.isInteger(message.heading)) + return "heading: integer expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.Location) + return object; + var message = new $root.google.maps.routeoptimization.v1.Location(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.maps.routeoptimization.v1.Location.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.heading != null) + message.heading = object.heading | 0; + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {google.maps.routeoptimization.v1.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.latLng = null; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (message.heading != null && message.hasOwnProperty("heading")) { + object.heading = message.heading; + if (options.oneofs) + object._heading = "heading"; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.Location"; + }; + + return Location; + })(); + + v1.BreakRule = (function() { + + /** + * Properties of a BreakRule. + * @memberof google.maps.routeoptimization.v1 + * @interface IBreakRule + * @property {Array.|null} [breakRequests] BreakRule breakRequests + * @property {Array.|null} [frequencyConstraints] BreakRule frequencyConstraints + */ + + /** + * Constructs a new BreakRule. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a BreakRule. + * @implements IBreakRule + * @constructor + * @param {google.maps.routeoptimization.v1.IBreakRule=} [properties] Properties to set + */ + function BreakRule(properties) { + this.breakRequests = []; + this.frequencyConstraints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BreakRule breakRequests. + * @member {Array.} breakRequests + * @memberof google.maps.routeoptimization.v1.BreakRule + * @instance + */ + BreakRule.prototype.breakRequests = $util.emptyArray; + + /** + * BreakRule frequencyConstraints. + * @member {Array.} frequencyConstraints + * @memberof google.maps.routeoptimization.v1.BreakRule + * @instance + */ + BreakRule.prototype.frequencyConstraints = $util.emptyArray; + + /** + * Creates a new BreakRule instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {google.maps.routeoptimization.v1.IBreakRule=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BreakRule} BreakRule instance + */ + BreakRule.create = function create(properties) { + return new BreakRule(properties); + }; + + /** + * Encodes the specified BreakRule message. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {google.maps.routeoptimization.v1.IBreakRule} message BreakRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BreakRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.breakRequests != null && message.breakRequests.length) + for (var i = 0; i < message.breakRequests.length; ++i) + $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest.encode(message.breakRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.frequencyConstraints != null && message.frequencyConstraints.length) + for (var i = 0; i < message.frequencyConstraints.length; ++i) + $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.encode(message.frequencyConstraints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BreakRule message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {google.maps.routeoptimization.v1.IBreakRule} message BreakRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BreakRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BreakRule message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BreakRule} BreakRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BreakRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BreakRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.breakRequests && message.breakRequests.length)) + message.breakRequests = []; + message.breakRequests.push($root.google.maps.routeoptimization.v1.BreakRule.BreakRequest.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.frequencyConstraints && message.frequencyConstraints.length)) + message.frequencyConstraints = []; + message.frequencyConstraints.push($root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BreakRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BreakRule} BreakRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BreakRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BreakRule message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BreakRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.breakRequests != null && message.hasOwnProperty("breakRequests")) { + if (!Array.isArray(message.breakRequests)) + return "breakRequests: array expected"; + for (var i = 0; i < message.breakRequests.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest.verify(message.breakRequests[i]); + if (error) + return "breakRequests." + error; + } + } + if (message.frequencyConstraints != null && message.hasOwnProperty("frequencyConstraints")) { + if (!Array.isArray(message.frequencyConstraints)) + return "frequencyConstraints: array expected"; + for (var i = 0; i < message.frequencyConstraints.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.verify(message.frequencyConstraints[i]); + if (error) + return "frequencyConstraints." + error; + } + } + return null; + }; + + /** + * Creates a BreakRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BreakRule} BreakRule + */ + BreakRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BreakRule) + return object; + var message = new $root.google.maps.routeoptimization.v1.BreakRule(); + if (object.breakRequests) { + if (!Array.isArray(object.breakRequests)) + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.breakRequests: array expected"); + message.breakRequests = []; + for (var i = 0; i < object.breakRequests.length; ++i) { + if (typeof object.breakRequests[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.breakRequests: object expected"); + message.breakRequests[i] = $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest.fromObject(object.breakRequests[i]); + } + } + if (object.frequencyConstraints) { + if (!Array.isArray(object.frequencyConstraints)) + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.frequencyConstraints: array expected"); + message.frequencyConstraints = []; + for (var i = 0; i < object.frequencyConstraints.length; ++i) { + if (typeof object.frequencyConstraints[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.frequencyConstraints: object expected"); + message.frequencyConstraints[i] = $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.fromObject(object.frequencyConstraints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BreakRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {google.maps.routeoptimization.v1.BreakRule} message BreakRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BreakRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.breakRequests = []; + object.frequencyConstraints = []; + } + if (message.breakRequests && message.breakRequests.length) { + object.breakRequests = []; + for (var j = 0; j < message.breakRequests.length; ++j) + object.breakRequests[j] = $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest.toObject(message.breakRequests[j], options); + } + if (message.frequencyConstraints && message.frequencyConstraints.length) { + object.frequencyConstraints = []; + for (var j = 0; j < message.frequencyConstraints.length; ++j) + object.frequencyConstraints[j] = $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.toObject(message.frequencyConstraints[j], options); + } + return object; + }; + + /** + * Converts this BreakRule to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BreakRule + * @instance + * @returns {Object.} JSON object + */ + BreakRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BreakRule + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BreakRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BreakRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BreakRule"; + }; + + BreakRule.BreakRequest = (function() { + + /** + * Properties of a BreakRequest. + * @memberof google.maps.routeoptimization.v1.BreakRule + * @interface IBreakRequest + * @property {google.protobuf.ITimestamp|null} [earliestStartTime] BreakRequest earliestStartTime + * @property {google.protobuf.ITimestamp|null} [latestStartTime] BreakRequest latestStartTime + * @property {google.protobuf.IDuration|null} [minDuration] BreakRequest minDuration + */ + + /** + * Constructs a new BreakRequest. + * @memberof google.maps.routeoptimization.v1.BreakRule + * @classdesc Represents a BreakRequest. + * @implements IBreakRequest + * @constructor + * @param {google.maps.routeoptimization.v1.BreakRule.IBreakRequest=} [properties] Properties to set + */ + function BreakRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BreakRequest earliestStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestStartTime + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @instance + */ + BreakRequest.prototype.earliestStartTime = null; + + /** + * BreakRequest latestStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestStartTime + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @instance + */ + BreakRequest.prototype.latestStartTime = null; + + /** + * BreakRequest minDuration. + * @member {google.protobuf.IDuration|null|undefined} minDuration + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @instance + */ + BreakRequest.prototype.minDuration = null; + + /** + * Creates a new BreakRequest instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.IBreakRequest=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BreakRule.BreakRequest} BreakRequest instance + */ + BreakRequest.create = function create(properties) { + return new BreakRequest(properties); + }; + + /** + * Encodes the specified BreakRequest message. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.BreakRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.IBreakRequest} message BreakRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BreakRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.earliestStartTime != null && Object.hasOwnProperty.call(message, "earliestStartTime")) + $root.google.protobuf.Timestamp.encode(message.earliestStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestStartTime != null && Object.hasOwnProperty.call(message, "latestStartTime")) + $root.google.protobuf.Timestamp.encode(message.latestStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.minDuration != null && Object.hasOwnProperty.call(message, "minDuration")) + $root.google.protobuf.Duration.encode(message.minDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BreakRequest message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.BreakRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.IBreakRequest} message BreakRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BreakRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BreakRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BreakRule.BreakRequest} BreakRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BreakRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.earliestStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.latestStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.minDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BreakRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BreakRule.BreakRequest} BreakRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BreakRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BreakRequest message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BreakRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.earliestStartTime != null && message.hasOwnProperty("earliestStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestStartTime); + if (error) + return "earliestStartTime." + error; + } + if (message.latestStartTime != null && message.hasOwnProperty("latestStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestStartTime); + if (error) + return "latestStartTime." + error; + } + if (message.minDuration != null && message.hasOwnProperty("minDuration")) { + var error = $root.google.protobuf.Duration.verify(message.minDuration); + if (error) + return "minDuration." + error; + } + return null; + }; + + /** + * Creates a BreakRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BreakRule.BreakRequest} BreakRequest + */ + BreakRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest) + return object; + var message = new $root.google.maps.routeoptimization.v1.BreakRule.BreakRequest(); + if (object.earliestStartTime != null) { + if (typeof object.earliestStartTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.BreakRequest.earliestStartTime: object expected"); + message.earliestStartTime = $root.google.protobuf.Timestamp.fromObject(object.earliestStartTime); + } + if (object.latestStartTime != null) { + if (typeof object.latestStartTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.BreakRequest.latestStartTime: object expected"); + message.latestStartTime = $root.google.protobuf.Timestamp.fromObject(object.latestStartTime); + } + if (object.minDuration != null) { + if (typeof object.minDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.BreakRequest.minDuration: object expected"); + message.minDuration = $root.google.protobuf.Duration.fromObject(object.minDuration); + } + return message; + }; + + /** + * Creates a plain object from a BreakRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.BreakRequest} message BreakRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BreakRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.earliestStartTime = null; + object.latestStartTime = null; + object.minDuration = null; + } + if (message.earliestStartTime != null && message.hasOwnProperty("earliestStartTime")) + object.earliestStartTime = $root.google.protobuf.Timestamp.toObject(message.earliestStartTime, options); + if (message.latestStartTime != null && message.hasOwnProperty("latestStartTime")) + object.latestStartTime = $root.google.protobuf.Timestamp.toObject(message.latestStartTime, options); + if (message.minDuration != null && message.hasOwnProperty("minDuration")) + object.minDuration = $root.google.protobuf.Duration.toObject(message.minDuration, options); + return object; + }; + + /** + * Converts this BreakRequest to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @instance + * @returns {Object.} JSON object + */ + BreakRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BreakRequest + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BreakRule.BreakRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BreakRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BreakRule.BreakRequest"; + }; + + return BreakRequest; + })(); + + BreakRule.FrequencyConstraint = (function() { + + /** + * Properties of a FrequencyConstraint. + * @memberof google.maps.routeoptimization.v1.BreakRule + * @interface IFrequencyConstraint + * @property {google.protobuf.IDuration|null} [minBreakDuration] FrequencyConstraint minBreakDuration + * @property {google.protobuf.IDuration|null} [maxInterBreakDuration] FrequencyConstraint maxInterBreakDuration + */ + + /** + * Constructs a new FrequencyConstraint. + * @memberof google.maps.routeoptimization.v1.BreakRule + * @classdesc Represents a FrequencyConstraint. + * @implements IFrequencyConstraint + * @constructor + * @param {google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint=} [properties] Properties to set + */ + function FrequencyConstraint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FrequencyConstraint minBreakDuration. + * @member {google.protobuf.IDuration|null|undefined} minBreakDuration + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @instance + */ + FrequencyConstraint.prototype.minBreakDuration = null; + + /** + * FrequencyConstraint maxInterBreakDuration. + * @member {google.protobuf.IDuration|null|undefined} maxInterBreakDuration + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @instance + */ + FrequencyConstraint.prototype.maxInterBreakDuration = null; + + /** + * Creates a new FrequencyConstraint instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} FrequencyConstraint instance + */ + FrequencyConstraint.create = function create(properties) { + return new FrequencyConstraint(properties); + }; + + /** + * Encodes the specified FrequencyConstraint message. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint} message FrequencyConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequencyConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minBreakDuration != null && Object.hasOwnProperty.call(message, "minBreakDuration")) + $root.google.protobuf.Duration.encode(message.minBreakDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxInterBreakDuration != null && Object.hasOwnProperty.call(message, "maxInterBreakDuration")) + $root.google.protobuf.Duration.encode(message.maxInterBreakDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FrequencyConstraint message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.IFrequencyConstraint} message FrequencyConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequencyConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FrequencyConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} FrequencyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequencyConstraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minBreakDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxInterBreakDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FrequencyConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} FrequencyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequencyConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FrequencyConstraint message. + * @function verify + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FrequencyConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minBreakDuration != null && message.hasOwnProperty("minBreakDuration")) { + var error = $root.google.protobuf.Duration.verify(message.minBreakDuration); + if (error) + return "minBreakDuration." + error; + } + if (message.maxInterBreakDuration != null && message.hasOwnProperty("maxInterBreakDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxInterBreakDuration); + if (error) + return "maxInterBreakDuration." + error; + } + return null; + }; + + /** + * Creates a FrequencyConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} FrequencyConstraint + */ + FrequencyConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint) + return object; + var message = new $root.google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint(); + if (object.minBreakDuration != null) { + if (typeof object.minBreakDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.minBreakDuration: object expected"); + message.minBreakDuration = $root.google.protobuf.Duration.fromObject(object.minBreakDuration); + } + if (object.maxInterBreakDuration != null) { + if (typeof object.maxInterBreakDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint.maxInterBreakDuration: object expected"); + message.maxInterBreakDuration = $root.google.protobuf.Duration.fromObject(object.maxInterBreakDuration); + } + return message; + }; + + /** + * Creates a plain object from a FrequencyConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint} message FrequencyConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FrequencyConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minBreakDuration = null; + object.maxInterBreakDuration = null; + } + if (message.minBreakDuration != null && message.hasOwnProperty("minBreakDuration")) + object.minBreakDuration = $root.google.protobuf.Duration.toObject(message.minBreakDuration, options); + if (message.maxInterBreakDuration != null && message.hasOwnProperty("maxInterBreakDuration")) + object.maxInterBreakDuration = $root.google.protobuf.Duration.toObject(message.maxInterBreakDuration, options); + return object; + }; + + /** + * Converts this FrequencyConstraint to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @instance + * @returns {Object.} JSON object + */ + FrequencyConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FrequencyConstraint + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FrequencyConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint"; + }; + + return FrequencyConstraint; + })(); + + return BreakRule; + })(); + + v1.ShipmentRoute = (function() { + + /** + * Properties of a ShipmentRoute. + * @memberof google.maps.routeoptimization.v1 + * @interface IShipmentRoute + * @property {number|null} [vehicleIndex] ShipmentRoute vehicleIndex + * @property {string|null} [vehicleLabel] ShipmentRoute vehicleLabel + * @property {google.protobuf.ITimestamp|null} [vehicleStartTime] ShipmentRoute vehicleStartTime + * @property {google.protobuf.ITimestamp|null} [vehicleEndTime] ShipmentRoute vehicleEndTime + * @property {Array.|null} [visits] ShipmentRoute visits + * @property {Array.|null} [transitions] ShipmentRoute transitions + * @property {boolean|null} [hasTrafficInfeasibilities] ShipmentRoute hasTrafficInfeasibilities + * @property {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null} [routePolyline] ShipmentRoute routePolyline + * @property {Array.|null} [breaks] ShipmentRoute breaks + * @property {google.maps.routeoptimization.v1.IAggregatedMetrics|null} [metrics] ShipmentRoute metrics + * @property {Object.|null} [routeCosts] ShipmentRoute routeCosts + * @property {number|null} [routeTotalCost] ShipmentRoute routeTotalCost + */ + + /** + * Constructs a new ShipmentRoute. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a ShipmentRoute. + * @implements IShipmentRoute + * @constructor + * @param {google.maps.routeoptimization.v1.IShipmentRoute=} [properties] Properties to set + */ + function ShipmentRoute(properties) { + this.visits = []; + this.transitions = []; + this.breaks = []; + this.routeCosts = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShipmentRoute vehicleIndex. + * @member {number} vehicleIndex + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.vehicleIndex = 0; + + /** + * ShipmentRoute vehicleLabel. + * @member {string} vehicleLabel + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.vehicleLabel = ""; + + /** + * ShipmentRoute vehicleStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} vehicleStartTime + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.vehicleStartTime = null; + + /** + * ShipmentRoute vehicleEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} vehicleEndTime + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.vehicleEndTime = null; + + /** + * ShipmentRoute visits. + * @member {Array.} visits + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.visits = $util.emptyArray; + + /** + * ShipmentRoute transitions. + * @member {Array.} transitions + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.transitions = $util.emptyArray; + + /** + * ShipmentRoute hasTrafficInfeasibilities. + * @member {boolean} hasTrafficInfeasibilities + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.hasTrafficInfeasibilities = false; + + /** + * ShipmentRoute routePolyline. + * @member {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null|undefined} routePolyline + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.routePolyline = null; + + /** + * ShipmentRoute breaks. + * @member {Array.} breaks + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.breaks = $util.emptyArray; + + /** + * ShipmentRoute metrics. + * @member {google.maps.routeoptimization.v1.IAggregatedMetrics|null|undefined} metrics + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.metrics = null; + + /** + * ShipmentRoute routeCosts. + * @member {Object.} routeCosts + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.routeCosts = $util.emptyObject; + + /** + * ShipmentRoute routeTotalCost. + * @member {number} routeTotalCost + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + */ + ShipmentRoute.prototype.routeTotalCost = 0; + + /** + * Creates a new ShipmentRoute instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {google.maps.routeoptimization.v1.IShipmentRoute=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentRoute} ShipmentRoute instance + */ + ShipmentRoute.create = function create(properties) { + return new ShipmentRoute(properties); + }; + + /** + * Encodes the specified ShipmentRoute message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {google.maps.routeoptimization.v1.IShipmentRoute} message ShipmentRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentRoute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vehicleIndex != null && Object.hasOwnProperty.call(message, "vehicleIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.vehicleIndex); + if (message.vehicleLabel != null && Object.hasOwnProperty.call(message, "vehicleLabel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vehicleLabel); + if (message.vehicleStartTime != null && Object.hasOwnProperty.call(message, "vehicleStartTime")) + $root.google.protobuf.Timestamp.encode(message.vehicleStartTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.vehicleEndTime != null && Object.hasOwnProperty.call(message, "vehicleEndTime")) + $root.google.protobuf.Timestamp.encode(message.vehicleEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.visits != null && message.visits.length) + for (var i = 0; i < message.visits.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit.encode(message.visits[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.transitions != null && message.transitions.length) + for (var i = 0; i < message.transitions.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition.encode(message.transitions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.hasTrafficInfeasibilities != null && Object.hasOwnProperty.call(message, "hasTrafficInfeasibilities")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.hasTrafficInfeasibilities); + if (message.routePolyline != null && Object.hasOwnProperty.call(message, "routePolyline")) + $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.encode(message.routePolyline, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.breaks != null && message.breaks.length) + for (var i = 0; i < message.breaks.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.Break.encode(message.breaks[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.maps.routeoptimization.v1.AggregatedMetrics.encode(message.metrics, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.routeCosts != null && Object.hasOwnProperty.call(message, "routeCosts")) + for (var keys = Object.keys(message.routeCosts), i = 0; i < keys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.routeCosts[keys[i]]).ldelim(); + if (message.routeTotalCost != null && Object.hasOwnProperty.call(message, "routeTotalCost")) + writer.uint32(/* id 18, wireType 1 =*/145).double(message.routeTotalCost); + return writer; + }; + + /** + * Encodes the specified ShipmentRoute message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {google.maps.routeoptimization.v1.IShipmentRoute} message ShipmentRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShipmentRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShipmentRoute message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentRoute} ShipmentRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentRoute(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vehicleIndex = reader.int32(); + break; + } + case 2: { + message.vehicleLabel = reader.string(); + break; + } + case 5: { + message.vehicleStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.vehicleEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.visits && message.visits.length)) + message.visits = []; + message.visits.push($root.google.maps.routeoptimization.v1.ShipmentRoute.Visit.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.transitions && message.transitions.length)) + message.transitions = []; + message.transitions.push($root.google.maps.routeoptimization.v1.ShipmentRoute.Transition.decode(reader, reader.uint32())); + break; + } + case 9: { + message.hasTrafficInfeasibilities = reader.bool(); + break; + } + case 10: { + message.routePolyline = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.breaks && message.breaks.length)) + message.breaks = []; + message.breaks.push($root.google.maps.routeoptimization.v1.ShipmentRoute.Break.decode(reader, reader.uint32())); + break; + } + case 12: { + message.metrics = $root.google.maps.routeoptimization.v1.AggregatedMetrics.decode(reader, reader.uint32()); + break; + } + case 17: { + if (message.routeCosts === $util.emptyObject) + message.routeCosts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.double(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.routeCosts[key] = value; + break; + } + case 18: { + message.routeTotalCost = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShipmentRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentRoute} ShipmentRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShipmentRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShipmentRoute message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShipmentRoute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vehicleIndex != null && message.hasOwnProperty("vehicleIndex")) + if (!$util.isInteger(message.vehicleIndex)) + return "vehicleIndex: integer expected"; + if (message.vehicleLabel != null && message.hasOwnProperty("vehicleLabel")) + if (!$util.isString(message.vehicleLabel)) + return "vehicleLabel: string expected"; + if (message.vehicleStartTime != null && message.hasOwnProperty("vehicleStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.vehicleStartTime); + if (error) + return "vehicleStartTime." + error; + } + if (message.vehicleEndTime != null && message.hasOwnProperty("vehicleEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.vehicleEndTime); + if (error) + return "vehicleEndTime." + error; + } + if (message.visits != null && message.hasOwnProperty("visits")) { + if (!Array.isArray(message.visits)) + return "visits: array expected"; + for (var i = 0; i < message.visits.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit.verify(message.visits[i]); + if (error) + return "visits." + error; + } + } + if (message.transitions != null && message.hasOwnProperty("transitions")) { + if (!Array.isArray(message.transitions)) + return "transitions: array expected"; + for (var i = 0; i < message.transitions.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition.verify(message.transitions[i]); + if (error) + return "transitions." + error; + } + } + if (message.hasTrafficInfeasibilities != null && message.hasOwnProperty("hasTrafficInfeasibilities")) + if (typeof message.hasTrafficInfeasibilities !== "boolean") + return "hasTrafficInfeasibilities: boolean expected"; + if (message.routePolyline != null && message.hasOwnProperty("routePolyline")) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.verify(message.routePolyline); + if (error) + return "routePolyline." + error; + } + if (message.breaks != null && message.hasOwnProperty("breaks")) { + if (!Array.isArray(message.breaks)) + return "breaks: array expected"; + for (var i = 0; i < message.breaks.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.Break.verify(message.breaks[i]); + if (error) + return "breaks." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.maps.routeoptimization.v1.AggregatedMetrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + if (message.routeCosts != null && message.hasOwnProperty("routeCosts")) { + if (!$util.isObject(message.routeCosts)) + return "routeCosts: object expected"; + var key = Object.keys(message.routeCosts); + for (var i = 0; i < key.length; ++i) + if (typeof message.routeCosts[key[i]] !== "number") + return "routeCosts: number{k:string} expected"; + } + if (message.routeTotalCost != null && message.hasOwnProperty("routeTotalCost")) + if (typeof message.routeTotalCost !== "number") + return "routeTotalCost: number expected"; + return null; + }; + + /** + * Creates a ShipmentRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentRoute} ShipmentRoute + */ + ShipmentRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentRoute) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentRoute(); + if (object.vehicleIndex != null) + message.vehicleIndex = object.vehicleIndex | 0; + if (object.vehicleLabel != null) + message.vehicleLabel = String(object.vehicleLabel); + if (object.vehicleStartTime != null) { + if (typeof object.vehicleStartTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.vehicleStartTime: object expected"); + message.vehicleStartTime = $root.google.protobuf.Timestamp.fromObject(object.vehicleStartTime); + } + if (object.vehicleEndTime != null) { + if (typeof object.vehicleEndTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.vehicleEndTime: object expected"); + message.vehicleEndTime = $root.google.protobuf.Timestamp.fromObject(object.vehicleEndTime); + } + if (object.visits) { + if (!Array.isArray(object.visits)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.visits: array expected"); + message.visits = []; + for (var i = 0; i < object.visits.length; ++i) { + if (typeof object.visits[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.visits: object expected"); + message.visits[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit.fromObject(object.visits[i]); + } + } + if (object.transitions) { + if (!Array.isArray(object.transitions)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.transitions: array expected"); + message.transitions = []; + for (var i = 0; i < object.transitions.length; ++i) { + if (typeof object.transitions[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.transitions: object expected"); + message.transitions[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition.fromObject(object.transitions[i]); + } + } + if (object.hasTrafficInfeasibilities != null) + message.hasTrafficInfeasibilities = Boolean(object.hasTrafficInfeasibilities); + if (object.routePolyline != null) { + if (typeof object.routePolyline !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.routePolyline: object expected"); + message.routePolyline = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.fromObject(object.routePolyline); + } + if (object.breaks) { + if (!Array.isArray(object.breaks)) + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.breaks: array expected"); + message.breaks = []; + for (var i = 0; i < object.breaks.length; ++i) { + if (typeof object.breaks[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.breaks: object expected"); + message.breaks[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.Break.fromObject(object.breaks[i]); + } + } + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.metrics: object expected"); + message.metrics = $root.google.maps.routeoptimization.v1.AggregatedMetrics.fromObject(object.metrics); + } + if (object.routeCosts) { + if (typeof object.routeCosts !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.routeCosts: object expected"); + message.routeCosts = {}; + for (var keys = Object.keys(object.routeCosts), i = 0; i < keys.length; ++i) + message.routeCosts[keys[i]] = Number(object.routeCosts[keys[i]]); + } + if (object.routeTotalCost != null) + message.routeTotalCost = Number(object.routeTotalCost); + return message; + }; + + /** + * Creates a plain object from a ShipmentRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute} message ShipmentRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShipmentRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.visits = []; + object.transitions = []; + object.breaks = []; + } + if (options.objects || options.defaults) + object.routeCosts = {}; + if (options.defaults) { + object.vehicleIndex = 0; + object.vehicleLabel = ""; + object.vehicleStartTime = null; + object.vehicleEndTime = null; + object.hasTrafficInfeasibilities = false; + object.routePolyline = null; + object.metrics = null; + object.routeTotalCost = 0; + } + if (message.vehicleIndex != null && message.hasOwnProperty("vehicleIndex")) + object.vehicleIndex = message.vehicleIndex; + if (message.vehicleLabel != null && message.hasOwnProperty("vehicleLabel")) + object.vehicleLabel = message.vehicleLabel; + if (message.vehicleStartTime != null && message.hasOwnProperty("vehicleStartTime")) + object.vehicleStartTime = $root.google.protobuf.Timestamp.toObject(message.vehicleStartTime, options); + if (message.vehicleEndTime != null && message.hasOwnProperty("vehicleEndTime")) + object.vehicleEndTime = $root.google.protobuf.Timestamp.toObject(message.vehicleEndTime, options); + if (message.visits && message.visits.length) { + object.visits = []; + for (var j = 0; j < message.visits.length; ++j) + object.visits[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit.toObject(message.visits[j], options); + } + if (message.transitions && message.transitions.length) { + object.transitions = []; + for (var j = 0; j < message.transitions.length; ++j) + object.transitions[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition.toObject(message.transitions[j], options); + } + if (message.hasTrafficInfeasibilities != null && message.hasOwnProperty("hasTrafficInfeasibilities")) + object.hasTrafficInfeasibilities = message.hasTrafficInfeasibilities; + if (message.routePolyline != null && message.hasOwnProperty("routePolyline")) + object.routePolyline = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.toObject(message.routePolyline, options); + if (message.breaks && message.breaks.length) { + object.breaks = []; + for (var j = 0; j < message.breaks.length; ++j) + object.breaks[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.Break.toObject(message.breaks[j], options); + } + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.maps.routeoptimization.v1.AggregatedMetrics.toObject(message.metrics, options); + var keys2; + if (message.routeCosts && (keys2 = Object.keys(message.routeCosts)).length) { + object.routeCosts = {}; + for (var j = 0; j < keys2.length; ++j) + object.routeCosts[keys2[j]] = options.json && !isFinite(message.routeCosts[keys2[j]]) ? String(message.routeCosts[keys2[j]]) : message.routeCosts[keys2[j]]; + } + if (message.routeTotalCost != null && message.hasOwnProperty("routeTotalCost")) + object.routeTotalCost = options.json && !isFinite(message.routeTotalCost) ? String(message.routeTotalCost) : message.routeTotalCost; + return object; + }; + + /** + * Converts this ShipmentRoute to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @instance + * @returns {Object.} JSON object + */ + ShipmentRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShipmentRoute + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShipmentRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentRoute"; + }; + + ShipmentRoute.Visit = (function() { + + /** + * Properties of a Visit. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @interface IVisit + * @property {number|null} [shipmentIndex] Visit shipmentIndex + * @property {boolean|null} [isPickup] Visit isPickup + * @property {number|null} [visitRequestIndex] Visit visitRequestIndex + * @property {google.protobuf.ITimestamp|null} [startTime] Visit startTime + * @property {Object.|null} [loadDemands] Visit loadDemands + * @property {google.protobuf.IDuration|null} [detour] Visit detour + * @property {string|null} [shipmentLabel] Visit shipmentLabel + * @property {string|null} [visitLabel] Visit visitLabel + */ + + /** + * Constructs a new Visit. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @classdesc Represents a Visit. + * @implements IVisit + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVisit=} [properties] Properties to set + */ + function Visit(properties) { + this.loadDemands = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Visit shipmentIndex. + * @member {number} shipmentIndex + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.shipmentIndex = 0; + + /** + * Visit isPickup. + * @member {boolean} isPickup + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.isPickup = false; + + /** + * Visit visitRequestIndex. + * @member {number} visitRequestIndex + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.visitRequestIndex = 0; + + /** + * Visit startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.startTime = null; + + /** + * Visit loadDemands. + * @member {Object.} loadDemands + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.loadDemands = $util.emptyObject; + + /** + * Visit detour. + * @member {google.protobuf.IDuration|null|undefined} detour + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.detour = null; + + /** + * Visit shipmentLabel. + * @member {string} shipmentLabel + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.shipmentLabel = ""; + + /** + * Visit visitLabel. + * @member {string} visitLabel + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + */ + Visit.prototype.visitLabel = ""; + + /** + * Creates a new Visit instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVisit=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Visit} Visit instance + */ + Visit.create = function create(properties) { + return new Visit(properties); + }; + + /** + * Encodes the specified Visit message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Visit.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVisit} message Visit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Visit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shipmentIndex != null && Object.hasOwnProperty.call(message, "shipmentIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.shipmentIndex); + if (message.isPickup != null && Object.hasOwnProperty.call(message, "isPickup")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isPickup); + if (message.visitRequestIndex != null && Object.hasOwnProperty.call(message, "visitRequestIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.visitRequestIndex); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.detour != null && Object.hasOwnProperty.call(message, "detour")) + $root.google.protobuf.Duration.encode(message.detour, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.shipmentLabel != null && Object.hasOwnProperty.call(message, "shipmentLabel")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.shipmentLabel); + if (message.visitLabel != null && Object.hasOwnProperty.call(message, "visitLabel")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.visitLabel); + if (message.loadDemands != null && Object.hasOwnProperty.call(message, "loadDemands")) + for (var keys = Object.keys(message.loadDemands), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.maps.routeoptimization.v1.Shipment.Load.encode(message.loadDemands[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Visit message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Visit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVisit} message Visit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Visit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Visit message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Visit} Visit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Visit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.shipmentIndex = reader.int32(); + break; + } + case 2: { + message.isPickup = reader.bool(); + break; + } + case 3: { + message.visitRequestIndex = reader.int32(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.loadDemands === $util.emptyObject) + message.loadDemands = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.maps.routeoptimization.v1.Shipment.Load.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.loadDemands[key] = value; + break; + } + case 6: { + message.detour = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.shipmentLabel = reader.string(); + break; + } + case 8: { + message.visitLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Visit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Visit} Visit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Visit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Visit message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Visit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shipmentIndex != null && message.hasOwnProperty("shipmentIndex")) + if (!$util.isInteger(message.shipmentIndex)) + return "shipmentIndex: integer expected"; + if (message.isPickup != null && message.hasOwnProperty("isPickup")) + if (typeof message.isPickup !== "boolean") + return "isPickup: boolean expected"; + if (message.visitRequestIndex != null && message.hasOwnProperty("visitRequestIndex")) + if (!$util.isInteger(message.visitRequestIndex)) + return "visitRequestIndex: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.loadDemands != null && message.hasOwnProperty("loadDemands")) { + if (!$util.isObject(message.loadDemands)) + return "loadDemands: object expected"; + var key = Object.keys(message.loadDemands); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.Shipment.Load.verify(message.loadDemands[key[i]]); + if (error) + return "loadDemands." + error; + } + } + if (message.detour != null && message.hasOwnProperty("detour")) { + var error = $root.google.protobuf.Duration.verify(message.detour); + if (error) + return "detour." + error; + } + if (message.shipmentLabel != null && message.hasOwnProperty("shipmentLabel")) + if (!$util.isString(message.shipmentLabel)) + return "shipmentLabel: string expected"; + if (message.visitLabel != null && message.hasOwnProperty("visitLabel")) + if (!$util.isString(message.visitLabel)) + return "visitLabel: string expected"; + return null; + }; + + /** + * Creates a Visit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Visit} Visit + */ + Visit.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.Visit(); + if (object.shipmentIndex != null) + message.shipmentIndex = object.shipmentIndex | 0; + if (object.isPickup != null) + message.isPickup = Boolean(object.isPickup); + if (object.visitRequestIndex != null) + message.visitRequestIndex = object.visitRequestIndex | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Visit.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.loadDemands) { + if (typeof object.loadDemands !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Visit.loadDemands: object expected"); + message.loadDemands = {}; + for (var keys = Object.keys(object.loadDemands), i = 0; i < keys.length; ++i) { + if (typeof object.loadDemands[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Visit.loadDemands: object expected"); + message.loadDemands[keys[i]] = $root.google.maps.routeoptimization.v1.Shipment.Load.fromObject(object.loadDemands[keys[i]]); + } + } + if (object.detour != null) { + if (typeof object.detour !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Visit.detour: object expected"); + message.detour = $root.google.protobuf.Duration.fromObject(object.detour); + } + if (object.shipmentLabel != null) + message.shipmentLabel = String(object.shipmentLabel); + if (object.visitLabel != null) + message.visitLabel = String(object.visitLabel); + return message; + }; + + /** + * Creates a plain object from a Visit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.Visit} message Visit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Visit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.loadDemands = {}; + if (options.defaults) { + object.shipmentIndex = 0; + object.isPickup = false; + object.visitRequestIndex = 0; + object.startTime = null; + object.detour = null; + object.shipmentLabel = ""; + object.visitLabel = ""; + } + if (message.shipmentIndex != null && message.hasOwnProperty("shipmentIndex")) + object.shipmentIndex = message.shipmentIndex; + if (message.isPickup != null && message.hasOwnProperty("isPickup")) + object.isPickup = message.isPickup; + if (message.visitRequestIndex != null && message.hasOwnProperty("visitRequestIndex")) + object.visitRequestIndex = message.visitRequestIndex; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.detour != null && message.hasOwnProperty("detour")) + object.detour = $root.google.protobuf.Duration.toObject(message.detour, options); + if (message.shipmentLabel != null && message.hasOwnProperty("shipmentLabel")) + object.shipmentLabel = message.shipmentLabel; + if (message.visitLabel != null && message.hasOwnProperty("visitLabel")) + object.visitLabel = message.visitLabel; + var keys2; + if (message.loadDemands && (keys2 = Object.keys(message.loadDemands)).length) { + object.loadDemands = {}; + for (var j = 0; j < keys2.length; ++j) + object.loadDemands[keys2[j]] = $root.google.maps.routeoptimization.v1.Shipment.Load.toObject(message.loadDemands[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Visit to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @instance + * @returns {Object.} JSON object + */ + Visit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Visit + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Visit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Visit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentRoute.Visit"; + }; + + return Visit; + })(); + + ShipmentRoute.Transition = (function() { + + /** + * Properties of a Transition. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @interface ITransition + * @property {google.protobuf.IDuration|null} [travelDuration] Transition travelDuration + * @property {number|null} [travelDistanceMeters] Transition travelDistanceMeters + * @property {boolean|null} [trafficInfoUnavailable] Transition trafficInfoUnavailable + * @property {google.protobuf.IDuration|null} [delayDuration] Transition delayDuration + * @property {google.protobuf.IDuration|null} [breakDuration] Transition breakDuration + * @property {google.protobuf.IDuration|null} [waitDuration] Transition waitDuration + * @property {google.protobuf.IDuration|null} [totalDuration] Transition totalDuration + * @property {google.protobuf.ITimestamp|null} [startTime] Transition startTime + * @property {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null} [routePolyline] Transition routePolyline + * @property {Object.|null} [vehicleLoads] Transition vehicleLoads + */ + + /** + * Constructs a new Transition. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @classdesc Represents a Transition. + * @implements ITransition + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentRoute.ITransition=} [properties] Properties to set + */ + function Transition(properties) { + this.vehicleLoads = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Transition travelDuration. + * @member {google.protobuf.IDuration|null|undefined} travelDuration + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.travelDuration = null; + + /** + * Transition travelDistanceMeters. + * @member {number} travelDistanceMeters + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.travelDistanceMeters = 0; + + /** + * Transition trafficInfoUnavailable. + * @member {boolean} trafficInfoUnavailable + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.trafficInfoUnavailable = false; + + /** + * Transition delayDuration. + * @member {google.protobuf.IDuration|null|undefined} delayDuration + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.delayDuration = null; + + /** + * Transition breakDuration. + * @member {google.protobuf.IDuration|null|undefined} breakDuration + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.breakDuration = null; + + /** + * Transition waitDuration. + * @member {google.protobuf.IDuration|null|undefined} waitDuration + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.waitDuration = null; + + /** + * Transition totalDuration. + * @member {google.protobuf.IDuration|null|undefined} totalDuration + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.totalDuration = null; + + /** + * Transition startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.startTime = null; + + /** + * Transition routePolyline. + * @member {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline|null|undefined} routePolyline + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.routePolyline = null; + + /** + * Transition vehicleLoads. + * @member {Object.} vehicleLoads + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + */ + Transition.prototype.vehicleLoads = $util.emptyObject; + + /** + * Creates a new Transition instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.ITransition=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Transition} Transition instance + */ + Transition.create = function create(properties) { + return new Transition(properties); + }; + + /** + * Encodes the specified Transition message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Transition.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.travelDuration != null && Object.hasOwnProperty.call(message, "travelDuration")) + $root.google.protobuf.Duration.encode(message.travelDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.travelDistanceMeters != null && Object.hasOwnProperty.call(message, "travelDistanceMeters")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.travelDistanceMeters); + if (message.trafficInfoUnavailable != null && Object.hasOwnProperty.call(message, "trafficInfoUnavailable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trafficInfoUnavailable); + if (message.delayDuration != null && Object.hasOwnProperty.call(message, "delayDuration")) + $root.google.protobuf.Duration.encode(message.delayDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.breakDuration != null && Object.hasOwnProperty.call(message, "breakDuration")) + $root.google.protobuf.Duration.encode(message.breakDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.waitDuration != null && Object.hasOwnProperty.call(message, "waitDuration")) + $root.google.protobuf.Duration.encode(message.waitDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.totalDuration != null && Object.hasOwnProperty.call(message, "totalDuration")) + $root.google.protobuf.Duration.encode(message.totalDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.routePolyline != null && Object.hasOwnProperty.call(message, "routePolyline")) + $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.encode(message.routePolyline, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.vehicleLoads != null && Object.hasOwnProperty.call(message, "vehicleLoads")) + for (var keys = Object.keys(message.vehicleLoads), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.encode(message.vehicleLoads[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Transition message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Transition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.ITransition} message Transition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Transition message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.travelDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.travelDistanceMeters = reader.double(); + break; + } + case 3: { + message.trafficInfoUnavailable = reader.bool(); + break; + } + case 4: { + message.delayDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.breakDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.waitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.totalDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.routePolyline = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.vehicleLoads === $util.emptyObject) + message.vehicleLoads = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.vehicleLoads[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Transition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Transition} Transition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Transition message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Transition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) { + var error = $root.google.protobuf.Duration.verify(message.travelDuration); + if (error) + return "travelDuration." + error; + } + if (message.travelDistanceMeters != null && message.hasOwnProperty("travelDistanceMeters")) + if (typeof message.travelDistanceMeters !== "number") + return "travelDistanceMeters: number expected"; + if (message.trafficInfoUnavailable != null && message.hasOwnProperty("trafficInfoUnavailable")) + if (typeof message.trafficInfoUnavailable !== "boolean") + return "trafficInfoUnavailable: boolean expected"; + if (message.delayDuration != null && message.hasOwnProperty("delayDuration")) { + var error = $root.google.protobuf.Duration.verify(message.delayDuration); + if (error) + return "delayDuration." + error; + } + if (message.breakDuration != null && message.hasOwnProperty("breakDuration")) { + var error = $root.google.protobuf.Duration.verify(message.breakDuration); + if (error) + return "breakDuration." + error; + } + if (message.waitDuration != null && message.hasOwnProperty("waitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.waitDuration); + if (error) + return "waitDuration." + error; + } + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) { + var error = $root.google.protobuf.Duration.verify(message.totalDuration); + if (error) + return "totalDuration." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.routePolyline != null && message.hasOwnProperty("routePolyline")) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.verify(message.routePolyline); + if (error) + return "routePolyline." + error; + } + if (message.vehicleLoads != null && message.hasOwnProperty("vehicleLoads")) { + if (!$util.isObject(message.vehicleLoads)) + return "vehicleLoads: object expected"; + var key = Object.keys(message.vehicleLoads); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.verify(message.vehicleLoads[key[i]]); + if (error) + return "vehicleLoads." + error; + } + } + return null; + }; + + /** + * Creates a Transition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Transition} Transition + */ + Transition.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.Transition(); + if (object.travelDuration != null) { + if (typeof object.travelDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.travelDuration: object expected"); + message.travelDuration = $root.google.protobuf.Duration.fromObject(object.travelDuration); + } + if (object.travelDistanceMeters != null) + message.travelDistanceMeters = Number(object.travelDistanceMeters); + if (object.trafficInfoUnavailable != null) + message.trafficInfoUnavailable = Boolean(object.trafficInfoUnavailable); + if (object.delayDuration != null) { + if (typeof object.delayDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.delayDuration: object expected"); + message.delayDuration = $root.google.protobuf.Duration.fromObject(object.delayDuration); + } + if (object.breakDuration != null) { + if (typeof object.breakDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.breakDuration: object expected"); + message.breakDuration = $root.google.protobuf.Duration.fromObject(object.breakDuration); + } + if (object.waitDuration != null) { + if (typeof object.waitDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.waitDuration: object expected"); + message.waitDuration = $root.google.protobuf.Duration.fromObject(object.waitDuration); + } + if (object.totalDuration != null) { + if (typeof object.totalDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.totalDuration: object expected"); + message.totalDuration = $root.google.protobuf.Duration.fromObject(object.totalDuration); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.routePolyline != null) { + if (typeof object.routePolyline !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.routePolyline: object expected"); + message.routePolyline = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.fromObject(object.routePolyline); + } + if (object.vehicleLoads) { + if (typeof object.vehicleLoads !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicleLoads: object expected"); + message.vehicleLoads = {}; + for (var keys = Object.keys(object.vehicleLoads), i = 0; i < keys.length; ++i) { + if (typeof object.vehicleLoads[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicleLoads: object expected"); + message.vehicleLoads[keys[i]] = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.fromObject(object.vehicleLoads[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Transition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.Transition} message Transition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Transition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.vehicleLoads = {}; + if (options.defaults) { + object.travelDuration = null; + object.travelDistanceMeters = 0; + object.trafficInfoUnavailable = false; + object.delayDuration = null; + object.breakDuration = null; + object.waitDuration = null; + object.totalDuration = null; + object.startTime = null; + object.routePolyline = null; + } + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) + object.travelDuration = $root.google.protobuf.Duration.toObject(message.travelDuration, options); + if (message.travelDistanceMeters != null && message.hasOwnProperty("travelDistanceMeters")) + object.travelDistanceMeters = options.json && !isFinite(message.travelDistanceMeters) ? String(message.travelDistanceMeters) : message.travelDistanceMeters; + if (message.trafficInfoUnavailable != null && message.hasOwnProperty("trafficInfoUnavailable")) + object.trafficInfoUnavailable = message.trafficInfoUnavailable; + if (message.delayDuration != null && message.hasOwnProperty("delayDuration")) + object.delayDuration = $root.google.protobuf.Duration.toObject(message.delayDuration, options); + if (message.breakDuration != null && message.hasOwnProperty("breakDuration")) + object.breakDuration = $root.google.protobuf.Duration.toObject(message.breakDuration, options); + if (message.waitDuration != null && message.hasOwnProperty("waitDuration")) + object.waitDuration = $root.google.protobuf.Duration.toObject(message.waitDuration, options); + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) + object.totalDuration = $root.google.protobuf.Duration.toObject(message.totalDuration, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.routePolyline != null && message.hasOwnProperty("routePolyline")) + object.routePolyline = $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.toObject(message.routePolyline, options); + var keys2; + if (message.vehicleLoads && (keys2 = Object.keys(message.vehicleLoads)).length) { + object.vehicleLoads = {}; + for (var j = 0; j < keys2.length; ++j) + object.vehicleLoads[keys2[j]] = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.toObject(message.vehicleLoads[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Transition to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @instance + * @returns {Object.} JSON object + */ + Transition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Transition + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Transition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentRoute.Transition"; + }; + + return Transition; + })(); + + ShipmentRoute.VehicleLoad = (function() { + + /** + * Properties of a VehicleLoad. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @interface IVehicleLoad + * @property {number|Long|null} [amount] VehicleLoad amount + */ + + /** + * Constructs a new VehicleLoad. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @classdesc Represents a VehicleLoad. + * @implements IVehicleLoad + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad=} [properties] Properties to set + */ + function VehicleLoad(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VehicleLoad amount. + * @member {number|Long} amount + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @instance + */ + VehicleLoad.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new VehicleLoad instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} VehicleLoad instance + */ + VehicleLoad.create = function create(properties) { + return new VehicleLoad(properties); + }; + + /** + * Encodes the specified VehicleLoad message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad} message VehicleLoad message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VehicleLoad.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amount); + return writer; + }; + + /** + * Encodes the specified VehicleLoad message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IVehicleLoad} message VehicleLoad message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VehicleLoad.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VehicleLoad message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} VehicleLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VehicleLoad.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.amount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VehicleLoad message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} VehicleLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VehicleLoad.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VehicleLoad message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VehicleLoad.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + return null; + }; + + /** + * Creates a VehicleLoad message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} VehicleLoad + */ + VehicleLoad.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = false; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a VehicleLoad message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad} message VehicleLoad + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VehicleLoad.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount; + return object; + }; + + /** + * Converts this VehicleLoad to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @instance + * @returns {Object.} JSON object + */ + VehicleLoad.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VehicleLoad + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VehicleLoad.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad"; + }; + + return VehicleLoad; + })(); + + ShipmentRoute.EncodedPolyline = (function() { + + /** + * Properties of an EncodedPolyline. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @interface IEncodedPolyline + * @property {string|null} [points] EncodedPolyline points + */ + + /** + * Constructs a new EncodedPolyline. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @classdesc Represents an EncodedPolyline. + * @implements IEncodedPolyline + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline=} [properties] Properties to set + */ + function EncodedPolyline(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncodedPolyline points. + * @member {string} points + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @instance + */ + EncodedPolyline.prototype.points = ""; + + /** + * Creates a new EncodedPolyline instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} EncodedPolyline instance + */ + EncodedPolyline.create = function create(properties) { + return new EncodedPolyline(properties); + }; + + /** + * Encodes the specified EncodedPolyline message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline} message EncodedPolyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncodedPolyline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.points != null && Object.hasOwnProperty.call(message, "points")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.points); + return writer; + }; + + /** + * Encodes the specified EncodedPolyline message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IEncodedPolyline} message EncodedPolyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncodedPolyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncodedPolyline message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} EncodedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncodedPolyline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.points = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncodedPolyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} EncodedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncodedPolyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncodedPolyline message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncodedPolyline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.points != null && message.hasOwnProperty("points")) + if (!$util.isString(message.points)) + return "points: string expected"; + return null; + }; + + /** + * Creates an EncodedPolyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} EncodedPolyline + */ + EncodedPolyline.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline(); + if (object.points != null) + message.points = String(object.points); + return message; + }; + + /** + * Creates a plain object from an EncodedPolyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline} message EncodedPolyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncodedPolyline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.points = ""; + if (message.points != null && message.hasOwnProperty("points")) + object.points = message.points; + return object; + }; + + /** + * Converts this EncodedPolyline to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @instance + * @returns {Object.} JSON object + */ + EncodedPolyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncodedPolyline + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncodedPolyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline"; + }; + + return EncodedPolyline; + })(); + + ShipmentRoute.Break = (function() { + + /** + * Properties of a Break. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @interface IBreak + * @property {google.protobuf.ITimestamp|null} [startTime] Break startTime + * @property {google.protobuf.IDuration|null} [duration] Break duration + */ + + /** + * Constructs a new Break. + * @memberof google.maps.routeoptimization.v1.ShipmentRoute + * @classdesc Represents a Break. + * @implements IBreak + * @constructor + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IBreak=} [properties] Properties to set + */ + function Break(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Break startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @instance + */ + Break.prototype.startTime = null; + + /** + * Break duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @instance + */ + Break.prototype.duration = null; + + /** + * Creates a new Break instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IBreak=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Break} Break instance + */ + Break.create = function create(properties) { + return new Break(properties); + }; + + /** + * Encodes the specified Break message. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Break.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IBreak} message Break message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Break.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Break message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.ShipmentRoute.Break.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.IBreak} message Break message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Break.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Break message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Break} Break + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Break.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.Break(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Break message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Break} Break + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Break.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Break message. + * @function verify + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Break.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a Break message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.ShipmentRoute.Break} Break + */ + Break.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.ShipmentRoute.Break) + return object; + var message = new $root.google.maps.routeoptimization.v1.ShipmentRoute.Break(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Break.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.ShipmentRoute.Break.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a Break message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {google.maps.routeoptimization.v1.ShipmentRoute.Break} message Break + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Break.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.duration = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this Break to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @instance + * @returns {Object.} JSON object + */ + Break.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Break + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.ShipmentRoute.Break + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Break.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.ShipmentRoute.Break"; + }; + + return Break; + })(); + + return ShipmentRoute; + })(); + + v1.SkippedShipment = (function() { + + /** + * Properties of a SkippedShipment. + * @memberof google.maps.routeoptimization.v1 + * @interface ISkippedShipment + * @property {number|null} [index] SkippedShipment index + * @property {string|null} [label] SkippedShipment label + * @property {Array.|null} [reasons] SkippedShipment reasons + */ + + /** + * Constructs a new SkippedShipment. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a SkippedShipment. + * @implements ISkippedShipment + * @constructor + * @param {google.maps.routeoptimization.v1.ISkippedShipment=} [properties] Properties to set + */ + function SkippedShipment(properties) { + this.reasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkippedShipment index. + * @member {number} index + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @instance + */ + SkippedShipment.prototype.index = 0; + + /** + * SkippedShipment label. + * @member {string} label + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @instance + */ + SkippedShipment.prototype.label = ""; + + /** + * SkippedShipment reasons. + * @member {Array.} reasons + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @instance + */ + SkippedShipment.prototype.reasons = $util.emptyArray; + + /** + * Creates a new SkippedShipment instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {google.maps.routeoptimization.v1.ISkippedShipment=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.SkippedShipment} SkippedShipment instance + */ + SkippedShipment.create = function create(properties) { + return new SkippedShipment(properties); + }; + + /** + * Encodes the specified SkippedShipment message. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {google.maps.routeoptimization.v1.ISkippedShipment} message SkippedShipment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkippedShipment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.reasons != null && message.reasons.length) + for (var i = 0; i < message.reasons.length; ++i) + $root.google.maps.routeoptimization.v1.SkippedShipment.Reason.encode(message.reasons[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SkippedShipment message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {google.maps.routeoptimization.v1.ISkippedShipment} message SkippedShipment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkippedShipment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkippedShipment message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.SkippedShipment} SkippedShipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkippedShipment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.SkippedShipment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.index = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + message.reasons.push($root.google.maps.routeoptimization.v1.SkippedShipment.Reason.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkippedShipment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.SkippedShipment} SkippedShipment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkippedShipment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkippedShipment message. + * @function verify + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkippedShipment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.SkippedShipment.Reason.verify(message.reasons[i]); + if (error) + return "reasons." + error; + } + } + return null; + }; + + /** + * Creates a SkippedShipment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.SkippedShipment} SkippedShipment + */ + SkippedShipment.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.SkippedShipment) + return object; + var message = new $root.google.maps.routeoptimization.v1.SkippedShipment(); + if (object.index != null) + message.index = object.index | 0; + if (object.label != null) + message.label = String(object.label); + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.maps.routeoptimization.v1.SkippedShipment.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) { + if (typeof object.reasons[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.SkippedShipment.reasons: object expected"); + message.reasons[i] = $root.google.maps.routeoptimization.v1.SkippedShipment.Reason.fromObject(object.reasons[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SkippedShipment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {google.maps.routeoptimization.v1.SkippedShipment} message SkippedShipment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkippedShipment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; + if (options.defaults) { + object.index = 0; + object.label = ""; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = $root.google.maps.routeoptimization.v1.SkippedShipment.Reason.toObject(message.reasons[j], options); + } + return object; + }; + + /** + * Converts this SkippedShipment to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @instance + * @returns {Object.} JSON object + */ + SkippedShipment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkippedShipment + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkippedShipment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.SkippedShipment"; + }; + + SkippedShipment.Reason = (function() { + + /** + * Properties of a Reason. + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @interface IReason + * @property {google.maps.routeoptimization.v1.SkippedShipment.Reason.Code|null} [code] Reason code + * @property {number|null} [exampleVehicleIndex] Reason exampleVehicleIndex + * @property {string|null} [exampleExceededCapacityType] Reason exampleExceededCapacityType + */ + + /** + * Constructs a new Reason. + * @memberof google.maps.routeoptimization.v1.SkippedShipment + * @classdesc Represents a Reason. + * @implements IReason + * @constructor + * @param {google.maps.routeoptimization.v1.SkippedShipment.IReason=} [properties] Properties to set + */ + function Reason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reason code. + * @member {google.maps.routeoptimization.v1.SkippedShipment.Reason.Code} code + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @instance + */ + Reason.prototype.code = 0; + + /** + * Reason exampleVehicleIndex. + * @member {number|null|undefined} exampleVehicleIndex + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @instance + */ + Reason.prototype.exampleVehicleIndex = null; + + /** + * Reason exampleExceededCapacityType. + * @member {string} exampleExceededCapacityType + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @instance + */ + Reason.prototype.exampleExceededCapacityType = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Reason _exampleVehicleIndex. + * @member {"exampleVehicleIndex"|undefined} _exampleVehicleIndex + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @instance + */ + Object.defineProperty(Reason.prototype, "_exampleVehicleIndex", { + get: $util.oneOfGetter($oneOfFields = ["exampleVehicleIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Reason instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {google.maps.routeoptimization.v1.SkippedShipment.IReason=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.SkippedShipment.Reason} Reason instance + */ + Reason.create = function create(properties) { + return new Reason(properties); + }; + + /** + * Encodes the specified Reason message. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.Reason.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {google.maps.routeoptimization.v1.SkippedShipment.IReason} message Reason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.exampleVehicleIndex != null && Object.hasOwnProperty.call(message, "exampleVehicleIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exampleVehicleIndex); + if (message.exampleExceededCapacityType != null && Object.hasOwnProperty.call(message, "exampleExceededCapacityType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exampleExceededCapacityType); + return writer; + }; + + /** + * Encodes the specified Reason message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.SkippedShipment.Reason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {google.maps.routeoptimization.v1.SkippedShipment.IReason} message Reason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reason message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.SkippedShipment.Reason} Reason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reason.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.SkippedShipment.Reason(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.exampleVehicleIndex = reader.int32(); + break; + } + case 3: { + message.exampleExceededCapacityType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.SkippedShipment.Reason} Reason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reason message. + * @function verify + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.exampleVehicleIndex != null && message.hasOwnProperty("exampleVehicleIndex")) { + properties._exampleVehicleIndex = 1; + if (!$util.isInteger(message.exampleVehicleIndex)) + return "exampleVehicleIndex: integer expected"; + } + if (message.exampleExceededCapacityType != null && message.hasOwnProperty("exampleExceededCapacityType")) + if (!$util.isString(message.exampleExceededCapacityType)) + return "exampleExceededCapacityType: string expected"; + return null; + }; + + /** + * Creates a Reason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.SkippedShipment.Reason} Reason + */ + Reason.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.SkippedShipment.Reason) + return object; + var message = new $root.google.maps.routeoptimization.v1.SkippedShipment.Reason(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "NO_VEHICLE": + case 1: + message.code = 1; + break; + case "DEMAND_EXCEEDS_VEHICLE_CAPACITY": + case 2: + message.code = 2; + break; + case "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT": + case 3: + message.code = 3; + break; + case "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT": + case 4: + message.code = 4; + break; + case "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT": + case 5: + message.code = 5; + break; + case "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS": + case 6: + message.code = 6; + break; + case "VEHICLE_NOT_ALLOWED": + case 7: + message.code = 7; + break; + } + if (object.exampleVehicleIndex != null) + message.exampleVehicleIndex = object.exampleVehicleIndex | 0; + if (object.exampleExceededCapacityType != null) + message.exampleExceededCapacityType = String(object.exampleExceededCapacityType); + return message; + }; + + /** + * Creates a plain object from a Reason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {google.maps.routeoptimization.v1.SkippedShipment.Reason} message Reason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.exampleExceededCapacityType = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code[message.code] === undefined ? message.code : $root.google.maps.routeoptimization.v1.SkippedShipment.Reason.Code[message.code] : message.code; + if (message.exampleVehicleIndex != null && message.hasOwnProperty("exampleVehicleIndex")) { + object.exampleVehicleIndex = message.exampleVehicleIndex; + if (options.oneofs) + object._exampleVehicleIndex = "exampleVehicleIndex"; + } + if (message.exampleExceededCapacityType != null && message.hasOwnProperty("exampleExceededCapacityType")) + object.exampleExceededCapacityType = message.exampleExceededCapacityType; + return object; + }; + + /** + * Converts this Reason to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @instance + * @returns {Object.} JSON object + */ + Reason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Reason + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.SkippedShipment.Reason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Reason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.SkippedShipment.Reason"; + }; + + /** + * Code enum. + * @name google.maps.routeoptimization.v1.SkippedShipment.Reason.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} NO_VEHICLE=1 NO_VEHICLE value + * @property {number} DEMAND_EXCEEDS_VEHICLE_CAPACITY=2 DEMAND_EXCEEDS_VEHICLE_CAPACITY value + * @property {number} CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT=3 CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT value + * @property {number} CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT=4 CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT value + * @property {number} CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT=5 CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT value + * @property {number} CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS=6 CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS value + * @property {number} VEHICLE_NOT_ALLOWED=7 VEHICLE_NOT_ALLOWED value + */ + Reason.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_VEHICLE"] = 1; + values[valuesById[2] = "DEMAND_EXCEEDS_VEHICLE_CAPACITY"] = 2; + values[valuesById[3] = "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT"] = 3; + values[valuesById[4] = "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT"] = 4; + values[valuesById[5] = "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT"] = 5; + values[valuesById[6] = "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS"] = 6; + values[valuesById[7] = "VEHICLE_NOT_ALLOWED"] = 7; + return values; + })(); + + return Reason; + })(); + + return SkippedShipment; + })(); + + v1.AggregatedMetrics = (function() { + + /** + * Properties of an AggregatedMetrics. + * @memberof google.maps.routeoptimization.v1 + * @interface IAggregatedMetrics + * @property {number|null} [performedShipmentCount] AggregatedMetrics performedShipmentCount + * @property {google.protobuf.IDuration|null} [travelDuration] AggregatedMetrics travelDuration + * @property {google.protobuf.IDuration|null} [waitDuration] AggregatedMetrics waitDuration + * @property {google.protobuf.IDuration|null} [delayDuration] AggregatedMetrics delayDuration + * @property {google.protobuf.IDuration|null} [breakDuration] AggregatedMetrics breakDuration + * @property {google.protobuf.IDuration|null} [visitDuration] AggregatedMetrics visitDuration + * @property {google.protobuf.IDuration|null} [totalDuration] AggregatedMetrics totalDuration + * @property {number|null} [travelDistanceMeters] AggregatedMetrics travelDistanceMeters + * @property {Object.|null} [maxLoads] AggregatedMetrics maxLoads + */ + + /** + * Constructs a new AggregatedMetrics. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an AggregatedMetrics. + * @implements IAggregatedMetrics + * @constructor + * @param {google.maps.routeoptimization.v1.IAggregatedMetrics=} [properties] Properties to set + */ + function AggregatedMetrics(properties) { + this.maxLoads = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedMetrics performedShipmentCount. + * @member {number} performedShipmentCount + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.performedShipmentCount = 0; + + /** + * AggregatedMetrics travelDuration. + * @member {google.protobuf.IDuration|null|undefined} travelDuration + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.travelDuration = null; + + /** + * AggregatedMetrics waitDuration. + * @member {google.protobuf.IDuration|null|undefined} waitDuration + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.waitDuration = null; + + /** + * AggregatedMetrics delayDuration. + * @member {google.protobuf.IDuration|null|undefined} delayDuration + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.delayDuration = null; + + /** + * AggregatedMetrics breakDuration. + * @member {google.protobuf.IDuration|null|undefined} breakDuration + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.breakDuration = null; + + /** + * AggregatedMetrics visitDuration. + * @member {google.protobuf.IDuration|null|undefined} visitDuration + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.visitDuration = null; + + /** + * AggregatedMetrics totalDuration. + * @member {google.protobuf.IDuration|null|undefined} totalDuration + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.totalDuration = null; + + /** + * AggregatedMetrics travelDistanceMeters. + * @member {number} travelDistanceMeters + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.travelDistanceMeters = 0; + + /** + * AggregatedMetrics maxLoads. + * @member {Object.} maxLoads + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.maxLoads = $util.emptyObject; + + /** + * Creates a new AggregatedMetrics instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {google.maps.routeoptimization.v1.IAggregatedMetrics=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.AggregatedMetrics} AggregatedMetrics instance + */ + AggregatedMetrics.create = function create(properties) { + return new AggregatedMetrics(properties); + }; + + /** + * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.maps.routeoptimization.v1.AggregatedMetrics.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {google.maps.routeoptimization.v1.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.performedShipmentCount != null && Object.hasOwnProperty.call(message, "performedShipmentCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.performedShipmentCount); + if (message.travelDuration != null && Object.hasOwnProperty.call(message, "travelDuration")) + $root.google.protobuf.Duration.encode(message.travelDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.waitDuration != null && Object.hasOwnProperty.call(message, "waitDuration")) + $root.google.protobuf.Duration.encode(message.waitDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.delayDuration != null && Object.hasOwnProperty.call(message, "delayDuration")) + $root.google.protobuf.Duration.encode(message.delayDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.breakDuration != null && Object.hasOwnProperty.call(message, "breakDuration")) + $root.google.protobuf.Duration.encode(message.breakDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.visitDuration != null && Object.hasOwnProperty.call(message, "visitDuration")) + $root.google.protobuf.Duration.encode(message.visitDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.totalDuration != null && Object.hasOwnProperty.call(message, "totalDuration")) + $root.google.protobuf.Duration.encode(message.totalDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.travelDistanceMeters != null && Object.hasOwnProperty.call(message, "travelDistanceMeters")) + writer.uint32(/* id 8, wireType 1 =*/65).double(message.travelDistanceMeters); + if (message.maxLoads != null && Object.hasOwnProperty.call(message, "maxLoads")) + for (var keys = Object.keys(message.maxLoads), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.encode(message.maxLoads[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.AggregatedMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {google.maps.routeoptimization.v1.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.AggregatedMetrics} AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.AggregatedMetrics(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.performedShipmentCount = reader.int32(); + break; + } + case 2: { + message.travelDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.waitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.delayDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.breakDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.visitDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.totalDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.travelDistanceMeters = reader.double(); + break; + } + case 9: { + if (message.maxLoads === $util.emptyObject) + message.maxLoads = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.maxLoads[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.AggregatedMetrics} AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedMetrics message. + * @function verify + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.performedShipmentCount != null && message.hasOwnProperty("performedShipmentCount")) + if (!$util.isInteger(message.performedShipmentCount)) + return "performedShipmentCount: integer expected"; + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) { + var error = $root.google.protobuf.Duration.verify(message.travelDuration); + if (error) + return "travelDuration." + error; + } + if (message.waitDuration != null && message.hasOwnProperty("waitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.waitDuration); + if (error) + return "waitDuration." + error; + } + if (message.delayDuration != null && message.hasOwnProperty("delayDuration")) { + var error = $root.google.protobuf.Duration.verify(message.delayDuration); + if (error) + return "delayDuration." + error; + } + if (message.breakDuration != null && message.hasOwnProperty("breakDuration")) { + var error = $root.google.protobuf.Duration.verify(message.breakDuration); + if (error) + return "breakDuration." + error; + } + if (message.visitDuration != null && message.hasOwnProperty("visitDuration")) { + var error = $root.google.protobuf.Duration.verify(message.visitDuration); + if (error) + return "visitDuration." + error; + } + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) { + var error = $root.google.protobuf.Duration.verify(message.totalDuration); + if (error) + return "totalDuration." + error; + } + if (message.travelDistanceMeters != null && message.hasOwnProperty("travelDistanceMeters")) + if (typeof message.travelDistanceMeters !== "number") + return "travelDistanceMeters: number expected"; + if (message.maxLoads != null && message.hasOwnProperty("maxLoads")) { + if (!$util.isObject(message.maxLoads)) + return "maxLoads: object expected"; + var key = Object.keys(message.maxLoads); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.verify(message.maxLoads[key[i]]); + if (error) + return "maxLoads." + error; + } + } + return null; + }; + + /** + * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.AggregatedMetrics} AggregatedMetrics + */ + AggregatedMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.AggregatedMetrics) + return object; + var message = new $root.google.maps.routeoptimization.v1.AggregatedMetrics(); + if (object.performedShipmentCount != null) + message.performedShipmentCount = object.performedShipmentCount | 0; + if (object.travelDuration != null) { + if (typeof object.travelDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.travelDuration: object expected"); + message.travelDuration = $root.google.protobuf.Duration.fromObject(object.travelDuration); + } + if (object.waitDuration != null) { + if (typeof object.waitDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.waitDuration: object expected"); + message.waitDuration = $root.google.protobuf.Duration.fromObject(object.waitDuration); + } + if (object.delayDuration != null) { + if (typeof object.delayDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.delayDuration: object expected"); + message.delayDuration = $root.google.protobuf.Duration.fromObject(object.delayDuration); + } + if (object.breakDuration != null) { + if (typeof object.breakDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.breakDuration: object expected"); + message.breakDuration = $root.google.protobuf.Duration.fromObject(object.breakDuration); + } + if (object.visitDuration != null) { + if (typeof object.visitDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.visitDuration: object expected"); + message.visitDuration = $root.google.protobuf.Duration.fromObject(object.visitDuration); + } + if (object.totalDuration != null) { + if (typeof object.totalDuration !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.totalDuration: object expected"); + message.totalDuration = $root.google.protobuf.Duration.fromObject(object.totalDuration); + } + if (object.travelDistanceMeters != null) + message.travelDistanceMeters = Number(object.travelDistanceMeters); + if (object.maxLoads) { + if (typeof object.maxLoads !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.maxLoads: object expected"); + message.maxLoads = {}; + for (var keys = Object.keys(object.maxLoads), i = 0; i < keys.length; ++i) { + if (typeof object.maxLoads[keys[i]] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.AggregatedMetrics.maxLoads: object expected"); + message.maxLoads[keys[i]] = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.fromObject(object.maxLoads[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {google.maps.routeoptimization.v1.AggregatedMetrics} message AggregatedMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.maxLoads = {}; + if (options.defaults) { + object.performedShipmentCount = 0; + object.travelDuration = null; + object.waitDuration = null; + object.delayDuration = null; + object.breakDuration = null; + object.visitDuration = null; + object.totalDuration = null; + object.travelDistanceMeters = 0; + } + if (message.performedShipmentCount != null && message.hasOwnProperty("performedShipmentCount")) + object.performedShipmentCount = message.performedShipmentCount; + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) + object.travelDuration = $root.google.protobuf.Duration.toObject(message.travelDuration, options); + if (message.waitDuration != null && message.hasOwnProperty("waitDuration")) + object.waitDuration = $root.google.protobuf.Duration.toObject(message.waitDuration, options); + if (message.delayDuration != null && message.hasOwnProperty("delayDuration")) + object.delayDuration = $root.google.protobuf.Duration.toObject(message.delayDuration, options); + if (message.breakDuration != null && message.hasOwnProperty("breakDuration")) + object.breakDuration = $root.google.protobuf.Duration.toObject(message.breakDuration, options); + if (message.visitDuration != null && message.hasOwnProperty("visitDuration")) + object.visitDuration = $root.google.protobuf.Duration.toObject(message.visitDuration, options); + if (message.totalDuration != null && message.hasOwnProperty("totalDuration")) + object.totalDuration = $root.google.protobuf.Duration.toObject(message.totalDuration, options); + if (message.travelDistanceMeters != null && message.hasOwnProperty("travelDistanceMeters")) + object.travelDistanceMeters = options.json && !isFinite(message.travelDistanceMeters) ? String(message.travelDistanceMeters) : message.travelDistanceMeters; + var keys2; + if (message.maxLoads && (keys2 = Object.keys(message.maxLoads)).length) { + object.maxLoads = {}; + for (var j = 0; j < keys2.length; ++j) + object.maxLoads[keys2[j]] = $root.google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad.toObject(message.maxLoads[keys2[j]], options); + } + return object; + }; + + /** + * Converts this AggregatedMetrics to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @instance + * @returns {Object.} JSON object + */ + AggregatedMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregatedMetrics + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.AggregatedMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregatedMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.AggregatedMetrics"; + }; + + return AggregatedMetrics; + })(); + + v1.InjectedSolutionConstraint = (function() { + + /** + * Properties of an InjectedSolutionConstraint. + * @memberof google.maps.routeoptimization.v1 + * @interface IInjectedSolutionConstraint + * @property {Array.|null} [routes] InjectedSolutionConstraint routes + * @property {Array.|null} [skippedShipments] InjectedSolutionConstraint skippedShipments + * @property {Array.|null} [constraintRelaxations] InjectedSolutionConstraint constraintRelaxations + */ + + /** + * Constructs a new InjectedSolutionConstraint. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an InjectedSolutionConstraint. + * @implements IInjectedSolutionConstraint + * @constructor + * @param {google.maps.routeoptimization.v1.IInjectedSolutionConstraint=} [properties] Properties to set + */ + function InjectedSolutionConstraint(properties) { + this.routes = []; + this.skippedShipments = []; + this.constraintRelaxations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InjectedSolutionConstraint routes. + * @member {Array.} routes + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @instance + */ + InjectedSolutionConstraint.prototype.routes = $util.emptyArray; + + /** + * InjectedSolutionConstraint skippedShipments. + * @member {Array.} skippedShipments + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @instance + */ + InjectedSolutionConstraint.prototype.skippedShipments = $util.emptyArray; + + /** + * InjectedSolutionConstraint constraintRelaxations. + * @member {Array.} constraintRelaxations + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @instance + */ + InjectedSolutionConstraint.prototype.constraintRelaxations = $util.emptyArray; + + /** + * Creates a new InjectedSolutionConstraint instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {google.maps.routeoptimization.v1.IInjectedSolutionConstraint=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint} InjectedSolutionConstraint instance + */ + InjectedSolutionConstraint.create = function create(properties) { + return new InjectedSolutionConstraint(properties); + }; + + /** + * Encodes the specified InjectedSolutionConstraint message. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {google.maps.routeoptimization.v1.IInjectedSolutionConstraint} message InjectedSolutionConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectedSolutionConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routes != null && message.routes.length) + for (var i = 0; i < message.routes.length; ++i) + $root.google.maps.routeoptimization.v1.ShipmentRoute.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skippedShipments != null && message.skippedShipments.length) + for (var i = 0; i < message.skippedShipments.length; ++i) + $root.google.maps.routeoptimization.v1.SkippedShipment.encode(message.skippedShipments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.constraintRelaxations != null && message.constraintRelaxations.length) + for (var i = 0; i < message.constraintRelaxations.length; ++i) + $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.encode(message.constraintRelaxations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InjectedSolutionConstraint message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {google.maps.routeoptimization.v1.IInjectedSolutionConstraint} message InjectedSolutionConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectedSolutionConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InjectedSolutionConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint} InjectedSolutionConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectedSolutionConstraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.routes && message.routes.length)) + message.routes = []; + message.routes.push($root.google.maps.routeoptimization.v1.ShipmentRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.skippedShipments && message.skippedShipments.length)) + message.skippedShipments = []; + message.skippedShipments.push($root.google.maps.routeoptimization.v1.SkippedShipment.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.constraintRelaxations && message.constraintRelaxations.length)) + message.constraintRelaxations = []; + message.constraintRelaxations.push($root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InjectedSolutionConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint} InjectedSolutionConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectedSolutionConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InjectedSolutionConstraint message. + * @function verify + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InjectedSolutionConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routes != null && message.hasOwnProperty("routes")) { + if (!Array.isArray(message.routes)) + return "routes: array expected"; + for (var i = 0; i < message.routes.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.ShipmentRoute.verify(message.routes[i]); + if (error) + return "routes." + error; + } + } + if (message.skippedShipments != null && message.hasOwnProperty("skippedShipments")) { + if (!Array.isArray(message.skippedShipments)) + return "skippedShipments: array expected"; + for (var i = 0; i < message.skippedShipments.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.SkippedShipment.verify(message.skippedShipments[i]); + if (error) + return "skippedShipments." + error; + } + } + if (message.constraintRelaxations != null && message.hasOwnProperty("constraintRelaxations")) { + if (!Array.isArray(message.constraintRelaxations)) + return "constraintRelaxations: array expected"; + for (var i = 0; i < message.constraintRelaxations.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.verify(message.constraintRelaxations[i]); + if (error) + return "constraintRelaxations." + error; + } + } + return null; + }; + + /** + * Creates an InjectedSolutionConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint} InjectedSolutionConstraint + */ + InjectedSolutionConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint) + return object; + var message = new $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint(); + if (object.routes) { + if (!Array.isArray(object.routes)) + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.routes: array expected"); + message.routes = []; + for (var i = 0; i < object.routes.length; ++i) { + if (typeof object.routes[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.routes: object expected"); + message.routes[i] = $root.google.maps.routeoptimization.v1.ShipmentRoute.fromObject(object.routes[i]); + } + } + if (object.skippedShipments) { + if (!Array.isArray(object.skippedShipments)) + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.skippedShipments: array expected"); + message.skippedShipments = []; + for (var i = 0; i < object.skippedShipments.length; ++i) { + if (typeof object.skippedShipments[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.skippedShipments: object expected"); + message.skippedShipments[i] = $root.google.maps.routeoptimization.v1.SkippedShipment.fromObject(object.skippedShipments[i]); + } + } + if (object.constraintRelaxations) { + if (!Array.isArray(object.constraintRelaxations)) + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.constraintRelaxations: array expected"); + message.constraintRelaxations = []; + for (var i = 0; i < object.constraintRelaxations.length; ++i) { + if (typeof object.constraintRelaxations[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.constraintRelaxations: object expected"); + message.constraintRelaxations[i] = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.fromObject(object.constraintRelaxations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InjectedSolutionConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint} message InjectedSolutionConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InjectedSolutionConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.routes = []; + object.skippedShipments = []; + object.constraintRelaxations = []; + } + if (message.routes && message.routes.length) { + object.routes = []; + for (var j = 0; j < message.routes.length; ++j) + object.routes[j] = $root.google.maps.routeoptimization.v1.ShipmentRoute.toObject(message.routes[j], options); + } + if (message.skippedShipments && message.skippedShipments.length) { + object.skippedShipments = []; + for (var j = 0; j < message.skippedShipments.length; ++j) + object.skippedShipments[j] = $root.google.maps.routeoptimization.v1.SkippedShipment.toObject(message.skippedShipments[j], options); + } + if (message.constraintRelaxations && message.constraintRelaxations.length) { + object.constraintRelaxations = []; + for (var j = 0; j < message.constraintRelaxations.length; ++j) + object.constraintRelaxations[j] = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.toObject(message.constraintRelaxations[j], options); + } + return object; + }; + + /** + * Converts this InjectedSolutionConstraint to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @instance + * @returns {Object.} JSON object + */ + InjectedSolutionConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InjectedSolutionConstraint + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InjectedSolutionConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.InjectedSolutionConstraint"; + }; + + InjectedSolutionConstraint.ConstraintRelaxation = (function() { + + /** + * Properties of a ConstraintRelaxation. + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @interface IConstraintRelaxation + * @property {Array.|null} [relaxations] ConstraintRelaxation relaxations + * @property {Array.|null} [vehicleIndices] ConstraintRelaxation vehicleIndices + */ + + /** + * Constructs a new ConstraintRelaxation. + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint + * @classdesc Represents a ConstraintRelaxation. + * @implements IConstraintRelaxation + * @constructor + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation=} [properties] Properties to set + */ + function ConstraintRelaxation(properties) { + this.relaxations = []; + this.vehicleIndices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConstraintRelaxation relaxations. + * @member {Array.} relaxations + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @instance + */ + ConstraintRelaxation.prototype.relaxations = $util.emptyArray; + + /** + * ConstraintRelaxation vehicleIndices. + * @member {Array.} vehicleIndices + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @instance + */ + ConstraintRelaxation.prototype.vehicleIndices = $util.emptyArray; + + /** + * Creates a new ConstraintRelaxation instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} ConstraintRelaxation instance + */ + ConstraintRelaxation.create = function create(properties) { + return new ConstraintRelaxation(properties); + }; + + /** + * Encodes the specified ConstraintRelaxation message. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation} message ConstraintRelaxation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConstraintRelaxation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relaxations != null && message.relaxations.length) + for (var i = 0; i < message.relaxations.length; ++i) + $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.encode(message.relaxations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vehicleIndices != null && message.vehicleIndices.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.vehicleIndices.length; ++i) + writer.int32(message.vehicleIndices[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ConstraintRelaxation message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.IConstraintRelaxation} message ConstraintRelaxation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConstraintRelaxation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConstraintRelaxation message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} ConstraintRelaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConstraintRelaxation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.relaxations && message.relaxations.length)) + message.relaxations = []; + message.relaxations.push($root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.vehicleIndices && message.vehicleIndices.length)) + message.vehicleIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.vehicleIndices.push(reader.int32()); + } else + message.vehicleIndices.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConstraintRelaxation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} ConstraintRelaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConstraintRelaxation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConstraintRelaxation message. + * @function verify + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConstraintRelaxation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relaxations != null && message.hasOwnProperty("relaxations")) { + if (!Array.isArray(message.relaxations)) + return "relaxations: array expected"; + for (var i = 0; i < message.relaxations.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.verify(message.relaxations[i]); + if (error) + return "relaxations." + error; + } + } + if (message.vehicleIndices != null && message.hasOwnProperty("vehicleIndices")) { + if (!Array.isArray(message.vehicleIndices)) + return "vehicleIndices: array expected"; + for (var i = 0; i < message.vehicleIndices.length; ++i) + if (!$util.isInteger(message.vehicleIndices[i])) + return "vehicleIndices: integer[] expected"; + } + return null; + }; + + /** + * Creates a ConstraintRelaxation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} ConstraintRelaxation + */ + ConstraintRelaxation.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation) + return object; + var message = new $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation(); + if (object.relaxations) { + if (!Array.isArray(object.relaxations)) + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.relaxations: array expected"); + message.relaxations = []; + for (var i = 0; i < object.relaxations.length; ++i) { + if (typeof object.relaxations[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.relaxations: object expected"); + message.relaxations[i] = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.fromObject(object.relaxations[i]); + } + } + if (object.vehicleIndices) { + if (!Array.isArray(object.vehicleIndices)) + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicleIndices: array expected"); + message.vehicleIndices = []; + for (var i = 0; i < object.vehicleIndices.length; ++i) + message.vehicleIndices[i] = object.vehicleIndices[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a ConstraintRelaxation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation} message ConstraintRelaxation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConstraintRelaxation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.relaxations = []; + object.vehicleIndices = []; + } + if (message.relaxations && message.relaxations.length) { + object.relaxations = []; + for (var j = 0; j < message.relaxations.length; ++j) + object.relaxations[j] = $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.toObject(message.relaxations[j], options); + } + if (message.vehicleIndices && message.vehicleIndices.length) { + object.vehicleIndices = []; + for (var j = 0; j < message.vehicleIndices.length; ++j) + object.vehicleIndices[j] = message.vehicleIndices[j]; + } + return object; + }; + + /** + * Converts this ConstraintRelaxation to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @instance + * @returns {Object.} JSON object + */ + ConstraintRelaxation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConstraintRelaxation + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConstraintRelaxation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation"; + }; + + ConstraintRelaxation.Relaxation = (function() { + + /** + * Properties of a Relaxation. + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @interface IRelaxation + * @property {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level|null} [level] Relaxation level + * @property {google.protobuf.ITimestamp|null} [thresholdTime] Relaxation thresholdTime + * @property {number|null} [thresholdVisitCount] Relaxation thresholdVisitCount + */ + + /** + * Constructs a new Relaxation. + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + * @classdesc Represents a Relaxation. + * @implements IRelaxation + * @constructor + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation=} [properties] Properties to set + */ + function Relaxation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Relaxation level. + * @member {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level} level + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @instance + */ + Relaxation.prototype.level = 0; + + /** + * Relaxation thresholdTime. + * @member {google.protobuf.ITimestamp|null|undefined} thresholdTime + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @instance + */ + Relaxation.prototype.thresholdTime = null; + + /** + * Relaxation thresholdVisitCount. + * @member {number} thresholdVisitCount + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @instance + */ + Relaxation.prototype.thresholdVisitCount = 0; + + /** + * Creates a new Relaxation instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} Relaxation instance + */ + Relaxation.create = function create(properties) { + return new Relaxation(properties); + }; + + /** + * Encodes the specified Relaxation message. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation} message Relaxation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Relaxation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.level != null && Object.hasOwnProperty.call(message, "level")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.level); + if (message.thresholdTime != null && Object.hasOwnProperty.call(message, "thresholdTime")) + $root.google.protobuf.Timestamp.encode(message.thresholdTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.thresholdVisitCount != null && Object.hasOwnProperty.call(message, "thresholdVisitCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.thresholdVisitCount); + return writer; + }; + + /** + * Encodes the specified Relaxation message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.IRelaxation} message Relaxation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Relaxation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Relaxation message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} Relaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Relaxation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.level = reader.int32(); + break; + } + case 2: { + message.thresholdTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.thresholdVisitCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Relaxation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} Relaxation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Relaxation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Relaxation message. + * @function verify + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Relaxation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.level != null && message.hasOwnProperty("level")) + switch (message.level) { + default: + return "level: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.thresholdTime != null && message.hasOwnProperty("thresholdTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.thresholdTime); + if (error) + return "thresholdTime." + error; + } + if (message.thresholdVisitCount != null && message.hasOwnProperty("thresholdVisitCount")) + if (!$util.isInteger(message.thresholdVisitCount)) + return "thresholdVisitCount: integer expected"; + return null; + }; + + /** + * Creates a Relaxation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} Relaxation + */ + Relaxation.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation) + return object; + var message = new $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation(); + switch (object.level) { + default: + if (typeof object.level === "number") { + message.level = object.level; + break; + } + break; + case "LEVEL_UNSPECIFIED": + case 0: + message.level = 0; + break; + case "RELAX_VISIT_TIMES_AFTER_THRESHOLD": + case 1: + message.level = 1; + break; + case "RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD": + case 2: + message.level = 2; + break; + case "RELAX_ALL_AFTER_THRESHOLD": + case 3: + message.level = 3; + break; + } + if (object.thresholdTime != null) { + if (typeof object.thresholdTime !== "object") + throw TypeError(".google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.thresholdTime: object expected"); + message.thresholdTime = $root.google.protobuf.Timestamp.fromObject(object.thresholdTime); + } + if (object.thresholdVisitCount != null) + message.thresholdVisitCount = object.thresholdVisitCount | 0; + return message; + }; + + /** + * Creates a plain object from a Relaxation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation} message Relaxation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Relaxation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.level = options.enums === String ? "LEVEL_UNSPECIFIED" : 0; + object.thresholdTime = null; + object.thresholdVisitCount = 0; + } + if (message.level != null && message.hasOwnProperty("level")) + object.level = options.enums === String ? $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level[message.level] === undefined ? message.level : $root.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level[message.level] : message.level; + if (message.thresholdTime != null && message.hasOwnProperty("thresholdTime")) + object.thresholdTime = $root.google.protobuf.Timestamp.toObject(message.thresholdTime, options); + if (message.thresholdVisitCount != null && message.hasOwnProperty("thresholdVisitCount")) + object.thresholdVisitCount = message.thresholdVisitCount; + return object; + }; + + /** + * Converts this Relaxation to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @instance + * @returns {Object.} JSON object + */ + Relaxation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Relaxation + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Relaxation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation"; + }; + + /** + * Level enum. + * @name google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level + * @enum {number} + * @property {number} LEVEL_UNSPECIFIED=0 LEVEL_UNSPECIFIED value + * @property {number} RELAX_VISIT_TIMES_AFTER_THRESHOLD=1 RELAX_VISIT_TIMES_AFTER_THRESHOLD value + * @property {number} RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD=2 RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD value + * @property {number} RELAX_ALL_AFTER_THRESHOLD=3 RELAX_ALL_AFTER_THRESHOLD value + */ + Relaxation.Level = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "RELAX_VISIT_TIMES_AFTER_THRESHOLD"] = 1; + values[valuesById[2] = "RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD"] = 2; + values[valuesById[3] = "RELAX_ALL_AFTER_THRESHOLD"] = 3; + return values; + })(); + + return Relaxation; + })(); + + return ConstraintRelaxation; + })(); + + return InjectedSolutionConstraint; + })(); + + v1.OptimizeToursValidationError = (function() { + + /** + * Properties of an OptimizeToursValidationError. + * @memberof google.maps.routeoptimization.v1 + * @interface IOptimizeToursValidationError + * @property {number|null} [code] OptimizeToursValidationError code + * @property {string|null} [displayName] OptimizeToursValidationError displayName + * @property {Array.|null} [fields] OptimizeToursValidationError fields + * @property {string|null} [errorMessage] OptimizeToursValidationError errorMessage + * @property {string|null} [offendingValues] OptimizeToursValidationError offendingValues + */ + + /** + * Constructs a new OptimizeToursValidationError. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an OptimizeToursValidationError. + * @implements IOptimizeToursValidationError + * @constructor + * @param {google.maps.routeoptimization.v1.IOptimizeToursValidationError=} [properties] Properties to set + */ + function OptimizeToursValidationError(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizeToursValidationError code. + * @member {number} code + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @instance + */ + OptimizeToursValidationError.prototype.code = 0; + + /** + * OptimizeToursValidationError displayName. + * @member {string} displayName + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @instance + */ + OptimizeToursValidationError.prototype.displayName = ""; + + /** + * OptimizeToursValidationError fields. + * @member {Array.} fields + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @instance + */ + OptimizeToursValidationError.prototype.fields = $util.emptyArray; + + /** + * OptimizeToursValidationError errorMessage. + * @member {string} errorMessage + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @instance + */ + OptimizeToursValidationError.prototype.errorMessage = ""; + + /** + * OptimizeToursValidationError offendingValues. + * @member {string} offendingValues + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @instance + */ + OptimizeToursValidationError.prototype.offendingValues = ""; + + /** + * Creates a new OptimizeToursValidationError instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursValidationError=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError} OptimizeToursValidationError instance + */ + OptimizeToursValidationError.create = function create(properties) { + return new OptimizeToursValidationError(properties); + }; + + /** + * Encodes the specified OptimizeToursValidationError message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursValidationError} message OptimizeToursValidationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeToursValidationError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.encode(message.fields[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.errorMessage); + if (message.offendingValues != null && Object.hasOwnProperty.call(message, "offendingValues")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.offendingValues); + return writer; + }; + + /** + * Encodes the specified OptimizeToursValidationError message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {google.maps.routeoptimization.v1.IOptimizeToursValidationError} message OptimizeToursValidationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizeToursValidationError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizeToursValidationError message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError} OptimizeToursValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeToursValidationError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.OptimizeToursValidationError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.decode(reader, reader.uint32())); + break; + } + case 4: { + message.errorMessage = reader.string(); + break; + } + case 5: { + message.offendingValues = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizeToursValidationError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError} OptimizeToursValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizeToursValidationError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizeToursValidationError message. + * @function verify + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizeToursValidationError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.offendingValues != null && message.hasOwnProperty("offendingValues")) + if (!$util.isString(message.offendingValues)) + return "offendingValues: string expected"; + return null; + }; + + /** + * Creates an OptimizeToursValidationError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError} OptimizeToursValidationError + */ + OptimizeToursValidationError.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.OptimizeToursValidationError) + return object; + var message = new $root.google.maps.routeoptimization.v1.OptimizeToursValidationError(); + if (object.code != null) + message.code = object.code | 0; + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursValidationError.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursValidationError.fields: object expected"); + message.fields[i] = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.fromObject(object.fields[i]); + } + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.offendingValues != null) + message.offendingValues = String(object.offendingValues); + return message; + }; + + /** + * Creates a plain object from an OptimizeToursValidationError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursValidationError} message OptimizeToursValidationError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizeToursValidationError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) { + object.code = 0; + object.displayName = ""; + object.errorMessage = ""; + object.offendingValues = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.toObject(message.fields[j], options); + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.offendingValues != null && message.hasOwnProperty("offendingValues")) + object.offendingValues = message.offendingValues; + return object; + }; + + /** + * Converts this OptimizeToursValidationError to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @instance + * @returns {Object.} JSON object + */ + OptimizeToursValidationError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizeToursValidationError + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizeToursValidationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.OptimizeToursValidationError"; + }; + + OptimizeToursValidationError.FieldReference = (function() { + + /** + * Properties of a FieldReference. + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @interface IFieldReference + * @property {string|null} [name] FieldReference name + * @property {number|null} [index] FieldReference index + * @property {string|null} [key] FieldReference key + * @property {google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference|null} [subField] FieldReference subField + */ + + /** + * Constructs a new FieldReference. + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError + * @classdesc Represents a FieldReference. + * @implements IFieldReference + * @constructor + * @param {google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference=} [properties] Properties to set + */ + function FieldReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldReference name. + * @member {string} name + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @instance + */ + FieldReference.prototype.name = ""; + + /** + * FieldReference index. + * @member {number|null|undefined} index + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @instance + */ + FieldReference.prototype.index = null; + + /** + * FieldReference key. + * @member {string|null|undefined} key + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @instance + */ + FieldReference.prototype.key = null; + + /** + * FieldReference subField. + * @member {google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference|null|undefined} subField + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @instance + */ + FieldReference.prototype.subField = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FieldReference indexOrKey. + * @member {"index"|"key"|undefined} indexOrKey + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @instance + */ + Object.defineProperty(FieldReference.prototype, "indexOrKey", { + get: $util.oneOfGetter($oneOfFields = ["index", "key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FieldReference instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} FieldReference instance + */ + FieldReference.create = function create(properties) { + return new FieldReference(properties); + }; + + /** + * Encodes the specified FieldReference message. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference} message FieldReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.index); + if (message.subField != null && Object.hasOwnProperty.call(message, "subField")) + $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.encode(message.subField, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.key); + return writer; + }; + + /** + * Encodes the specified FieldReference message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursValidationError.IFieldReference} message FieldReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldReference message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.index = reader.int32(); + break; + } + case 4: { + message.key = reader.string(); + break; + } + case 3: { + message.subField = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldReference message. + * @function verify + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.index != null && message.hasOwnProperty("index")) { + properties.indexOrKey = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + if (message.key != null && message.hasOwnProperty("key")) { + if (properties.indexOrKey === 1) + return "indexOrKey: multiple values"; + properties.indexOrKey = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.subField != null && message.hasOwnProperty("subField")) { + var error = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.verify(message.subField); + if (error) + return "subField." + error; + } + return null; + }; + + /** + * Creates a FieldReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} FieldReference + */ + FieldReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference) + return object; + var message = new $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference(); + if (object.name != null) + message.name = String(object.name); + if (object.index != null) + message.index = object.index | 0; + if (object.key != null) + message.key = String(object.key); + if (object.subField != null) { + if (typeof object.subField !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.subField: object expected"); + message.subField = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.fromObject(object.subField); + } + return message; + }; + + /** + * Creates a plain object from a FieldReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference} message FieldReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.subField = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object.indexOrKey = "index"; + } + if (message.subField != null && message.hasOwnProperty("subField")) + object.subField = $root.google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference.toObject(message.subField, options); + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object.indexOrKey = "key"; + } + return object; + }; + + /** + * Converts this FieldReference to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @instance + * @returns {Object.} JSON object + */ + FieldReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldReference + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference"; + }; + + return FieldReference; + })(); + + return OptimizeToursValidationError; + })(); + + v1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.maps.routeoptimization.v1 + * @interface IInputConfig + * @property {google.maps.routeoptimization.v1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {google.maps.routeoptimization.v1.DataFormat|null} [dataFormat] InputConfig dataFormat + */ + + /** + * Constructs a new InputConfig. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.maps.routeoptimization.v1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig gcsSource. + * @member {google.maps.routeoptimization.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.maps.routeoptimization.v1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig dataFormat. + * @member {google.maps.routeoptimization.v1.DataFormat} dataFormat + * @memberof google.maps.routeoptimization.v1.InputConfig + * @instance + */ + InputConfig.prototype.dataFormat = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.maps.routeoptimization.v1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {google.maps.routeoptimization.v1.IInputConfig=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.maps.routeoptimization.v1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {google.maps.routeoptimization.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.maps.routeoptimization.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {google.maps.routeoptimization.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.maps.routeoptimization.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.maps.routeoptimization.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.InputConfig) + return object; + var message = new $root.google.maps.routeoptimization.v1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.maps.routeoptimization.v1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.maps.routeoptimization.v1.GcsSource.fromObject(object.gcsSource); + } + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "JSON": + case 1: + message.dataFormat = 1; + break; + case "PROTO_TEXT": + case 2: + message.dataFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {google.maps.routeoptimization.v1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.maps.routeoptimization.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.maps.routeoptimization.v1.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.maps.routeoptimization.v1.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.InputConfig"; + }; + + return InputConfig; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.maps.routeoptimization.v1 + * @interface IOutputConfig + * @property {google.maps.routeoptimization.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.maps.routeoptimization.v1.DataFormat|null} [dataFormat] OutputConfig dataFormat + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.maps.routeoptimization.v1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.maps.routeoptimization.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig dataFormat. + * @member {google.maps.routeoptimization.v1.DataFormat} dataFormat + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.dataFormat = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {google.maps.routeoptimization.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.maps.routeoptimization.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {google.maps.routeoptimization.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.maps.routeoptimization.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {google.maps.routeoptimization.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.maps.routeoptimization.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dataFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.maps.routeoptimization.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.OutputConfig) + return object; + var message = new $root.google.maps.routeoptimization.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.maps.routeoptimization.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.maps.routeoptimization.v1.GcsDestination.fromObject(object.gcsDestination); + } + switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "JSON": + case 1: + message.dataFormat = 1; + break; + case "PROTO_TEXT": + case 2: + message.dataFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {google.maps.routeoptimization.v1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.maps.routeoptimization.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.maps.routeoptimization.v1.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.maps.routeoptimization.v1.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.maps.routeoptimization.v1 + * @interface IGcsSource + * @property {string|null} [uri] GcsSource uri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.maps.routeoptimization.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource uri. + * @member {string} uri + * @memberof google.maps.routeoptimization.v1.GcsSource + * @instance + */ + GcsSource.prototype.uri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {google.maps.routeoptimization.v1.IGcsSource=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.maps.routeoptimization.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {google.maps.routeoptimization.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {google.maps.routeoptimization.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.GcsSource) + return object; + var message = new $root.google.maps.routeoptimization.v1.GcsSource(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {google.maps.routeoptimization.v1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.GcsSource"; + }; + + return GcsSource; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.maps.routeoptimization.v1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.maps.routeoptimization.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.maps.routeoptimization.v1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {google.maps.routeoptimization.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.maps.routeoptimization.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.maps.routeoptimization.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {google.maps.routeoptimization.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.maps.routeoptimization.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {google.maps.routeoptimization.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routeoptimization.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routeoptimization.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routeoptimization.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routeoptimization.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routeoptimization.v1.GcsDestination) + return object; + var message = new $root.google.maps.routeoptimization.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {google.maps.routeoptimization.v1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.maps.routeoptimization.v1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routeoptimization.v1.GcsDestination"; + }; + + return GcsDestination; + })(); + + /** + * DataFormat enum. + * @name google.maps.routeoptimization.v1.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} JSON=1 JSON value + * @property {number} PROTO_TEXT=2 PROTO_TEXT value + */ + v1.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + values[valuesById[2] = "PROTO_TEXT"] = 2; + return values; + })(); + + return v1; + })(); + + return routeoptimization; + })(); + + return maps; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatLng + * @function getTypeUrl + * @memberof google.type.LatLng + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LatLng"; + }; + + return LatLng; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-maps-routeoptimization/protos/protos.json b/packages/google-maps-routeoptimization/protos/protos.json new file mode 100644 index 00000000000..71a7c10d8d8 --- /dev/null +++ b/packages/google-maps-routeoptimization/protos/protos.json @@ -0,0 +1,3583 @@ +{ + "nested": { + "google": { + "nested": { + "maps": { + "nested": { + "routeoptimization": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Maps.RouteOptimization.V1", + "go_package": "cloud.google.com/go/maps/routeoptimization/apiv1/routeoptimizationpb;routeoptimizationpb", + "java_multiple_files": true, + "java_outer_classname": "RouteOptimizationServiceProto", + "java_package": "com.google.maps.routeoptimization.v1", + "php_namespace": "Google\\Maps\\RouteOptimization\\V1", + "ruby_package": "Google::Maps::RouteOptimization::V1" + }, + "nested": { + "RouteOptimization": { + "options": { + "(google.api.default_host)": "routeoptimization.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "OptimizeTours": { + "requestType": "OptimizeToursRequest", + "responseType": "OptimizeToursResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}:optimizeTours", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}:optimizeTours", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}:optimizeTours", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*}:optimizeTours", + "body": "*" + } + } + } + ] + }, + "BatchOptimizeTours": { + "requestType": "BatchOptimizeToursRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}:batchOptimizeTours", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}:batchOptimizeTours", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "BatchOptimizeToursResponse", + "(google.longrunning.operation_info).metadata_type": "BatchOptimizeToursMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}:batchOptimizeTours", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*}:batchOptimizeTours", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchOptimizeToursResponse", + "metadata_type": "BatchOptimizeToursMetadata" + } + } + ] + } + } + }, + "BatchOptimizeToursRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelConfigs": { + "rule": "repeated", + "type": "AsyncModelConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "AsyncModelConfig": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputConfig": { + "type": "InputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "BatchOptimizeToursResponse": { + "fields": {} + }, + "BatchOptimizeToursMetadata": { + "fields": {} + }, + "OptimizeToursRequest": { + "oneofs": { + "_geodesicMetersPerSecond": { + "oneof": [ + "geodesicMetersPerSecond" + ] + }, + "_maxValidationErrors": { + "oneof": [ + "maxValidationErrors" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "model": { + "type": "ShipmentModel", + "id": 3 + }, + "solvingMode": { + "type": "SolvingMode", + "id": 4 + }, + "searchMode": { + "type": "SearchMode", + "id": 6 + }, + "injectedFirstSolutionRoutes": { + "rule": "repeated", + "type": "ShipmentRoute", + "id": 7 + }, + "injectedSolutionConstraint": { + "type": "InjectedSolutionConstraint", + "id": 8 + }, + "refreshDetailsRoutes": { + "rule": "repeated", + "type": "ShipmentRoute", + "id": 9 + }, + "interpretInjectedSolutionsUsingLabels": { + "type": "bool", + "id": 10 + }, + "considerRoadTraffic": { + "type": "bool", + "id": 11 + }, + "populatePolylines": { + "type": "bool", + "id": 12 + }, + "populateTransitionPolylines": { + "type": "bool", + "id": 13 + }, + "allowLargeDeadlineDespiteInterruptionRisk": { + "type": "bool", + "id": 14 + }, + "useGeodesicDistances": { + "type": "bool", + "id": 15 + }, + "geodesicMetersPerSecond": { + "type": "double", + "id": 16, + "options": { + "proto3_optional": true + } + }, + "maxValidationErrors": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 17 + } + }, + "nested": { + "SolvingMode": { + "values": { + "DEFAULT_SOLVE": 0, + "VALIDATE_ONLY": 1, + "DETECT_SOME_INFEASIBLE_SHIPMENTS": 2 + } + }, + "SearchMode": { + "values": { + "SEARCH_MODE_UNSPECIFIED": 0, + "RETURN_FAST": 1, + "CONSUME_ALL_AVAILABLE_TIME": 2 + } + } + } + }, + "OptimizeToursResponse": { + "fields": { + "routes": { + "rule": "repeated", + "type": "ShipmentRoute", + "id": 1 + }, + "requestLabel": { + "type": "string", + "id": 3 + }, + "skippedShipments": { + "rule": "repeated", + "type": "SkippedShipment", + "id": 4 + }, + "validationErrors": { + "rule": "repeated", + "type": "OptimizeToursValidationError", + "id": 5 + }, + "metrics": { + "type": "Metrics", + "id": 6 + } + }, + "nested": { + "Metrics": { + "fields": { + "aggregatedRouteMetrics": { + "type": "AggregatedMetrics", + "id": 1 + }, + "skippedMandatoryShipmentCount": { + "type": "int32", + "id": 2 + }, + "usedVehicleCount": { + "type": "int32", + "id": 3 + }, + "earliestVehicleStartTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "latestVehicleEndTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "costs": { + "keyType": "string", + "type": "double", + "id": 10 + }, + "totalCost": { + "type": "double", + "id": 6 + } + } + } + } + }, + "ShipmentModel": { + "oneofs": { + "_maxActiveVehicles": { + "oneof": [ + "maxActiveVehicles" + ] + } + }, + "fields": { + "shipments": { + "rule": "repeated", + "type": "Shipment", + "id": 1 + }, + "vehicles": { + "rule": "repeated", + "type": "Vehicle", + "id": 2 + }, + "maxActiveVehicles": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "globalStartTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "globalEndTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "globalDurationCostPerHour": { + "type": "double", + "id": 7 + }, + "durationDistanceMatrices": { + "rule": "repeated", + "type": "DurationDistanceMatrix", + "id": 8 + }, + "durationDistanceMatrixSrcTags": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "durationDistanceMatrixDstTags": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "transitionAttributes": { + "rule": "repeated", + "type": "TransitionAttributes", + "id": 11 + }, + "shipmentTypeIncompatibilities": { + "rule": "repeated", + "type": "ShipmentTypeIncompatibility", + "id": 12 + }, + "shipmentTypeRequirements": { + "rule": "repeated", + "type": "ShipmentTypeRequirement", + "id": 13 + }, + "precedenceRules": { + "rule": "repeated", + "type": "PrecedenceRule", + "id": 14 + } + }, + "nested": { + "DurationDistanceMatrix": { + "fields": { + "rows": { + "rule": "repeated", + "type": "Row", + "id": 1 + }, + "vehicleStartTag": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "durations": { + "rule": "repeated", + "type": "google.protobuf.Duration", + "id": 1 + }, + "meters": { + "rule": "repeated", + "type": "double", + "id": 2 + } + } + } + } + }, + "PrecedenceRule": { + "oneofs": { + "_firstIndex": { + "oneof": [ + "firstIndex" + ] + }, + "_secondIndex": { + "oneof": [ + "secondIndex" + ] + } + }, + "fields": { + "firstIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "firstIsDelivery": { + "type": "bool", + "id": 3 + }, + "secondIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "secondIsDelivery": { + "type": "bool", + "id": 4 + }, + "offsetDuration": { + "type": "google.protobuf.Duration", + "id": 5 + } + } + } + } + }, + "Shipment": { + "oneofs": { + "_penaltyCost": { + "oneof": [ + "penaltyCost" + ] + }, + "_pickupToDeliveryRelativeDetourLimit": { + "oneof": [ + "pickupToDeliveryRelativeDetourLimit" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 16 + }, + "pickups": { + "rule": "repeated", + "type": "VisitRequest", + "id": 1 + }, + "deliveries": { + "rule": "repeated", + "type": "VisitRequest", + "id": 2 + }, + "loadDemands": { + "keyType": "string", + "type": "Load", + "id": 14 + }, + "penaltyCost": { + "type": "double", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "allowedVehicleIndices": { + "rule": "repeated", + "type": "int32", + "id": 5 + }, + "costsPerVehicle": { + "rule": "repeated", + "type": "double", + "id": 6 + }, + "costsPerVehicleIndices": { + "rule": "repeated", + "type": "int32", + "id": 7 + }, + "pickupToDeliveryRelativeDetourLimit": { + "type": "double", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "pickupToDeliveryAbsoluteDetourLimit": { + "type": "google.protobuf.Duration", + "id": 9 + }, + "pickupToDeliveryTimeLimit": { + "type": "google.protobuf.Duration", + "id": 10 + }, + "shipmentType": { + "type": "string", + "id": 11 + }, + "label": { + "type": "string", + "id": 12 + }, + "ignore": { + "type": "bool", + "id": 13 + } + }, + "nested": { + "VisitRequest": { + "fields": { + "arrivalLocation": { + "type": "google.type.LatLng", + "id": 1 + }, + "arrivalWaypoint": { + "type": "Waypoint", + "id": 2 + }, + "departureLocation": { + "type": "google.type.LatLng", + "id": 3 + }, + "departureWaypoint": { + "type": "Waypoint", + "id": 4 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "timeWindows": { + "rule": "repeated", + "type": "TimeWindow", + "id": 6 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 7 + }, + "cost": { + "type": "double", + "id": 8 + }, + "loadDemands": { + "keyType": "string", + "type": "Load", + "id": 12 + }, + "visitTypes": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "label": { + "type": "string", + "id": 11 + } + } + }, + "Load": { + "fields": { + "amount": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "ShipmentTypeIncompatibility": { + "fields": { + "types": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "incompatibilityMode": { + "type": "IncompatibilityMode", + "id": 2 + } + }, + "nested": { + "IncompatibilityMode": { + "values": { + "INCOMPATIBILITY_MODE_UNSPECIFIED": 0, + "NOT_PERFORMED_BY_SAME_VEHICLE": 1, + "NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY": 2 + } + } + } + }, + "ShipmentTypeRequirement": { + "fields": { + "requiredShipmentTypeAlternatives": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "dependentShipmentTypes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "requirementMode": { + "type": "RequirementMode", + "id": 3 + } + }, + "nested": { + "RequirementMode": { + "values": { + "REQUIREMENT_MODE_UNSPECIFIED": 0, + "PERFORMED_BY_SAME_VEHICLE": 1, + "IN_SAME_VEHICLE_AT_PICKUP_TIME": 2, + "IN_SAME_VEHICLE_AT_DELIVERY_TIME": 3 + } + } + } + }, + "Vehicle": { + "oneofs": { + "_travelDurationMultiple": { + "oneof": [ + "travelDurationMultiple" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 32 + }, + "travelMode": { + "type": "TravelMode", + "id": 1 + }, + "startLocation": { + "type": "google.type.LatLng", + "id": 3 + }, + "startWaypoint": { + "type": "Waypoint", + "id": 4 + }, + "endLocation": { + "type": "google.type.LatLng", + "id": 5 + }, + "endWaypoint": { + "type": "Waypoint", + "id": 6 + }, + "startTags": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "endTags": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "startTimeWindows": { + "rule": "repeated", + "type": "TimeWindow", + "id": 9 + }, + "endTimeWindows": { + "rule": "repeated", + "type": "TimeWindow", + "id": 10 + }, + "travelDurationMultiple": { + "type": "double", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "unloadingPolicy": { + "type": "UnloadingPolicy", + "id": 12 + }, + "loadLimits": { + "keyType": "string", + "type": "LoadLimit", + "id": 30 + }, + "costPerHour": { + "type": "double", + "id": 16 + }, + "costPerTraveledHour": { + "type": "double", + "id": 17 + }, + "costPerKilometer": { + "type": "double", + "id": 18 + }, + "fixedCost": { + "type": "double", + "id": 19 + }, + "usedIfRouteIsEmpty": { + "type": "bool", + "id": 20 + }, + "routeDurationLimit": { + "type": "DurationLimit", + "id": 21 + }, + "travelDurationLimit": { + "type": "DurationLimit", + "id": 22 + }, + "routeDistanceLimit": { + "type": "DistanceLimit", + "id": 23 + }, + "extraVisitDurationForVisitType": { + "keyType": "string", + "type": "google.protobuf.Duration", + "id": 24 + }, + "breakRule": { + "type": "BreakRule", + "id": 25 + }, + "label": { + "type": "string", + "id": 27 + }, + "ignore": { + "type": "bool", + "id": 28 + } + }, + "nested": { + "TravelMode": { + "values": { + "TRAVEL_MODE_UNSPECIFIED": 0, + "DRIVING": 1, + "WALKING": 2 + } + }, + "UnloadingPolicy": { + "values": { + "UNLOADING_POLICY_UNSPECIFIED": 0, + "LAST_IN_FIRST_OUT": 1, + "FIRST_IN_FIRST_OUT": 2 + } + }, + "LoadLimit": { + "oneofs": { + "_maxLoad": { + "oneof": [ + "maxLoad" + ] + } + }, + "fields": { + "maxLoad": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "softMaxLoad": { + "type": "int64", + "id": 2 + }, + "costPerUnitAboveSoftMax": { + "type": "double", + "id": 3 + }, + "startLoadInterval": { + "type": "Interval", + "id": 4 + }, + "endLoadInterval": { + "type": "Interval", + "id": 5 + } + }, + "nested": { + "Interval": { + "oneofs": { + "_max": { + "oneof": [ + "max" + ] + } + }, + "fields": { + "min": { + "type": "int64", + "id": 1 + }, + "max": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "DurationLimit": { + "oneofs": { + "_costPerHourAfterSoftMax": { + "oneof": [ + "costPerHourAfterSoftMax" + ] + }, + "_costPerSquareHourAfterQuadraticSoftMax": { + "oneof": [ + "costPerSquareHourAfterQuadraticSoftMax" + ] + } + }, + "fields": { + "maxDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "softMaxDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "costPerHourAfterSoftMax": { + "type": "double", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "quadraticSoftMaxDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "costPerSquareHourAfterQuadraticSoftMax": { + "type": "double", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "TimeWindow": { + "oneofs": { + "_costPerHourBeforeSoftStartTime": { + "oneof": [ + "costPerHourBeforeSoftStartTime" + ] + }, + "_costPerHourAfterSoftEndTime": { + "oneof": [ + "costPerHourAfterSoftEndTime" + ] + } + }, + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "softStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "softEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "costPerHourBeforeSoftStartTime": { + "type": "double", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "costPerHourAfterSoftEndTime": { + "type": "double", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + }, + "DistanceLimit": { + "oneofs": { + "_maxMeters": { + "oneof": [ + "maxMeters" + ] + }, + "_softMaxMeters": { + "oneof": [ + "softMaxMeters" + ] + }, + "_costPerKilometerAboveSoftMax": { + "oneof": [ + "costPerKilometerAboveSoftMax" + ] + } + }, + "fields": { + "maxMeters": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "softMaxMeters": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "costPerKilometerAboveSoftMax": { + "type": "double", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "TransitionAttributes": { + "fields": { + "srcTag": { + "type": "string", + "id": 1 + }, + "excludedSrcTag": { + "type": "string", + "id": 2 + }, + "dstTag": { + "type": "string", + "id": 3 + }, + "excludedDstTag": { + "type": "string", + "id": 4 + }, + "cost": { + "type": "double", + "id": 5 + }, + "costPerKilometer": { + "type": "double", + "id": 6 + }, + "distanceLimit": { + "type": "DistanceLimit", + "id": 7 + }, + "delay": { + "type": "google.protobuf.Duration", + "id": 8 + } + } + }, + "Waypoint": { + "oneofs": { + "locationType": { + "oneof": [ + "location", + "placeId" + ] + } + }, + "fields": { + "location": { + "type": "Location", + "id": 1 + }, + "placeId": { + "type": "string", + "id": 2 + }, + "sideOfRoad": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Location": { + "oneofs": { + "_heading": { + "oneof": [ + "heading" + ] + } + }, + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "heading": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "BreakRule": { + "fields": { + "breakRequests": { + "rule": "repeated", + "type": "BreakRequest", + "id": 1 + }, + "frequencyConstraints": { + "rule": "repeated", + "type": "FrequencyConstraint", + "id": 2 + } + }, + "nested": { + "BreakRequest": { + "fields": { + "earliestStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "latestStartTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "minDuration": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FrequencyConstraint": { + "fields": { + "minBreakDuration": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxInterBreakDuration": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ShipmentRoute": { + "fields": { + "vehicleIndex": { + "type": "int32", + "id": 1 + }, + "vehicleLabel": { + "type": "string", + "id": 2 + }, + "vehicleStartTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "vehicleEndTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "visits": { + "rule": "repeated", + "type": "Visit", + "id": 7 + }, + "transitions": { + "rule": "repeated", + "type": "Transition", + "id": 8 + }, + "hasTrafficInfeasibilities": { + "type": "bool", + "id": 9 + }, + "routePolyline": { + "type": "EncodedPolyline", + "id": 10 + }, + "breaks": { + "rule": "repeated", + "type": "Break", + "id": 11 + }, + "metrics": { + "type": "AggregatedMetrics", + "id": 12 + }, + "routeCosts": { + "keyType": "string", + "type": "double", + "id": 17 + }, + "routeTotalCost": { + "type": "double", + "id": 18 + } + }, + "nested": { + "Visit": { + "fields": { + "shipmentIndex": { + "type": "int32", + "id": 1 + }, + "isPickup": { + "type": "bool", + "id": 2 + }, + "visitRequestIndex": { + "type": "int32", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "loadDemands": { + "keyType": "string", + "type": "Shipment.Load", + "id": 11 + }, + "detour": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "shipmentLabel": { + "type": "string", + "id": 7 + }, + "visitLabel": { + "type": "string", + "id": 8 + } + } + }, + "Transition": { + "fields": { + "travelDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "travelDistanceMeters": { + "type": "double", + "id": 2 + }, + "trafficInfoUnavailable": { + "type": "bool", + "id": 3 + }, + "delayDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "breakDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "waitDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "totalDuration": { + "type": "google.protobuf.Duration", + "id": 7 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "routePolyline": { + "type": "EncodedPolyline", + "id": 9 + }, + "vehicleLoads": { + "keyType": "string", + "type": "VehicleLoad", + "id": 11 + } + } + }, + "VehicleLoad": { + "fields": { + "amount": { + "type": "int64", + "id": 1 + } + } + }, + "EncodedPolyline": { + "fields": { + "points": { + "type": "string", + "id": 1 + } + } + }, + "Break": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "SkippedShipment": { + "fields": { + "index": { + "type": "int32", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "reasons": { + "rule": "repeated", + "type": "Reason", + "id": 3 + } + }, + "nested": { + "Reason": { + "oneofs": { + "_exampleVehicleIndex": { + "oneof": [ + "exampleVehicleIndex" + ] + } + }, + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "exampleVehicleIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "exampleExceededCapacityType": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "NO_VEHICLE": 1, + "DEMAND_EXCEEDS_VEHICLE_CAPACITY": 2, + "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT": 3, + "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT": 4, + "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT": 5, + "CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS": 6, + "VEHICLE_NOT_ALLOWED": 7 + } + } + } + } + } + }, + "AggregatedMetrics": { + "fields": { + "performedShipmentCount": { + "type": "int32", + "id": 1 + }, + "travelDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "waitDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "delayDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "breakDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "visitDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "totalDuration": { + "type": "google.protobuf.Duration", + "id": 7 + }, + "travelDistanceMeters": { + "type": "double", + "id": 8 + }, + "maxLoads": { + "keyType": "string", + "type": "ShipmentRoute.VehicleLoad", + "id": 9 + } + } + }, + "InjectedSolutionConstraint": { + "fields": { + "routes": { + "rule": "repeated", + "type": "ShipmentRoute", + "id": 1 + }, + "skippedShipments": { + "rule": "repeated", + "type": "SkippedShipment", + "id": 2 + }, + "constraintRelaxations": { + "rule": "repeated", + "type": "ConstraintRelaxation", + "id": 3 + } + }, + "nested": { + "ConstraintRelaxation": { + "fields": { + "relaxations": { + "rule": "repeated", + "type": "Relaxation", + "id": 1 + }, + "vehicleIndices": { + "rule": "repeated", + "type": "int32", + "id": 2 + } + }, + "nested": { + "Relaxation": { + "fields": { + "level": { + "type": "Level", + "id": 1 + }, + "thresholdTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "thresholdVisitCount": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "Level": { + "values": { + "LEVEL_UNSPECIFIED": 0, + "RELAX_VISIT_TIMES_AFTER_THRESHOLD": 1, + "RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD": 2, + "RELAX_ALL_AFTER_THRESHOLD": 3 + } + } + } + } + } + } + } + }, + "OptimizeToursValidationError": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "fields": { + "rule": "repeated", + "type": "FieldReference", + "id": 3 + }, + "errorMessage": { + "type": "string", + "id": 4 + }, + "offendingValues": { + "type": "string", + "id": 5 + } + }, + "nested": { + "FieldReference": { + "oneofs": { + "indexOrKey": { + "oneof": [ + "index", + "key" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "index": { + "type": "int32", + "id": 2 + }, + "key": { + "type": "string", + "id": 4 + }, + "subField": { + "type": "FieldReference", + "id": 3 + } + } + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "dataFormat": { + "type": "DataFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "dataFormat": { + "type": "DataFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GcsSource": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "JSON": 1, + "PROTO_TEXT": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 9995, + 9999 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "java_multiple_files": true, + "java_outer_classname": "LatLngProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-maps-routeoptimization/samples/README.md b/packages/google-maps-routeoptimization/samples/README.md new file mode 100644 index 00000000000..257eaa6f5d2 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/README.md @@ -0,0 +1,86 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Route Optimization API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Route_optimization.batch_optimize_tours](#route_optimization.batch_optimize_tours) + * [Route_optimization.optimize_tours](#route_optimization.optimize_tours) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Route_optimization.batch_optimize_tours + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js` + + +----- + + + + +### Route_optimization.optimize_tours + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routeoptimization/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routeoptimization/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routeoptimization/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://developers.google.com/maps/documentation/route-optimization diff --git a/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js b/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js new file mode 100644 index 00000000000..955b70230e0 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.batch_optimize_tours.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, modelConfigs) { + // [START routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + */ + // const parent = 'abc123' + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + */ + // const modelConfigs = [1,2,3,4] + + // Imports the Routeoptimization library + const {RouteOptimizationClient} = require('@googlemaps/routeoptimization').v1; + + // Instantiates a client + const routeoptimizationClient = new RouteOptimizationClient(); + + async function callBatchOptimizeTours() { + // Construct request + const request = { + parent, + modelConfigs, + }; + + // Run request + const [operation] = await routeoptimizationClient.batchOptimizeTours(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchOptimizeTours(); + // [END routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js b/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js new file mode 100644 index 00000000000..027a68f23b0 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated/v1/route_optimization.optimize_tours.js @@ -0,0 +1,254 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + */ + // const parent = 'abc123' + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + */ + // const timeout = {} + /** + * Shipment model to solve. + */ + // const model = {} + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + */ + // const solvingMode = {} + /** + * Search mode used to solve the request. + */ + // const searchMode = {} + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits0.start_time <= visits1.start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * Shipment.allowed_vehicle_indices google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices + * is empty or its `vehicle_index` is included in + * Shipment.allowed_vehicle_indices google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + */ + // const injectedFirstSolutionRoutes = [1,2,3,4] + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + */ + // const injectedSolutionConstraint = {} + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + */ + // const refreshDetailsRoutes = [1,2,3,4] + /** + * If true: + * * uses + * ShipmentRoute.vehicle_label google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * ShipmentRoute.vehicle_index google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index + * to new + * ShipmentRoute.vehicle_index google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index + * to update + * ConstraintRelaxation.vehicle_indices google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * ShipmentRoute.Visit.shipment_label google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label + * instead of + * SkippedShipment.index google.maps.routeoptimization.v1.SkippedShipment.index + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * Vehicle.label google.maps.routeoptimization.v1.Vehicle.label in the + * request; + * * Shipment.label google.maps.routeoptimization.v1.Shipment.label in + * the request; + * * ShipmentRoute.vehicle_label google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label in the injected solution; + * * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label and ShipmentRoute.Visit.shipment_label google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * Vehicle.label google.maps.routeoptimization.v1.Vehicle.label (resp. + * Shipment.label google.maps.routeoptimization.v1.Shipment.label) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + */ + // const interpretInjectedSolutionsUsingLabels = true + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * Transition.travel_duration google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration, + * Visit.start_time google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time, + * and `vehicle_end_time`; in setting the + * ShipmentRoute.has_traffic_infeasibilities google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities + * field, and in calculating the + * OptimizeToursResponse.total_cost google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost + * field. + */ + // const considerRoadTraffic = true + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + */ + // const populatePolylines = true + /** + * If true, polylines will be populated in response + * ShipmentRoute.transitions google.maps.routeoptimization.v1.ShipmentRoute.transitions. + */ + // const populateTransitionPolylines = true + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + */ + // const allowLargeDeadlineDespiteInterruptionRisk = true + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + */ + // const useGeodesicDistances = true + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + */ + // const geodesicMetersPerSecond = 1234 + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * OptimizeToursResponse.validation_errors google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors + * field. + * This defaults to 100 and is capped at 10,000. + */ + // const maxValidationErrors = 1234 + /** + * Label that may be used to identify this request, reported back in the + * OptimizeToursResponse.request_label google.maps.routeoptimization.v1.OptimizeToursResponse.request_label. + */ + // const label = 'abc123' + + // Imports the Routeoptimization library + const {RouteOptimizationClient} = require('@googlemaps/routeoptimization').v1; + + // Instantiates a client + const routeoptimizationClient = new RouteOptimizationClient(); + + async function callOptimizeTours() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await routeoptimizationClient.optimizeTours(request); + console.log(response); + } + + callOptimizeTours(); + // [END routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json b/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json new file mode 100644 index 00000000000..4f145bce9f2 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json @@ -0,0 +1,163 @@ +{ + "clientLibrary": { + "name": "nodejs-routeoptimization", + "version": "0.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.maps.routeoptimization.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async", + "title": "RouteOptimization optimizeTours Sample", + "origin": "API_DEFINITION", + "description": " Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing the overall cost. A `ShipmentModel` model consists mainly of `Shipment`s that need to be carried out and `Vehicle`s that can be used to transport the `Shipment`s. The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, they assign a series of `Visit`s to each vehicle, where a `Visit` corresponds to a `VisitRequest`, which is a pickup or delivery for a `Shipment`. The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that minimizes the total cost where cost has many components defined in the `ShipmentModel`.", + "canonical": true, + "file": "route_optimization.optimize_tours.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 246, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "OptimizeTours", + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "timeout", + "type": ".google.protobuf.Duration" + }, + { + "name": "model", + "type": ".google.maps.routeoptimization.v1.ShipmentModel" + }, + { + "name": "solving_mode", + "type": ".google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode" + }, + { + "name": "search_mode", + "type": ".google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode" + }, + { + "name": "injected_first_solution_routes", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "injected_solution_constraint", + "type": ".google.maps.routeoptimization.v1.InjectedSolutionConstraint" + }, + { + "name": "refresh_details_routes", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "interpret_injected_solutions_using_labels", + "type": "TYPE_BOOL" + }, + { + "name": "consider_road_traffic", + "type": "TYPE_BOOL" + }, + { + "name": "populate_polylines", + "type": "TYPE_BOOL" + }, + { + "name": "populate_transition_polylines", + "type": "TYPE_BOOL" + }, + { + "name": "allow_large_deadline_despite_interruption_risk", + "type": "TYPE_BOOL" + }, + { + "name": "use_geodesic_distances", + "type": "TYPE_BOOL" + }, + { + "name": "geodesic_meters_per_second", + "type": "TYPE_DOUBLE" + }, + { + "name": "max_validation_errors", + "type": "TYPE_INT32" + }, + { + "name": "label", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.maps.routeoptimization.v1.OptimizeToursResponse", + "client": { + "shortName": "RouteOptimizationClient", + "fullName": "google.maps.routeoptimization.v1.RouteOptimizationClient" + }, + "method": { + "shortName": "OptimizeTours", + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours", + "service": { + "shortName": "RouteOptimization", + "fullName": "google.maps.routeoptimization.v1.RouteOptimization" + } + } + } + }, + { + "regionTag": "routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async", + "title": "RouteOptimization batchOptimizeTours Sample", + "origin": "API_DEFINITION", + "description": " Optimizes vehicle tours for one or more `OptimizeToursRequest` messages as a batch. This method is a Long Running Operation (LRO). The inputs for optimization (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` messages) are read/written from/to Cloud Storage in user-specified format. Like the `OptimizeTours` method, each `OptimizeToursRequest` contains a `ShipmentModel` and returns an `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of routes to be performed by vehicles minimizing the overall cost.", + "canonical": true, + "file": "route_optimization.batch_optimize_tours.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchOptimizeTours", + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.BatchOptimizeTours", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model_configs", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RouteOptimizationClient", + "fullName": "google.maps.routeoptimization.v1.RouteOptimizationClient" + }, + "method": { + "shortName": "BatchOptimizeTours", + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.BatchOptimizeTours", + "service": { + "shortName": "RouteOptimization", + "fullName": "google.maps.routeoptimization.v1.RouteOptimization" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-maps-routeoptimization/samples/package.json b/packages/google-maps-routeoptimization/samples/package.json new file mode 100644 index 00000000000..101ec6e65da --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "routeoptimization-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@googlemaps/routeoptimization": "0.0.0" + }, + "devDependencies": { + "c8": "^9.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-maps-routeoptimization/samples/quickstart.js b/packages/google-maps-routeoptimization/samples/quickstart.js new file mode 100644 index 00000000000..00f40930716 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/quickstart.js @@ -0,0 +1,290 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main( + parent, + model = { + shipments: [ + { + pickups: [ + { + arrivalLocation: { + latitude: 37.73881799999999, + longitude: -122.4161, + }, + }, + ], + deliveries: [ + { + arrivalLocation: { + latitude: 37.79581, + longitude: -122.4218856, + }, + }, + ], + }, + ], + vehicles: [ + { + startLocation: { + latitude: 37.73881799999999, + longitude: -122.4161, + }, + endLocation: { + latitude: 37.73881799999999, + longitude: -122.4161, + }, + costPerKilometer: 1.0, + }, + ], + } +) { + // [START routeoptimization_quickstart] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + */ + // const parent = 'abc123' + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + */ + // const timeout = {} + /** + * Shipment model to solve. + */ + // const model = {} + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + */ + // const solvingMode = {} + /** + * Search mode used to solve the request. + */ + // const searchMode = {} + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits0.start_time <= visits1.start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * Shipment.allowed_vehicle_indices google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices + * is empty or its `vehicle_index` is included in + * Shipment.allowed_vehicle_indices google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + */ + // const injectedFirstSolutionRoutes = [1,2,3,4] + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + */ + // const injectedSolutionConstraint = {} + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + */ + // const refreshDetailsRoutes = [1,2,3,4] + /** + * If true: + * * uses + * ShipmentRoute.vehicle_label google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * ShipmentRoute.vehicle_index google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index + * to new + * ShipmentRoute.vehicle_index google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index + * to update + * ConstraintRelaxation.vehicle_indices google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * ShipmentRoute.Visit.shipment_label google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label + * instead of + * SkippedShipment.index google.maps.routeoptimization.v1.SkippedShipment.index + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * Vehicle.label google.maps.routeoptimization.v1.Vehicle.label in the + * request; + * * Shipment.label google.maps.routeoptimization.v1.Shipment.label in + * the request; + * * ShipmentRoute.vehicle_label google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label in the injected solution; + * * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label and ShipmentRoute.Visit.shipment_label google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * SkippedShipment.label google.maps.routeoptimization.v1.SkippedShipment.label + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * Vehicle.label google.maps.routeoptimization.v1.Vehicle.label (resp. + * Shipment.label google.maps.routeoptimization.v1.Shipment.label) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + */ + // const interpretInjectedSolutionsUsingLabels = true + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * Transition.travel_duration google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration, + * Visit.start_time google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time, + * and `vehicle_end_time`; in setting the + * ShipmentRoute.has_traffic_infeasibilities google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities + * field, and in calculating the + * OptimizeToursResponse.total_cost google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost + * field. + */ + // const considerRoadTraffic = true + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + */ + // const populatePolylines = true + /** + * If true, polylines will be populated in response + * ShipmentRoute.transitions google.maps.routeoptimization.v1.ShipmentRoute.transitions. + */ + // const populateTransitionPolylines = true + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + */ + // const allowLargeDeadlineDespiteInterruptionRisk = true + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + */ + // const useGeodesicDistances = true + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + */ + // const geodesicMetersPerSecond = 1234 + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * OptimizeToursResponse.validation_errors google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors + * field. + * This defaults to 100 and is capped at 10,000. + */ + // const maxValidationErrors = 1234 + /** + * Label that may be used to identify this request, reported back in the + * OptimizeToursResponse.request_label google.maps.routeoptimization.v1.OptimizeToursResponse.request_label. + */ + // const label = 'abc123' + + // Imports the Routeoptimization library + const {RouteOptimizationClient} = require('@googlemaps/routeoptimization').v1; + + // Instantiates a client + const routeoptimizationClient = new RouteOptimizationClient(); + + async function callOptimizeTours() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const response = await routeoptimizationClient.optimizeTours(request); + console.log(response); + } + + callOptimizeTours(); + // [END routeoptimization_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-routeoptimization/samples/test/quickstart.js b/packages/google-maps-routeoptimization/samples/test/quickstart.js new file mode 100644 index 00000000000..6a6661aa2f5 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/test/quickstart.js @@ -0,0 +1,41 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {RouteOptimizationClient} = require('@googlemaps/routeoptimization').v1; +const routeoptimizationClient = new RouteOptimizationClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await routeoptimizationClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync(`node ./quickstart.js projects/${projectId}`, { + cwd, + }); + assert(output !== null); + }); +}); diff --git a/packages/google-maps-routeoptimization/src/index.ts b/packages/google-maps-routeoptimization/src/index.ts new file mode 100644 index 00000000000..82fba8743c3 --- /dev/null +++ b/packages/google-maps-routeoptimization/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const RouteOptimizationClient = v1.RouteOptimizationClient; +type RouteOptimizationClient = v1.RouteOptimizationClient; + +export {v1, RouteOptimizationClient}; +export default {v1, RouteOptimizationClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-maps-routeoptimization/src/v1/gapic_metadata.json b/packages/google-maps-routeoptimization/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..a437ff6255c --- /dev/null +++ b/packages/google-maps-routeoptimization/src/v1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.maps.routeoptimization.v1", + "libraryPackage": "@googlemaps/routeoptimization", + "services": { + "RouteOptimization": { + "clients": { + "grpc": { + "libraryClient": "RouteOptimizationClient", + "rpcs": { + "OptimizeTours": { + "methods": [ + "optimizeTours" + ] + }, + "BatchOptimizeTours": { + "methods": [ + "batchOptimizeTours" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RouteOptimizationClient", + "rpcs": { + "OptimizeTours": { + "methods": [ + "optimizeTours" + ] + }, + "BatchOptimizeTours": { + "methods": [ + "batchOptimizeTours" + ] + } + } + } + } + } + } +} diff --git a/packages/google-maps-routeoptimization/src/v1/index.ts b/packages/google-maps-routeoptimization/src/v1/index.ts new file mode 100644 index 00000000000..a8a346ff56f --- /dev/null +++ b/packages/google-maps-routeoptimization/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {RouteOptimizationClient} from './route_optimization_client'; diff --git a/packages/google-maps-routeoptimization/src/v1/route_optimization_client.ts b/packages/google-maps-routeoptimization/src/v1/route_optimization_client.ts new file mode 100644 index 00000000000..3ef79710a24 --- /dev/null +++ b/packages/google-maps-routeoptimization/src/v1/route_optimization_client.ts @@ -0,0 +1,1046 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/route_optimization_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './route_optimization_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for optimizing vehicle tours. + * + * Validity of certain types of fields: + * + * * `google.protobuf.Timestamp` + * * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00. + * * seconds must be in [0, 253402300799], + * i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. + * * nanos must be unset or set to 0. + * * `google.protobuf.Duration` + * * seconds must be in [0, 253402300799], + * i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00]. + * * nanos must be unset or set to 0. + * * `google.type.LatLng` + * * latitude must be in [-90.0, 90.0]. + * * longitude must be in [-180.0, 180.0]. + * * at least one of latitude and longitude must be non-zero. + * + * @class + * @memberof v1 + */ +export class RouteOptimizationClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; + routeOptimizationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RouteOptimizationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RouteOptimizationClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof RouteOptimizationClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'routeoptimization.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchOptimizeToursResponse = protoFilesRoot.lookup( + '.google.maps.routeoptimization.v1.BatchOptimizeToursResponse' + ) as gax.protobuf.Type; + const batchOptimizeToursMetadata = protoFilesRoot.lookup( + '.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchOptimizeTours: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchOptimizeToursResponse.decode.bind(batchOptimizeToursResponse), + batchOptimizeToursMetadata.decode.bind(batchOptimizeToursMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.maps.routeoptimization.v1.RouteOptimization', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.routeOptimizationStub) { + return this.routeOptimizationStub; + } + + // Put together the "service stub" for + // google.maps.routeoptimization.v1.RouteOptimization. + this.routeOptimizationStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.maps.routeoptimization.v1.RouteOptimization' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.maps.routeoptimization.v1 + .RouteOptimization, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const routeOptimizationStubMethods = [ + 'optimizeTours', + 'batchOptimizeTours', + ]; + for (const methodName of routeOptimizationStubMethods) { + const callPromise = this.routeOptimizationStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.routeOptimizationStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'routeoptimization.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'routeoptimization.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of + * routes to be performed by vehicles minimizing the overall cost. + * + * A `ShipmentModel` model consists mainly of `Shipment`s that need to be + * carried out and `Vehicle`s that can be used to transport the `Shipment`s. + * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, + * they assign a series of `Visit`s to each vehicle, where a `Visit` + * corresponds to a `VisitRequest`, which is a pickup or delivery for a + * `Shipment`. + * + * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that + * minimizes the total cost where cost has many components defined in the + * `ShipmentModel`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Target project or location to make a call. + * + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * + * If no location is specified, a region will be chosen automatically. + * @param {google.protobuf.Duration} request.timeout + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * @param {google.maps.routeoptimization.v1.ShipmentModel} request.model + * Shipment model to solve. + * @param {google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode} request.solvingMode + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * @param {google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode} request.searchMode + * Search mode used to solve the request. + * @param {number[]} request.injectedFirstSolutionRoutes + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * + * The solution must satisfy some basic validity assumptions: + * + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * {@link protos.google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices|Shipment.allowed_vehicle_indices} + * is empty or its `vehicle_index` is included in + * {@link protos.google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices|Shipment.allowed_vehicle_indices}. + * + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint} request.injectedSolutionConstraint + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * @param {number[]} request.refreshDetailsRoutes + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * @param {boolean} request.interpretInjectedSolutionsUsingLabels + * If true: + * + * * uses + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label|ShipmentRoute.vehicle_label} + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index|ShipmentRoute.vehicle_index} + * to new + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index|ShipmentRoute.vehicle_index} + * to update + * {@link protos.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices|ConstraintRelaxation.vehicle_indices} + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label|ShipmentRoute.Visit.shipment_label} + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * {@link protos.google.maps.routeoptimization.v1.SkippedShipment.label|SkippedShipment.label} + * instead of + * {@link protos.google.maps.routeoptimization.v1.SkippedShipment.index|SkippedShipment.index} + * to + * match skipped shipments in the injected solution with request + * shipments. + * + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * + * If true, labels in the following categories must appear at most once in + * their category: + * + * * {@link protos.google.maps.routeoptimization.v1.Vehicle.label|Vehicle.label} in the + * request; + * * {@link protos.google.maps.routeoptimization.v1.Shipment.label|Shipment.label} in + * the request; + * * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label|ShipmentRoute.vehicle_label} in the injected solution; + * * {@link protos.google.maps.routeoptimization.v1.SkippedShipment.label|SkippedShipment.label} and {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label|ShipmentRoute.Visit.shipment_label} in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * {@link protos.google.maps.routeoptimization.v1.SkippedShipment.label|SkippedShipment.label} + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * + * NOTE: The caller must ensure that each + * {@link protos.google.maps.routeoptimization.v1.Vehicle.label|Vehicle.label} (resp. + * {@link protos.google.maps.routeoptimization.v1.Shipment.label|Shipment.label}) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * @param {boolean} request.considerRoadTraffic + * Consider traffic estimation in calculating `ShipmentRoute` fields + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration|Transition.travel_duration}, + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time|Visit.start_time}, + * and `vehicle_end_time`; in setting the + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities|ShipmentRoute.has_traffic_infeasibilities} + * field, and in calculating the + * {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost|OptimizeToursResponse.total_cost} + * field. + * @param {boolean} request.populatePolylines + * If true, polylines will be populated in response `ShipmentRoute`s. + * @param {boolean} request.populateTransitionPolylines + * If true, polylines will be populated in response + * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.transitions|ShipmentRoute.transitions}. + * @param {boolean} request.allowLargeDeadlineDespiteInterruptionRisk + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * @param {boolean} request.useGeodesicDistances + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * @param {number} request.geodesicMetersPerSecond + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * @param {number} request.maxValidationErrors + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors|OptimizeToursResponse.validation_errors} + * field. + * This defaults to 100 and is capped at 10,000. + * @param {string} request.label + * Label that may be used to identify this request, reported back in the + * {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse.request_label|OptimizeToursResponse.request_label}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse|OptimizeToursResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/route_optimization.optimize_tours.js + * region_tag:routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async + */ + optimizeTours( + request?: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, + options?: CallOptions + ): Promise< + [ + protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IOptimizeToursRequest | undefined, + {} | undefined, + ] + >; + optimizeTours( + request: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, + options: CallOptions, + callback: Callback< + protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, + | protos.google.maps.routeoptimization.v1.IOptimizeToursRequest + | null + | undefined, + {} | null | undefined + > + ): void; + optimizeTours( + request: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, + callback: Callback< + protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, + | protos.google.maps.routeoptimization.v1.IOptimizeToursRequest + | null + | undefined, + {} | null | undefined + > + ): void; + optimizeTours( + request?: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, + | protos.google.maps.routeoptimization.v1.IOptimizeToursRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, + | protos.google.maps.routeoptimization.v1.IOptimizeToursRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IOptimizeToursRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.optimizeTours(request, options, callback); + } + + /** + * Optimizes vehicle tours for one or more `OptimizeToursRequest` + * messages as a batch. + * + * This method is a Long Running Operation (LRO). The inputs for optimization + * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` + * messages) are read/written from/to Cloud Storage in user-specified + * format. Like the `OptimizeTours` method, each `OptimizeToursRequest` + * contains a `ShipmentModel` and returns an `OptimizeToursResponse` + * containing `ShipmentRoute`s, which are a set of routes to be performed by + * vehicles minimizing the overall cost. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Target project and location to make a call. + * + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * + * If no location is specified, a region will be chosen automatically. + * @param {number[]} request.modelConfigs + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/route_optimization.batch_optimize_tours.js + * region_tag:routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async + */ + batchOptimizeTours( + request?: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchOptimizeTours( + request: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchOptimizeTours( + request: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, + callback: Callback< + LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchOptimizeTours( + request?: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchOptimizeTours(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchOptimizeTours()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/route_optimization.batch_optimize_tours.js + * region_tag:routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async + */ + async checkBatchOptimizeToursProgress( + name: string + ): Promise< + LROperation< + protos.google.maps.routeoptimization.v1.BatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.batchOptimizeTours, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.maps.routeoptimization.v1.BatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + >; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.routeOptimizationStub && !this._terminated) { + return this.routeOptimizationStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-maps-routeoptimization/src/v1/route_optimization_client_config.json b/packages/google-maps-routeoptimization/src/v1/route_optimization_client_config.json new file mode 100644 index 00000000000..15dc3455be8 --- /dev/null +++ b/packages/google-maps-routeoptimization/src/v1/route_optimization_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.maps.routeoptimization.v1.RouteOptimization": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "OptimizeTours": { + "timeout_millis": 3600000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "BatchOptimizeTours": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-maps-routeoptimization/src/v1/route_optimization_proto_list.json b/packages/google-maps-routeoptimization/src/v1/route_optimization_proto_list.json new file mode 100644 index 00000000000..8ab54e6af04 --- /dev/null +++ b/packages/google-maps-routeoptimization/src/v1/route_optimization_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/maps/routeoptimization/v1/route_optimization_service.proto" +] diff --git a/packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.js b/packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..56fa115a233 --- /dev/null +++ b/packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const routeoptimization = require('@googlemaps/routeoptimization'); + +function main() { + const routeOptimizationClient = + new routeoptimization.RouteOptimizationClient(); +} + +main(); diff --git a/packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.ts b/packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..9822871db6b --- /dev/null +++ b/packages/google-maps-routeoptimization/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {RouteOptimizationClient} from '@googlemaps/routeoptimization'; + +// check that the client class type name can be used +function doStuffWithRouteOptimizationClient(client: RouteOptimizationClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const routeOptimizationClient = new RouteOptimizationClient(); + doStuffWithRouteOptimizationClient(routeOptimizationClient); +} + +main(); diff --git a/packages/google-maps-routeoptimization/system-test/install.ts b/packages/google-maps-routeoptimization/system-test/install.ts new file mode 100644 index 00000000000..83b83f332c3 --- /dev/null +++ b/packages/google-maps-routeoptimization/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-maps-routeoptimization/test/gapic_route_optimization_v1.ts b/packages/google-maps-routeoptimization/test/gapic_route_optimization_v1.ts new file mode 100644 index 00000000000..4195eb4463b --- /dev/null +++ b/packages/google-maps-routeoptimization/test/gapic_route_optimization_v1.ts @@ -0,0 +1,932 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as routeoptimizationModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.RouteOptimizationClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'routeoptimization.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + routeoptimizationModule.v1.RouteOptimizationClient.servicePath; + assert.strictEqual(servicePath, 'routeoptimization.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + routeoptimizationModule.v1.RouteOptimizationClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'routeoptimization.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routeoptimization.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routeoptimization.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new routeoptimizationModule.v1.RouteOptimizationClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routeoptimization.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new routeoptimizationModule.v1.RouteOptimizationClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'routeoptimization.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new routeoptimizationModule.v1.RouteOptimizationClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = routeoptimizationModule.v1.RouteOptimizationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.routeOptimizationStub, undefined); + await client.initialize(); + assert(client.routeOptimizationStub); + }); + + it('has close method for the initialized client', done => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.routeOptimizationStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.routeOptimizationStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('optimizeTours', () => { + it('invokes optimizeTours without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.OptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.OptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.OptimizeToursResponse() + ); + client.innerApiCalls.optimizeTours = stubSimpleCall(expectedResponse); + const [response] = await client.optimizeTours(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.optimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.optimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes optimizeTours without error using callback', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.OptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.OptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.OptimizeToursResponse() + ); + client.innerApiCalls.optimizeTours = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.optimizeTours( + request, + ( + err?: Error | null, + result?: protos.google.maps.routeoptimization.v1.IOptimizeToursResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.optimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.optimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes optimizeTours with error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.OptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.OptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.optimizeTours = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.optimizeTours(request), expectedError); + const actualRequest = ( + client.innerApiCalls.optimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.optimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes optimizeTours with closed client', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.OptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.OptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.optimizeTours(request), expectedError); + }); + }); + + describe('batchOptimizeTours', () => { + it('invokes batchOptimizeTours without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.BatchOptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.BatchOptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchOptimizeTours = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchOptimizeTours(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchOptimizeTours without error using callback', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.BatchOptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.BatchOptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchOptimizeTours = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchOptimizeTours( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, + protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchOptimizeTours with call error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.BatchOptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.BatchOptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchOptimizeTours = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchOptimizeTours(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchOptimizeTours with LRO error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routeoptimization.v1.BatchOptimizeToursRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.routeoptimization.v1.BatchOptimizeToursRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchOptimizeTours = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchOptimizeTours(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchOptimizeTours as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchOptimizeToursProgress without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchOptimizeToursProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchOptimizeToursProgress with error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBatchOptimizeToursProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new routeoptimizationModule.v1.RouteOptimizationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); +}); diff --git a/packages/google-maps-routeoptimization/tsconfig.json b/packages/google-maps-routeoptimization/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-maps-routeoptimization/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-maps-routeoptimization/webpack.config.js b/packages/google-maps-routeoptimization/webpack.config.js new file mode 100644 index 00000000000..fc4e52be1d6 --- /dev/null +++ b/packages/google-maps-routeoptimization/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'RouteOptimization', + filename: './route-optimization.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index b47f551fefc..207de2eb2d1 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -178,7 +178,8 @@ "packages/google-shopping-merchant-lfp": {}, "packages/google-cloud-securitycentermanagement": {}, "packages/google-shopping-merchant-conversions": {}, - "packages/google-maps-solar": {} + "packages/google-maps-solar": {}, + "packages/google-maps-routeoptimization": {} }, "plugins": [ { From dde1c6e46f9eb9b6c1e5455f09f521e2e40b200d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 12:54:53 -0700 Subject: [PATCH 2/2] chore: release main (#5374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release main * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .release-please-manifest.json | 11 +- changelog.json | 103 +++++++++++++++++- packages/google-cloud-gkehub/CHANGELOG.md | 7 ++ packages/google-cloud-gkehub/package.json | 2 +- ...ippet_metadata.google.cloud.gkehub.v1.json | 2 +- ...ippet_metadata_google.cloud.gkehub.v1.json | 2 +- ..._metadata.google.cloud.gkehub.v1alpha.json | 2 +- ..._metadata_google.cloud.gkehub.v1alpha.json | 2 +- ...metadata.google.cloud.gkehub.v1alpha2.json | 2 +- ...metadata_google.cloud.gkehub.v1alpha2.json | 2 +- ...t_metadata.google.cloud.gkehub.v1beta.json | 2 +- ...t_metadata_google.cloud.gkehub.v1beta.json | 2 +- ..._metadata.google.cloud.gkehub.v1beta1.json | 2 +- ..._metadata_google.cloud.gkehub.v1beta1.json | 2 +- .../google-cloud-gkehub/samples/package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- ...gle.cloud.securitycentermanagement.v1.json | 2 +- .../samples/package.json | 2 +- packages/google-maps-places/CHANGELOG.md | 7 ++ packages/google-maps-places/package.json | 2 +- ...nippet_metadata.google.maps.places.v1.json | 2 +- ...nippet_metadata_google.maps.places.v1.json | 2 +- .../google-maps-places/samples/package.json | 2 +- .../CHANGELOG.md | 10 ++ .../package.json | 2 +- ...data_google.maps.routeoptimization.v1.json | 2 +- .../samples/package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- ...ogle.shopping.merchant.reports.v1beta.json | 2 +- .../samples/package.json | 2 +- 32 files changed, 171 insertions(+), 31 deletions(-) create mode 100644 packages/google-maps-routeoptimization/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 232b2967e41..8c8cc762ab1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -70,7 +70,7 @@ "packages/google-cloud-functions": "3.4.0", "packages/google-cloud-gkebackup": "1.4.0", "packages/google-cloud-gkeconnect-gateway": "3.3.0", - "packages/google-cloud-gkehub": "4.3.0", + "packages/google-cloud-gkehub": "4.4.0", "packages/google-cloud-gkemulticloud": "1.4.0", "packages/google-cloud-gsuiteaddons": "1.3.0", "packages/google-cloud-iap": "3.4.0", @@ -149,7 +149,7 @@ "packages/google-identity-accesscontextmanager": "3.3.0", "packages/google-maps-addressvalidation": "2.4.0", "packages/google-maps-mapsplatformdatasets": "1.3.0", - "packages/google-maps-places": "1.5.0", + "packages/google-maps-places": "1.6.0", "packages/google-maps-routing": "1.3.0", "packages/google-monitoring-dashboard": "3.3.0", "packages/google-privacy-dlp": "5.6.0", @@ -157,7 +157,7 @@ "packages/grafeas": "5.4.0", "packages/typeless-sample-bot": "2.1.0", "packages/google-cloud-edgenetwork": "0.5.0", - "packages/google-shopping-merchant-reports": "0.6.0", + "packages/google-shopping-merchant-reports": "0.7.0", "packages/google-shopping-merchant-inventories": "0.6.0", "packages/google-shopping-css": "0.5.0", "packages/google-api-cloudquotas": "0.4.0", @@ -175,7 +175,8 @@ "packages/google-cloud-securesourcemanager": "0.2.0", "packages/google-shopping-merchant-notifications": "0.3.0", "packages/google-shopping-merchant-lfp": "0.3.0", - "packages/google-cloud-securitycentermanagement": "0.2.0", + "packages/google-cloud-securitycentermanagement": "0.3.0", "packages/google-shopping-merchant-conversions": "0.2.0", - "packages/google-maps-solar": "0.2.0" + "packages/google-maps-solar": "0.2.0", + "packages/google-maps-routeoptimization": "0.1.0" } diff --git a/changelog.json b/changelog.json index 523e074a9df..d2c1c468b81 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,107 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "723d429fc69717376df5ee5fcbb620311080b3fe", + "message": "Add initial files for google.maps.routeoptimization.v1", + "issues": [ + "5362" + ] + }, + { + "type": "feat", + "sha": "a9784ed3db6ee96d171762308bbbcd57390b6866", + "message": "[Many APIs] update Nodejs generator to send API versions in headers for GAPICs", + "issues": [ + "5354" + ] + }, + { + "type": "feat", + "sha": "01f48fce63ec4ddf801d59ee2b8c0db9f6fb8372", + "message": "[Many APIs] update Nodejs generator to send API versions in headers for GAPICs", + "issues": [ + "5351" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/routeoptimization", + "id": "d3886e3c-3a26-4f0f-a256-5cbd09c08ca5", + "createTime": "2024-05-23T18:44:11.657Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "564b48ca4048a96e3f3ca37085e8712fa63aa1c8", + "message": "[securitycentermanagement] Adding support for new Security Center Management Apis", + "issues": [ + "5377" + ] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securitycentermanagement", + "id": "80242c02-58fe-406f-9f89-98517e2e5ce2", + "createTime": "2024-05-23T18:44:11.643Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "9e5778cf6bd2fae5141150ed00bdd1ed44643ca4", + "message": "[merchantapi] add `non_product_performance_view` table to Reports sub-API", + "issues": [ + "5372" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reports", + "id": "6c23077d-7a91-4856-85be-f98a905ab524", + "createTime": "2024-05-23T18:44:11.628Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b0fbf7b73894284dd46aea5faa0a91f97123a194", + "message": "[places] add `generative_summary` and `area_summary` for place summaries", + "issues": [ + "5364" + ] + } + ], + "version": "1.6.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/places", + "id": "b4f36c9d-2856-4c97-bec1-2ed2f1fd4de4", + "createTime": "2024-05-23T18:44:11.612Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0c4c15d88fc06402ab665b9b7e29302f3406da45", + "message": "[gkehub] Add ServiceMesh feature to gkehub v1beta API", + "issues": [ + "5368" + ] + } + ], + "version": "4.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-hub", + "id": "392fb302-b59b-46ab-bd97-7e6c51e414be", + "createTime": "2024-05-23T18:44:11.598Z" + }, { "changes": [ { @@ -33996,5 +34097,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2024-05-21T06:26:21.907Z" + "updateTime": "2024-05-23T18:44:11.657Z" } \ No newline at end of file diff --git a/packages/google-cloud-gkehub/CHANGELOG.md b/packages/google-cloud-gkehub/CHANGELOG.md index 49f6d22d905..92712e73776 100644 --- a/packages/google-cloud-gkehub/CHANGELOG.md +++ b/packages/google-cloud-gkehub/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.4.0](https://github.com/googleapis/google-cloud-node/compare/gke-hub-v4.3.0...gke-hub-v4.4.0) (2024-05-23) + + +### Features + +* [gkehub] Add ServiceMesh feature to gkehub v1beta API ([#5368](https://github.com/googleapis/google-cloud-node/issues/5368)) ([0c4c15d](https://github.com/googleapis/google-cloud-node/commit/0c4c15d88fc06402ab665b9b7e29302f3406da45)) + ## [4.3.0](https://github.com/googleapis/google-cloud-node/compare/gke-hub-v4.2.0...gke-hub-v4.3.0) (2024-05-21) diff --git a/packages/google-cloud-gkehub/package.json b/packages/google-cloud-gkehub/package.json index c37e49da525..b836c741130 100644 --- a/packages/google-cloud-gkehub/package.json +++ b/packages/google-cloud-gkehub/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/gke-hub", - "version": "4.3.0", + "version": "4.4.0", "description": "Gkehub client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json index 03dbd8bb899..5726dc62925 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json index 03dbd8bb899..5726dc62925 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json index 61033f49acc..ff15ec486af 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json index 61033f49acc..ff15ec486af 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json index 507ec5c48a5..fb65b8ad896 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json index 507ec5c48a5..fb65b8ad896 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json index 1e40590701c..6a8bf8071ac 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json index 1e40590701c..6a8bf8071ac 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json index 232d499930b..021ff72fa89 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json index 232d499930b..021ff72fa89 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/package.json b/packages/google-cloud-gkehub/samples/package.json index 119141a2731..6486ff00909 100644 --- a/packages/google-cloud-gkehub/samples/package.json +++ b/packages/google-cloud-gkehub/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/gke-hub": "^4.3.0" + "@google-cloud/gke-hub": "^4.4.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-securitycentermanagement/CHANGELOG.md b/packages/google-cloud-securitycentermanagement/CHANGELOG.md index 9874376fa9c..ccdd938bf01 100644 --- a/packages/google-cloud-securitycentermanagement/CHANGELOG.md +++ b/packages/google-cloud-securitycentermanagement/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.3.0](https://github.com/googleapis/google-cloud-node/compare/securitycentermanagement-v0.2.0...securitycentermanagement-v0.3.0) (2024-05-23) + + +### Features + +* [securitycentermanagement] Adding support for new Security Center Management Apis ([#5377](https://github.com/googleapis/google-cloud-node/issues/5377)) ([564b48c](https://github.com/googleapis/google-cloud-node/commit/564b48ca4048a96e3f3ca37085e8712fa63aa1c8)) + ## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/securitycentermanagement-v0.1.0...securitycentermanagement-v0.2.0) (2024-05-21) diff --git a/packages/google-cloud-securitycentermanagement/package.json b/packages/google-cloud-securitycentermanagement/package.json index b9f9e818e64..e0d93f25014 100644 --- a/packages/google-cloud-securitycentermanagement/package.json +++ b/packages/google-cloud-securitycentermanagement/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/securitycentermanagement", - "version": "0.2.0", + "version": "0.3.0", "description": "Security Center Management API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json b/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json index 099e28f301f..2bae9ada603 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycentermanagement", - "version": "0.2.0", + "version": "0.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycentermanagement/samples/package.json b/packages/google-cloud-securitycentermanagement/samples/package.json index 147c254ea19..eae0c7e27e7 100644 --- a/packages/google-cloud-securitycentermanagement/samples/package.json +++ b/packages/google-cloud-securitycentermanagement/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/securitycentermanagement": "^0.2.0" + "@google-cloud/securitycentermanagement": "^0.3.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-maps-places/CHANGELOG.md b/packages/google-maps-places/CHANGELOG.md index 26194f0021a..37d463c7eee 100644 --- a/packages/google-maps-places/CHANGELOG.md +++ b/packages/google-maps-places/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.6.0](https://github.com/googleapis/google-cloud-node/compare/places-v1.5.0...places-v1.6.0) (2024-05-23) + + +### Features + +* [places] add `generative_summary` and `area_summary` for place summaries ([#5364](https://github.com/googleapis/google-cloud-node/issues/5364)) ([b0fbf7b](https://github.com/googleapis/google-cloud-node/commit/b0fbf7b73894284dd46aea5faa0a91f97123a194)) + ## [1.5.0](https://github.com/googleapis/google-cloud-node/compare/places-v1.4.0...places-v1.5.0) (2024-05-21) diff --git a/packages/google-maps-places/package.json b/packages/google-maps-places/package.json index 4f7a8db24b8..eae53ce10bf 100644 --- a/packages/google-maps-places/package.json +++ b/packages/google-maps-places/package.json @@ -1,6 +1,6 @@ { "name": "@googlemaps/places", - "version": "1.5.0", + "version": "1.6.0", "description": "Places API (New) client for Node.js", "repository": { "type": "git", diff --git a/packages/google-maps-places/samples/generated/v1/snippet_metadata.google.maps.places.v1.json b/packages/google-maps-places/samples/generated/v1/snippet_metadata.google.maps.places.v1.json index 34081bf4d7c..aa715189e3e 100644 --- a/packages/google-maps-places/samples/generated/v1/snippet_metadata.google.maps.places.v1.json +++ b/packages/google-maps-places/samples/generated/v1/snippet_metadata.google.maps.places.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-places", - "version": "1.4.0", + "version": "1.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json b/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json index 4b098aa2083..e9509fa94d0 100644 --- a/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json +++ b/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-places", - "version": "1.4.0", + "version": "1.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-maps-places/samples/package.json b/packages/google-maps-places/samples/package.json index 012ff224d96..751f0e6e3ac 100644 --- a/packages/google-maps-places/samples/package.json +++ b/packages/google-maps-places/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@googlemaps/places": "^1.5.0" + "@googlemaps/places": "^1.6.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-maps-routeoptimization/CHANGELOG.md b/packages/google-maps-routeoptimization/CHANGELOG.md new file mode 100644 index 00000000000..20cf7264232 --- /dev/null +++ b/packages/google-maps-routeoptimization/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 0.1.0 (2024-05-23) + + +### Features + +* [Many APIs] update Nodejs generator to send API versions in headers for GAPICs ([#5351](https://github.com/googleapis/google-cloud-node/issues/5351)) ([01f48fc](https://github.com/googleapis/google-cloud-node/commit/01f48fce63ec4ddf801d59ee2b8c0db9f6fb8372)) +* [Many APIs] update Nodejs generator to send API versions in headers for GAPICs ([#5354](https://github.com/googleapis/google-cloud-node/issues/5354)) ([a9784ed](https://github.com/googleapis/google-cloud-node/commit/a9784ed3db6ee96d171762308bbbcd57390b6866)) +* Add initial files for google.maps.routeoptimization.v1 ([#5362](https://github.com/googleapis/google-cloud-node/issues/5362)) ([723d429](https://github.com/googleapis/google-cloud-node/commit/723d429fc69717376df5ee5fcbb620311080b3fe)) diff --git a/packages/google-maps-routeoptimization/package.json b/packages/google-maps-routeoptimization/package.json index e526ec89f85..b6197fa1dc8 100644 --- a/packages/google-maps-routeoptimization/package.json +++ b/packages/google-maps-routeoptimization/package.json @@ -1,6 +1,6 @@ { "name": "@googlemaps/routeoptimization", - "version": "0.0.0", + "version": "0.1.0", "description": "Route Optimization API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json b/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json index 4f145bce9f2..de4c96a74ff 100644 --- a/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json +++ b/packages/google-maps-routeoptimization/samples/generated/v1/snippet_metadata_google.maps.routeoptimization.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-routeoptimization", - "version": "0.0.0", + "version": "0.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-maps-routeoptimization/samples/package.json b/packages/google-maps-routeoptimization/samples/package.json index 101ec6e65da..f53f2587695 100644 --- a/packages/google-maps-routeoptimization/samples/package.json +++ b/packages/google-maps-routeoptimization/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@googlemaps/routeoptimization": "0.0.0" + "@googlemaps/routeoptimization": "^0.1.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-shopping-merchant-reports/CHANGELOG.md b/packages/google-shopping-merchant-reports/CHANGELOG.md index 7e863936529..f39f70c44bb 100644 --- a/packages/google-shopping-merchant-reports/CHANGELOG.md +++ b/packages/google-shopping-merchant-reports/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.7.0](https://github.com/googleapis/google-cloud-node/compare/reports-v0.6.0...reports-v0.7.0) (2024-05-23) + + +### Features + +* [merchantapi] add `non_product_performance_view` table to Reports sub-API ([#5372](https://github.com/googleapis/google-cloud-node/issues/5372)) ([9e5778c](https://github.com/googleapis/google-cloud-node/commit/9e5778cf6bd2fae5141150ed00bdd1ed44643ca4)) + ## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/reports-v0.5.0...reports-v0.6.0) (2024-05-21) diff --git a/packages/google-shopping-merchant-reports/package.json b/packages/google-shopping-merchant-reports/package.json index cca49df9cb4..050911abade 100644 --- a/packages/google-shopping-merchant-reports/package.json +++ b/packages/google-shopping-merchant-reports/package.json @@ -1,6 +1,6 @@ { "name": "@google-shopping/reports", - "version": "0.6.0", + "version": "0.7.0", "description": "Merchant API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-shopping-merchant-reports/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.reports.v1beta.json b/packages/google-shopping-merchant-reports/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.reports.v1beta.json index 773dce7c248..1acf1cce0d9 100644 --- a/packages/google-shopping-merchant-reports/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.reports.v1beta.json +++ b/packages/google-shopping-merchant-reports/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.reports.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-reports", - "version": "0.6.0", + "version": "0.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-shopping-merchant-reports/samples/package.json b/packages/google-shopping-merchant-reports/samples/package.json index 97e86b202e3..a0da6c1a90c 100644 --- a/packages/google-shopping-merchant-reports/samples/package.json +++ b/packages/google-shopping-merchant-reports/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-shopping/reports": "^0.6.0" + "@google-shopping/reports": "^0.7.0" }, "devDependencies": { "c8": "^9.0.0",